From: Tamas K Lengyel Date: Wed, 28 Sep 2016 23:23:05 +0000 (-0700) Subject: arm/mem_access: don't reinject stage 2 access exceptions X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~275 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a6f681cf110a1833cfe46d514cb8824e9b63fe22;p=xen.git arm/mem_access: don't reinject stage 2 access exceptions The only way a guest may trip with stage 2 access violation is if mem_access is or was in-use, so reinjecting these exceptions to the guest is never required. Requested-by: Julien Grall Signed-off-by: Tamas K Lengyel Signed-off-by: Stefano Stabellini Reviewed-by: Julien Grall Acked-by: Stefano Stabellini --- diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 98928d7347..bc5b29e7ab 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2440,12 +2440,12 @@ static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, .kind = hsr.iabt.s1ptw ? npfec_kind_in_gpt : npfec_kind_with_gla }; - rc = p2m_mem_access_check(gpa, gva, npfec); - - /* Trap was triggered by mem_access, work here is done */ - if ( !rc ) - return; - break; + p2m_mem_access_check(gpa, gva, npfec); + /* + * The only way to get here right now is because of mem_access, + * thus reinjecting the exception to the guest is never required. + */ + return; } case FSC_FLT_TRANS: /* @@ -2534,12 +2534,12 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs, .kind = dabt.s1ptw ? npfec_kind_in_gpt : npfec_kind_with_gla }; - rc = p2m_mem_access_check(info.gpa, info.gva, npfec); - - /* Trap was triggered by mem_access, work here is done */ - if ( !rc ) - return; - break; + p2m_mem_access_check(info.gpa, info.gva, npfec); + /* + * The only way to get here right now is because of mem_access, + * thus reinjecting the exception to the guest is never required. + */ + return; } case FSC_FLT_TRANS: /*