[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.6] xen/arm: Survive unknown traps from guests



commit 16cfd7d7549ceb597819896cde16f2e043073628
Author:     Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Fri May 5 15:30:36 2017 +0100
Commit:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
CommitDate: Mon Jun 12 14:18:51 2017 -0700

    xen/arm: Survive unknown traps from guests
    
    Currently we crash Xen if we see an ESR_EL2.EC value we don't recognise.
    As configurable disables/enables are added to the architecture
    (controlled by RES1/RESO bits respectively), with associated synchronous
    exceptions, it may be possible for a guest to trigger exceptions with
    classes that we don't recognise.
    
    While we can't service these exceptions in a manner useful to the guest,
    we can avoid bringing down the host. Per ARM DDI 0487A.k_iss10775, page
    D7-1937, EC values within the range 0x00 - 0x2c are reserved for future
    use with synchronous exceptions, and EC within the range 0x2d - 0x3f may
    be used for either synchronous or asynchronous exceptions.
    
    The patch makes Xen handle any unknown EC by injecting an UNDEFINED
    exception into the guest, with a corresponding (ratelimited) warning in
    the log.
    
    This patch is based on Linux commit f050fe7a9164 "arm: KVM: Survive unknown
    traps from the guest".
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
    Acked-by: Mark Rutland <mark.rutland@xxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    master-commit-id: baf2950213e6a50801940643e2549a5baa21ad71
---
 xen/arch/arm/traps.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index c5aa804..58c4c84 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2636,9 +2636,10 @@ asmlinkage void do_trap_guest_sync(struct cpu_user_regs 
*regs)
         break;
 
     default:
-        printk("Unknown Guest Trap. HSR=0x%x EC=0x%x IL=%x 
Syndrome=0x%"PRIx32"\n",
-               hsr.bits, hsr.ec, hsr.len, hsr.iss);
-        do_unexpected_trap("Guest", regs);
+        gprintk(XENLOG_WARNING,
+                "Unknown Guest Trap. HSR=0x%x EC=0x%x IL=%x 
Syndrome=0x%"PRIx32"\n",
+                hsr.bits, hsr.ec, hsr.len, hsr.iss);
+        inject_undef_exception(regs, hsr);
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.