]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
xen/arm: acpi: Don't fail if SPCR table is absent
authorElliott Mitchell <ehem+xen@m5p.com>
Wed, 21 Oct 2020 22:12:53 +0000 (15:12 -0700)
committerJulien Grall <jgrall@amazon.com>
Thu, 22 Oct 2020 18:41:51 +0000 (19:41 +0100)
Absence of a SPCR table likely means the console is a framebuffer.  In
such case acpi_iomem_deny_access() should NOT fail.

Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
Acked-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/acpi/domain_build.c

index 1b1cfabb009de5b6a086b9998683b63d590254e0..bbdc90f92c003c0c6d0f0b0290a1776336224719 100644 (file)
@@ -42,17 +42,18 @@ static int __init acpi_iomem_deny_access(struct domain *d)
     status = acpi_get_table(ACPI_SIG_SPCR, 0,
                             (struct acpi_table_header **)&spcr);
 
-    if ( ACPI_FAILURE(status) )
+    if ( ACPI_SUCCESS(status) )
     {
-        printk("Failed to get SPCR table\n");
-        return -EINVAL;
+        mfn = spcr->serial_port.address >> PAGE_SHIFT;
+        /* Deny MMIO access for UART */
+        rc = iomem_deny_access(d, mfn, mfn + 1);
+        if ( rc )
+            return rc;
+    }
+    else
+    {
+        printk("Failed to get SPCR table, Xen console may be unavailable\n");
     }
-
-    mfn = spcr->serial_port.address >> PAGE_SHIFT;
-    /* Deny MMIO access for UART */
-    rc = iomem_deny_access(d, mfn, mfn + 1);
-    if ( rc )
-        return rc;
 
     /* Deny MMIO access for GIC regions */
     return gic_iomem_deny_access(d);