xen/arm: fix unmapped access trapping on GICv2 hardware
PATCH 1/1 xen/arm: fix unmapped access trapping on GICv2 hardware
Since 4dbcb0653621, the vGICv2 CPU interface is mapped in a deferred manner. On domains with XEN_DOMCTL_CDF_trap_unmapped_accesses unset on GICv2 hardware, the vGICv2 CPU interface fails to be mapped. A visible symptom is that a domU gets stuck at:
[ 0.177983] smp: Bringing up secondary CPUs ...
Move the 2nd check_p2m earlier so it's prioritized over try_handle_mmio.
---
This should be backported to 4.21.
Pipeline: https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/pipelines/2010469665
--- xen/arch/arm/traps.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
xen/arch/arm/traps.c +8 -8
@@ -1915,6 +1915,14 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,if ( info.dabt_instr.state ==INSTR_ERROR ) goto inject_abt; +/* +* If the instruction syndrome was invalid, then we already checked if +* this was due to a P2M fault. So no point to check again as the result +* will be the same. +*/ +if ( (info.dabt_instr.state ==INSTR_VALID ) &&check_p2m (is_data, gpa) ) +return ; + state =try_handle_mmio (regs, &info); switch ( state )
@@ -1939,14 +1947,6 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,break ; } -/* -* If the instruction syndrome was invalid, then we already checked if -* this was due to a P2M fault. So no point to check again as the result -* will be the same. -*/ -if ( (info.dabt_instr.state ==INSTR_VALID ) &&check_p2m (is_data, gpa) ) -return ; -break ; }default :
Signature · 1 line
2.52.0
Gentle ping.
To be clear, domU interrupts with vGICv2 are currently broken when XEN_DOMCTL_CDF_trap_unmapped_accesses is not set.
Quoted 53 lines · Stewart Hildebrand
Since
4dbcb0653621, the vGICv2 CPU interface is mapped in a deferred manner. On domains withXEN_DOMCTL_CDF_trap_unmapped_accessesunset on GICv2 hardware, the vGICv2 CPU interface fails to be mapped. A visible symptom is that a domU gets stuck at:[ 0.177983] smp: Bringing up secondary CPUs ...Move the 2nd
check_p2mearlier so it's prioritized overtry_handle_mmio.Fixes 980aff4e8fcd ("xen/arm: Add way to disable traps on accesses to unmapped addresses")Signed-off-by Stewart Hildebrand <[email protected]>---
This should be backported to 4.21.Pipeline: https://gitlab.com/xen-project/people/stewarthildebrand/xen/-/pipelines/2010469665
--- xen/arch/arm/traps.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)xen/arch/arm/traps.c +8
-8@@ -1915,6 +1915,14 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,if ( info.dabt_instr.state ==INSTR_ERROR ) goto inject_abt; +/* +* If the instruction syndrome was invalid, then we already checked if +* this was due to a P2M fault. So no point to check again as the result +* will be the same. +*/ +if ( (info.dabt_instr.state ==INSTR_VALID ) &&check_p2m (is_data, gpa) ) +return ; + state =try_handle_mmio (regs, &info); switch ( state )@@ -1939,14 +1947,6 @@ static void do_trap_stage2_abort_guest(struct cpu_user_regs *regs,break ; } -/* -* If the instruction syndrome was invalid, then we already checked if -* this was due to a P2M fault. So no point to check again as the result -* will be the same. -*/ -if ( (info.dabt_instr.state ==INSTR_VALID ) &&check_p2m (is_data, gpa) ) -return ; -break ; }default :
Orzel, Michal
Reviewed-byQuoted 1 line · Stewart Hildebrand
Gentle ping.
Sorry, I'm quite busy these days.
Quoted 16 lines
To be clear, domU interrupts with vGICv2 are currently broken when
XEN_DOMCTL_CDF_trap_unmapped_accessesis not set.Quoted 11 lines · Stewart Hildebrand
Since
4dbcb0653621, the vGICv2 CPU interface is mapped in a deferred manner. On domains withXEN_DOMCTL_CDF_trap_unmapped_accessesunset on GICv2 hardware, the vGICv2 CPU interface fails to be mapped. A visible symptom is that a domU gets stuck at:[ 0.177983] smp: Bringing up secondary CPUs ...Move the 2nd
check_p2mearlier so it's prioritized overtry_handle_mmio.Fixes 980aff4e8fcd ("xen/arm: Add way to disable traps on accesses to unmapped addresses")Signed-off-by Stewart Hildebrand <[email protected]>
I investigated whether the reordering is safe and it looks ok:
~Michal
Quoted 16 lines · Michal
Quoted 1 line · Stewart Hildebrand
Gentle ping.
Sorry, I'm quite busy these days.
Quoted 10 lines
To be clear, domU interrupts with vGICv2 are currently broken when
XEN_DOMCTL_CDF_trap_unmapped_accessesis not set.Quoted 5 lines · Stewart Hildebrand
Since
4dbcb0653621, the vGICv2 CPU interface is mapped in a deferred manner. On domains withXEN_DOMCTL_CDF_trap_unmapped_accessesunset on GICv2 hardware, the vGICv2 CPU interface fails to be mapped. A visible symptom is that a domU gets stuck at:
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
[ 0.177983] smp: Bringing up secondary CPUs ...Move the 2nd
check_p2mearlier so it's prioritized overtry_handle_mmio.Fixes 980aff4e8fcd ("xen/arm: Add way to disable traps on accesses to unmapped addresses")Signed-off-by Stewart Hildebrand <[email protected]>I investigated whether the reordering is safe and it looks ok:
Reviewed-by Michal Orzel <[email protected]>
Thanks! Is there any other feedback? Is this ready for commit?
Quoted 19 lines · Stewart Hildebrand
Quoted 18 lines · Michal
Quoted 1 line · Stewart Hildebrand
Gentle ping.
Sorry, I'm quite busy these days.
Quoted 12 lines
To be clear, domU interrupts with vGICv2 are currently broken when
XEN_DOMCTL_CDF_trap_unmapped_accessesis not set.Quoted 7 lines · Stewart Hildebrand
Since
4dbcb0653621, the vGICv2 CPU interface is mapped in a deferred manner. On domains withXEN_DOMCTL_CDF_trap_unmapped_accessesunset on GICv2 hardware, the vGICv2 CPU interface fails to be mapped. A visible symptom is that a domU gets stuck at:[ 0.177983] smp: Bringing up secondary CPUs ...
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
Move the 2nd
check_p2mearlier so it's prioritized overtry_handle_mmio.Fixes 980aff4e8fcd ("xen/arm: Add way to disable traps on accesses to unmapped addresses")Signed-off-by Stewart Hildebrand <[email protected]>I investigated whether the reordering is safe and it looks ok:
Reviewed-by Michal Orzel <[email protected]>Thanks! Is there any other feedback? Is this ready for commit?
It's ready, will commit tomorrow.
~Michal