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

[PATCH] xen: acpi: Hide UART address only if SPCR exists



Since there is a case that UEFI (EDK2) doesn't make the SPCR
table when it is booted with graphic console, ignore it if SPCR
doesn't exist.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@xxxxxxxxxx>
---
 xen/arch/arm/acpi/domain_build.c |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 1b1cfabb00..a50adbb9ab 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -40,20 +40,17 @@ static int __init acpi_iomem_deny_access(struct domain *d)
 
     /* TODO: Deny MMIO access for SMMU, GIC ITS */
     status = acpi_get_table(ACPI_SIG_SPCR, 0,
-                            (struct acpi_table_header **)&spcr);
-
-    if ( ACPI_FAILURE(status) )
+                        (struct acpi_table_header **)&spcr);
+    /* SPCR may not set when the UEFI uses graphical console. */
+    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;
     }
 
-    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);
 }




 


Rackspace

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