From a6f681cf110a1833cfe46d514cb8824e9b63fe22 Mon Sep 17 00:00:00 2001 From: Tamas K Lengyel Date: Wed, 28 Sep 2016 16:23:05 -0700 Subject: [PATCH] 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 --- xen/arch/arm/traps.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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: /* -- 2.30.2