WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86-64: EFI MPS support

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86-64: EFI MPS support
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 08 Jul 2011 06:22:13 +0100
Delivery-date: Thu, 07 Jul 2011 22:24:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1309249288 -3600
# Node ID dffcd8b4c197b58d2acb914d0e07a100e340f7ae
# Parent  d19e778442673050bba8ea8cf61585902ff81162
x86-64: EFI MPS support

It's not clear this is needed - Linux doesn't use the MPS table even
if available, and no system having one was seen so far.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r d19e77844267 -r dffcd8b4c197 xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c   Tue Jun 28 09:20:49 2011 +0100
+++ b/xen/arch/x86/efi/boot.c   Tue Jun 28 09:21:28 2011 +0100
@@ -897,12 +897,15 @@
     {
         static EFI_GUID __initdata acpi2_guid = ACPI_20_TABLE_GUID;
         static EFI_GUID __initdata acpi_guid = ACPI_TABLE_GUID;
+        static EFI_GUID __initdata mps_guid = MPS_TABLE_GUID;
         static EFI_GUID __initdata smbios_guid = SMBIOS_TABLE_GUID;
 
         if ( match_guid(&acpi2_guid, &efi_ct[i].VendorGuid) )
               efi.acpi20 = (long)efi_ct[i].VendorTable;
         if ( match_guid(&acpi_guid, &efi_ct[i].VendorGuid) )
               efi.acpi = (long)efi_ct[i].VendorTable;
+        if ( match_guid(&mps_guid, &efi_ct[i].VendorGuid) )
+              efi.mps = (long)efi_ct[i].VendorTable;
         if ( match_guid(&smbios_guid, &efi_ct[i].VendorGuid) )
               efi.smbios = (long)efi_ct[i].VendorTable;
     }
diff -r d19e77844267 -r dffcd8b4c197 xen/arch/x86/efi/runtime.c
--- a/xen/arch/x86/efi/runtime.c        Tue Jun 28 09:20:49 2011 +0100
+++ b/xen/arch/x86/efi/runtime.c        Tue Jun 28 09:21:28 2011 +0100
@@ -29,6 +29,7 @@
 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,
 };
 
diff -r d19e77844267 -r dffcd8b4c197 xen/arch/x86/mpparse.c
--- a/xen/arch/x86/mpparse.c    Tue Jun 28 09:20:49 2011 +0100
+++ b/xen/arch/x86/mpparse.c    Tue Jun 28 09:21:28 2011 +0100
@@ -19,6 +19,7 @@
 #include <xen/init.h>
 #include <xen/acpi.h>
 #include <xen/delay.h>
+#include <xen/efi.h>
 #include <xen/sched.h>
 
 #include <asm/bitops.h>
@@ -514,6 +515,14 @@
        }
 }
 
+#define FIX_EFI_MPF FIX_KEXEC_BASE_0
+
+static __init void efi_unmap_mpf(void)
+{
+       if (efi_enabled)
+               __set_fixmap(FIX_EFI_MPF, 0, 0);
+}
+
 static struct intel_mp_floating *__initdata mpf_found;
 
 /*
@@ -528,6 +537,7 @@
         * processors, where MPS only supports physical.
         */
        if (acpi_lapic && acpi_ioapic) {
+               efi_unmap_mpf();
                printk(KERN_INFO "Using ACPI (MADT) for SMP configuration 
information\n");
                return;
        }
@@ -558,6 +568,7 @@
                 * override the defaults.
                 */
                if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) {
+                       efi_unmap_mpf();
                        smp_found_config = 0;
                        printk(KERN_ERR "BIOS bug, MP table errors 
detected!...\n");
                        printk(KERN_ERR "... disabling SMP support. (tell your 
hw vendor)\n");
@@ -584,6 +595,8 @@
        } else
                BUG();
 
+       efi_unmap_mpf();
+
        printk(KERN_INFO "Processors: %d\n", num_processors);
        /*
         * Only use the first configuration found.
@@ -638,10 +651,37 @@
        return 0;
 }
 
+static void __init efi_check_config(void)
+{
+       struct intel_mp_floating *mpf;
+
+       if (efi.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));
+
+       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 %08"PRIx64"\n", efi.mps);
+               mpf_found = mpf;
+       }
+       else
+               efi_unmap_mpf();
+}
+
 void __init find_smp_config (void)
 {
        unsigned int address;
 
+       if (efi_enabled) {
+               efi_check_config();
+               return;
+       }
+
        /*
         * FIXME: Linux assumes you have 640K of base ram..
         * this continues the error...
diff -r d19e77844267 -r dffcd8b4c197 xen/include/xen/efi.h
--- a/xen/include/xen/efi.h     Tue Jun 28 09:20:49 2011 +0100
+++ b/xen/include/xen/efi.h     Tue Jun 28 09:21:28 2011 +0100
@@ -17,6 +17,7 @@
 
 /* Add fields here only if they need to be referenced from non-EFI code. */
 struct efi {
+    unsigned long mps;          /* MPS table */
     unsigned long acpi;         /* ACPI table (IA64 ext 0.71) */
     unsigned long acpi20;       /* ACPI table (ACPI 2.0) */
     unsigned long smbios;       /* SM BIOS table */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86-64: EFI MPS support, Xen patchbot-unstable <=