]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
arm/mem_access: don't reinject stage 2 access exceptions
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Wed, 28 Sep 2016 23:23:05 +0000 (16:23 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 28 Sep 2016 23:26:59 +0000 (16:26 -0700)
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 <julien.grall@arm.com>
Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c

index 98928d73471fc020d3b2b64f710d8bb7267ef5b9..bc5b29e7abcb3d687140af01bffef3965a7dfa63 100644 (file)
@@ -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:
         /*