]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/arm64/mm/fault.c
arm/arm64: KVM: add guest SEA support
[mirror_ubuntu-zesty-kernel.git] / arch / arm64 / mm / fault.c
index 0a78bf9bf77d55bf53c0726e668c7a36a55ab2d4..d60f29e19809e1680b1cd046639f103bb263526a 100644 (file)
@@ -514,6 +514,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
        struct siginfo info;
        const struct fault_info *inf;
+       int ret = 0;
 
        inf = esr_to_fault_info(esr);
        pr_err("Synchronous External Abort: %s (0x%08x) at 0x%016lx\n",
@@ -528,7 +529,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
                if (interrupts_enabled(regs))
                        nmi_enter();
 
-               ghes_notify_sea();
+               ret = ghes_notify_sea();
 
                if (interrupts_enabled(regs))
                        nmi_exit();
@@ -543,7 +544,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
                info.si_addr  = (void __user *)addr;
        arm64_notify_die("", regs, &info, esr);
 
-       return 0;
+       return ret;
 }
 
 static const struct fault_info fault_info[] = {
@@ -613,6 +614,23 @@ static const struct fault_info fault_info[] = {
        { do_bad,               SIGBUS,  0,             "unknown 63"                    },
 };
 
+/*
+ * Handle Synchronous External Aborts that occur in a guest kernel.
+ *
+ * The return value will be zero if the SEA was successfully handled
+ * and non-zero if there was an error processing the error or there was
+ * no error to process.
+ */
+int handle_guest_sea(phys_addr_t addr, unsigned int esr)
+{
+       int ret = -ENOENT;
+
+       if (IS_ENABLED(CONFIG_ACPI_APEI_SEA))
+               ret = ghes_notify_sea();
+
+       return ret;
+}
+
 /*
  * Dispatch a data abort to the relevant handler.
  */