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

Re: [Xen-devel] [PATCH for-xen-4.5 v4 14/18] x86: move MPS, ACPI and SMBIOS data to boot_info




On 17/10/2014 15:12, Daniel Kiper wrote:
Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
  xen/arch/x86/boot_info.c        |    5 +++++
  xen/arch/x86/dmi_scan.c         |   11 ++++++++---
  xen/arch/x86/mpparse.c          |   13 +++++++++----
  xen/common/efi/runtime.c        |   18 +++++++++++-------
  xen/drivers/acpi/osl.c          |   13 +++++++++----
  xen/include/asm-x86/boot_info.h |   12 ++++++++++++
  xen/include/xen/efi.h           |    7 +++++++
  7 files changed, 61 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/boot_info.c b/xen/arch/x86/boot_info.c
index 77e9d5a..c1a4977 100644
--- a/xen/arch/x86/boot_info.c
+++ b/xen/arch/x86/boot_info.c
@@ -23,6 +23,7 @@
#include <xen/types.h>
  #include <xen/cache.h>
+#include <xen/efi.h>
  #include <xen/init.h>
  #include <xen/multiboot.h>
@@ -47,6 +48,10 @@ static boot_info_t __read_mostly boot_info_mb = {
      .efi_mmap_size = 0,
      .efi_mmap_desc_size = 0,
      .efi_mmap = NULL,
+    .mps = EFI_INVALID_TABLE_ADDR,
+    .acpi = EFI_INVALID_TABLE_ADDR,
+    .acpi20 = EFI_INVALID_TABLE_ADDR,
+    .smbios = EFI_INVALID_TABLE_ADDR,
      .mods_nr = 0,
      .mods = NULL,
      .warn_msg = NULL,
diff --git a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c
index 500133a..94f81f3 100644
--- a/xen/arch/x86/dmi_scan.c
+++ b/xen/arch/x86/dmi_scan.c
@@ -12,6 +12,11 @@
  #include <xen/efi.h>
  #include <xen/pci.h>
  #include <xen/pci_regs.h>
+#ifndef CONFIG_ARM /* TODO - boot_info is not implemented on ARM yet */
+#include <asm/boot_info.h>
+#else
+#define boot_info      (&efi)
+#endif

I *really* hope CONFIG_ARM is not enabled in the arch/x86 subtree...

#define bt_ioremap(b,l) ((void *)__acpi_map_table(b,l))
  #define bt_iounmap(b,l)  ((void)0)
@@ -215,10 +220,10 @@ static int __init dmi_efi_iterate(void (*decode)(struct 
dmi_header *))
        const struct smbios_eps __iomem *p;
        int ret = -1;
- if (efi.smbios == EFI_INVALID_TABLE_ADDR)
+       if (boot_info->smbios == EFI_INVALID_TABLE_ADDR)
                return -1;
- p = bt_ioremap(efi.smbios, sizeof(eps));
+       p = bt_ioremap(boot_info->smbios, sizeof(eps));
        if (!p)
                return -1;
        memcpy_fromio(&eps, p, sizeof(eps));
@@ -227,7 +232,7 @@ static int __init dmi_efi_iterate(void (*decode)(struct 
dmi_header *))
        if (memcmp(eps.anchor, "_SM_", 4))
                return -1;
- p = bt_ioremap(efi.smbios, eps.length);
+       p = bt_ioremap(boot_info->smbios, eps.length);
        if (!p)
                return -1;
        if (dmi_checksum(p, eps.length) &&
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index a38e016..8de39aa 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -29,6 +29,11 @@
  #include <asm/mpspec.h>
  #include <asm/io_apic.h>
  #include <asm/setup.h>
+#ifndef CONFIG_ARM /* TODO - boot_info is not implemented on ARM yet */
+#include <asm/boot_info.h>
+#else
+#define boot_info      (&efi)
+#endif

And here

~Andrew

#include <mach_apic.h>
  #include <mach_mpparse.h>
@@ -676,18 +681,18 @@ static void __init efi_check_config(void)
  {
        struct intel_mp_floating *mpf;
- if (efi.mps == EFI_INVALID_TABLE_ADDR)
+       if (boot_info->mps == EFI_INVALID_TABLE_ADDR)
                return;
- __set_fixmap(FIX_EFI_MPF, PFN_DOWN(efi.mps), __PAGE_HYPERVISOR);
-       mpf = (void *)fix_to_virt(FIX_EFI_MPF) + ((long)efi.mps & 
(PAGE_SIZE-1));
+       __set_fixmap(FIX_EFI_MPF, PFN_DOWN(boot_info->mps), __PAGE_HYPERVISOR);
+       mpf = (void *)fix_to_virt(FIX_EFI_MPF) + ((long)boot_info->mps & 
(PAGE_SIZE-1));
if (memcmp(mpf->mpf_signature, "_MP_", 4) == 0 &&
            mpf->mpf_length == 1 &&
            mpf_checksum((void *)mpf, 16) &&
            (mpf->mpf_specification == 1 || mpf->mpf_specification == 4)) {
                smp_found_config = 1;
-               printk(KERN_INFO "SMP MP-table at %08lx\n", efi.mps);
+               printk(KERN_INFO "SMP MP-table at %08lx\n", boot_info->mps);
                mpf_found = mpf;
        }
        else
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 3a74e98..abaebd4 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -40,13 +40,6 @@ UINT64 __read_mostly efi_boot_max_var_store_size;
  UINT64 __read_mostly efi_boot_remain_var_store_size;
  UINT64 __read_mostly efi_boot_max_var_size;
-struct efi __read_mostly efi = {
-       .acpi   = EFI_INVALID_TABLE_ADDR,
-       .acpi20 = EFI_INVALID_TABLE_ADDR,
-       .mps    = EFI_INVALID_TABLE_ADDR,
-       .smbios = EFI_INVALID_TABLE_ADDR,
-};
-
  const struct efi_pci_rom *__read_mostly efi_pci_roms;
#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
@@ -64,6 +57,10 @@ boot_info_t __read_mostly boot_info_efi = {
      .efi_mmap_size = 0,
      .efi_mmap_desc_size = 0,
      .efi_mmap = NULL,
+    .mps = EFI_INVALID_TABLE_ADDR,
+    .acpi = EFI_INVALID_TABLE_ADDR,
+    .acpi20 = EFI_INVALID_TABLE_ADDR,
+    .smbios = EFI_INVALID_TABLE_ADDR,
      .mods_nr = 0,
      .mods = boot_info_mods,
      .warn_msg = NULL,
@@ -73,6 +70,13 @@ boot_info_t __read_mostly boot_info_efi = {
  UINTN __read_mostly efi_memmap_size;
  UINTN __read_mostly efi_mdesc_size;
  void *__read_mostly efi_memmap;
+
+struct efi __read_mostly efi = {
+       .acpi   = EFI_INVALID_TABLE_ADDR,
+       .acpi20 = EFI_INVALID_TABLE_ADDR,
+       .mps    = EFI_INVALID_TABLE_ADDR,
+       .smbios = EFI_INVALID_TABLE_ADDR,
+};
  #endif
#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
index 93c983c..ab48aad 100644
--- a/xen/drivers/acpi/osl.c
+++ b/xen/drivers/acpi/osl.c
@@ -39,6 +39,11 @@
  #include <xen/domain_page.h>
  #include <xen/efi.h>
  #include <xen/vmap.h>
+#ifndef CONFIG_ARM /* TODO - boot_info is not implemented on ARM yet */
+#include <asm/boot_info.h>
+#else
+#define boot_info      (&efi)
+#endif
#define _COMPONENT ACPI_OS_SERVICES
  ACPI_MODULE_NAME("osl")
@@ -67,10 +72,10 @@ void __init acpi_os_vprintf(const char *fmt, va_list args)
  acpi_physical_address __init acpi_os_get_root_pointer(void)
  {
        if (efi_enabled) {
-               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
-                       return efi.acpi20;
-               else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
-                       return efi.acpi;
+               if (boot_info->acpi20 != EFI_INVALID_TABLE_ADDR)
+                       return boot_info->acpi20;
+               else if (boot_info->acpi != EFI_INVALID_TABLE_ADDR)
+                       return boot_info->acpi;
                else {
                        printk(KERN_ERR PREFIX
                               "System description tables not found\n");
diff --git a/xen/include/asm-x86/boot_info.h b/xen/include/asm-x86/boot_info.h
index 99ff93e..4d888ab 100644
--- a/xen/include/asm-x86/boot_info.h
+++ b/xen/include/asm-x86/boot_info.h
@@ -68,6 +68,18 @@ typedef struct {
      /* Pointer to EFI memory map provided by preloader. */
      void *efi_mmap;
+ /* MPS physical address. */
+    paddr_t mps;
+
+    /* ACPI RSDP physical address. */
+    paddr_t acpi;
+
+    /* ACPI 2.0 RSDP physical address. */
+    paddr_t acpi20;
+
+    /* SMBIOS physical address. */
+    paddr_t smbios;
+
      /* Number of modules. */
      unsigned int mods_nr;
diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h
index 8a2b788..75b14db 100644
--- a/xen/include/xen/efi.h
+++ b/xen/include/xen/efi.h
@@ -3,12 +3,18 @@
#ifndef __ASSEMBLY__
  #include <xen/types.h>
+#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
+#include <asm/boot_info.h>
+#endif
  #endif
extern const bool_t efi_enabled; #define EFI_INVALID_TABLE_ADDR (~0UL) +#ifndef CONFIG_ARM /* TODO - boot_info is not implemented on ARM yet */
+#define efi    boot_info_efi
+#else
  /* Add fields here only if they need to be referenced from non-EFI code. */
  struct efi {
      unsigned long mps;          /* MPS table */
@@ -18,6 +24,7 @@ struct efi {
  };
extern struct efi efi;
+#endif
#ifndef __ASSEMBLY__


_______________________________________________
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®.