]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm64: entry: Check if an SError is pending when receiving a vSError
authorJulien Grall <julien.grall@arm.com>
Thu, 31 Oct 2019 15:09:11 +0000 (15:09 +0000)
committerJulien Grall <julien.grall@arm.com>
Fri, 1 Nov 2019 13:57:49 +0000 (13:57 +0000)
At the moment, when we receive an SError exception from the guest, we
don't check if there are any other pending. For hardening the code, we
should ensure any pending SError are accounted to the guest before
executing any code with SError unmasked.

The recently introduced macro 'guest_vector' could used to generate the
two vectors and therefore take advantage of any change required in the
future.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/arm/arm64/entry.S

index 2867c499da90d1a7fed20321dfb1d1b9f598117f..d94c13e7bf88a903050e1cac517be5ce615f2ff7 100644 (file)
@@ -381,11 +381,7 @@ guest_fiq_invalid:
         invalid BAD_FIQ
 
 guest_error:
-        entry   hyp=0, compat=0
-        msr     daifclr, #IFLAGS__AI_
-        mov     x0, sp
-        bl      do_trap_guest_serror
-        exit    hyp=0, compat=0
+        guest_vector compat=0, iflags=IFLAGS__AI_, trap=guest_serror
 
 guest_sync_compat:
         guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_sync
@@ -398,11 +394,7 @@ guest_fiq_invalid_compat:
         invalid BAD_FIQ
 
 guest_error_compat:
-        entry   hyp=0, compat=1
-        msr     daifclr, #IFLAGS__AI_
-        mov     x0, sp
-        bl      do_trap_guest_serror
-        exit    hyp=0, compat=1
+        guest_vector compat=1, iflags=IFLAGS__AI_, trap=guest_serror
 
 ENTRY(return_to_new_vcpu32)
         exit    hyp=0, compat=1