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

[Xen-devel] [PATCH][v4] xen: Pass the location of the ACPI RSDP to DOM0.



xen: [v4] Pass the location of the ACPI RSDP to DOM0.

Some machines, such as recent IBM servers, only allow the OS to get the
ACPI RSDP from EFI. Since Xen nukes DOM0's ability to access EFI, DOM0
cannot get the RSDP on these machines, leading to all sorts of
functionality reductions.

Signed-off-by: Philip Wernersbach <philip.wernersbach@xxxxxxxxx>

---
Changed since v3:
    * Use standard pointer print for snprintf
    * Add an option to enable or disable ACPI RSDP passthrough
    * Only passthrough when running in EFI and acpi_rsdp_passthrough is enabled

Changed since v2:
    * Fix coding style
    * Get rid of extra define
    * Use correct typedef'd type for the ACPI RSDP pointer
    * Better error checking conditional
    * Simplify error message

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 6d7984f..ce8ffbe 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -57,6 +57,7 @@ bool_t __initdata acpi_lapic;
 bool_t __initdata acpi_ioapic;

 bool_t acpi_skip_timer_override __initdata;
+bool_t acpi_rsdp_passthrough    __initdata;

 #ifdef CONFIG_X86_LOCAL_APIC
 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index b49256d..7827b5f 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -75,6 +75,11 @@ custom_param("acpi", parse_acpi_param);
 boolean_param("acpi_skip_timer_override", acpi_skip_timer_override);

 /* **** Linux config option: propagated to domain0. */
+/* acpi_rsdp_passthrough: Explicitly pass the ACPI RSDP pointer to */
+/*                        domain0 via the acpi_rsdp option.        */
+boolean_param("acpi_rsdp_passthrough", acpi_rsdp_passthrough);
+
+/* **** Linux config option: propagated to domain0. */
 /* noapic: Disable IOAPIC setup. */
 boolean_param("noapic", skip_ioapic_setup);

@@ -1378,6 +1383,26 @@ void __init __start_xen(unsigned long mbi_p)
             safe_strcat(dom0_cmdline, " acpi=");
             safe_strcat(dom0_cmdline, acpi_param);
         }
+        if ( efi_enabled && acpi_rsdp_passthrough &&
+             !strstr(dom0_cmdline, "acpi_rsdp=") )
+        {
+            acpi_physical_address rp = acpi_os_get_root_pointer();
+            char rp_str[sizeof(acpi_physical_address)*2 + 3];
+
+            if ( rp )
+            {
+                snprintf(rp_str, sizeof(acpi_physical_address)*2 + 3,
+                         "%p", (void *)rp);
+
+                safe_strcat(dom0_cmdline, " acpi_rsdp=");
+                safe_strcat(dom0_cmdline, rp_str);
+            }
+            else
+            {
+                printk(XENLOG_WARNING
+                       "Failed to get acpi_rsdp to pass to dom0\n");
+            }
+        }

         cmdline = dom0_cmdline;
     }
diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h
index a7b11b8..e13f873 100644
--- a/xen/include/asm-x86/acpi.h
+++ b/xen/include/asm-x86/acpi.h
@@ -81,6 +81,7 @@ int __acpi_release_global_lock(unsigned int *lock);
 extern bool_t acpi_lapic, acpi_ioapic, acpi_noirq;
 extern bool_t acpi_force, acpi_ht, acpi_disabled;
 extern bool_t acpi_skip_timer_override;
+extern bool_t acpi_rsdp_passthrough;
 extern u32 acpi_smi_cmd;
 extern u8 acpi_enable_value, acpi_disable_value;
 void acpi_pic_sci_set_trigger(unsigned int, u16);

Attachment: xen-master-pass-acpi-rsdp.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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