Skip to content

Commit 2a50fc5

Browse files
willdeaconMarc Zyngier
authored andcommitted
KVM: arm64: Handle host stage-2 faults from 32-bit EL0
When pKVM is enabled, host memory accesses are translated by an identity mapping at stage-2, which is populated lazily in response to synchronous exceptions from 64-bit EL1 and EL0. Extend this handling to cover exceptions originating from 32-bit EL0 as well. Although these are very unlikely to occur in practice, as the kernel typically ensures that user pages are initialised before mapping them in, drivers could still map previously untouched device pages into userspace and expect things to work rather than panic the system. Cc: Quentin Perret <[email protected]> Cc: Marc Zyngier <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 21db838 commit 2a50fc5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arch/arm64/kvm/hyp/nvhe/host.S

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,15 @@ SYM_CODE_START(__kvm_hyp_host_vector)
198198
invalid_host_el2_vect // FIQ EL2h
199199
invalid_host_el2_vect // Error EL2h
200200

201-
host_el1_sync_vect // Synchronous 64-bit EL1
202-
invalid_host_el1_vect // IRQ 64-bit EL1
203-
invalid_host_el1_vect // FIQ 64-bit EL1
204-
invalid_host_el1_vect // Error 64-bit EL1
205-
206-
invalid_host_el1_vect // Synchronous 32-bit EL1
207-
invalid_host_el1_vect // IRQ 32-bit EL1
208-
invalid_host_el1_vect // FIQ 32-bit EL1
209-
invalid_host_el1_vect // Error 32-bit EL1
201+
host_el1_sync_vect // Synchronous 64-bit EL1/EL0
202+
invalid_host_el1_vect // IRQ 64-bit EL1/EL0
203+
invalid_host_el1_vect // FIQ 64-bit EL1/EL0
204+
invalid_host_el1_vect // Error 64-bit EL1/EL0
205+
206+
host_el1_sync_vect // Synchronous 32-bit EL1/EL0
207+
invalid_host_el1_vect // IRQ 32-bit EL1/EL0
208+
invalid_host_el1_vect // FIQ 32-bit EL1/EL0
209+
invalid_host_el1_vect // Error 32-bit EL1/EL0
210210
SYM_CODE_END(__kvm_hyp_host_vector)
211211

212212
/*

0 commit comments

Comments
 (0)