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] tools: hvmloader: pass SMBIOS location as

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: hvmloader: pass SMBIOS location as a runtime parameter.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Wed, 13 Apr 2011 01:05:13 +0100
Delivery-date: Tue, 12 Apr 2011 17:06:20 -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 Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302611881 -3600
# Node ID b5180edfccda1df7d721ad4e5cae40034a01ec98
# Parent  060f5397097bb83c35678190e569ca0d3689b82e
tools: hvmloader: pass SMBIOS location as a runtime parameter.

Instead of hardcoding in a header.

Reduces the cross talk between ROMBIOS and hvmloader.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 060f5397097b -r b5180edfccda tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Tue Apr 12 13:37:03 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Tue Apr 12 13:38:01 2011 +0100
@@ -599,7 +599,9 @@
     perform_tests();
 
     printf("Writing SMBIOS tables ...\n");
-    smbios_sz = hvm_write_smbios_tables();
+    smbios_sz = hvm_write_smbios_tables(SCRATCH_PHYSICAL_ADDRESS,
+                                        SMBIOS_PHYSICAL_ADDRESS,
+                                        SMBIOS_PHYSICAL_END);
 
     printf("Loading ROMBIOS ...\n");
     rombios_sz = sizeof(rombios);
diff -r 060f5397097b -r b5180edfccda tools/firmware/hvmloader/smbios.c
--- a/tools/firmware/hvmloader/smbios.c Tue Apr 12 13:37:03 2011 +0100
+++ b/tools/firmware/hvmloader/smbios.c Tue Apr 12 13:38:01 2011 +0100
@@ -28,7 +28,7 @@
 #include "hypercall.h"
 
 static int
-write_smbios_tables(void *start,
+write_smbios_tables(void *start, unsigned long phys,
                     uint32_t vcpus, uint64_t memsize,
                     uint8_t uuid[16], char *xen_version,
                     uint32_t xen_major_version, uint32_t xen_minor_version);
@@ -85,7 +85,7 @@
 }
 
 static int
-write_smbios_tables(void *start,
+write_smbios_tables(void *start, unsigned long phys,
                     uint32_t vcpus, uint64_t memsize,
                     uint8_t uuid[16], char *xen_version,
                     uint32_t xen_major_version, uint32_t xen_minor_version)
@@ -136,7 +136,7 @@
     smbios_entry_point_init(
         start, max_struct_size,
         (p - (char *)start) - sizeof(struct smbios_entry_point),
-        SMBIOS_PHYSICAL_ADDRESS + sizeof(struct smbios_entry_point),
+        phys + sizeof(struct smbios_entry_point),
         nr_structs);
 
     return ((char *)p - (char *)start);
@@ -162,7 +162,7 @@
 }
 
 int
-hvm_write_smbios_tables(void)
+hvm_write_smbios_tables(unsigned long scratch, unsigned long smbios_start, 
unsigned long smbios_end)
 {
     xen_domain_handle_t uuid;
     uint16_t xen_major_version, xen_minor_version;
@@ -222,15 +222,14 @@
     xen_version_str[sizeof(xen_version_str)-1] = '\0';
 
     /* SCRATCH_PHYSICAL_ADDRESS is a safe large memory area for scratch. */
-    len = write_smbios_tables((void *)SCRATCH_PHYSICAL_ADDRESS,
+    len = write_smbios_tables((void *)scratch, smbios_start,
                               hvm_info->nr_vcpus, get_memsize(),
                               uuid, xen_version_str,
                               xen_major_version, xen_minor_version);
-    if ( len > SMBIOS_MAXIMUM_SIZE )
+    if ( smbios_start + len > smbios_end )
         goto error_out;
     /* Okay, not too large: copy out of scratch to final location. */
-    memcpy((void *)SMBIOS_PHYSICAL_ADDRESS,
-           (void *)SCRATCH_PHYSICAL_ADDRESS, len);
+    memcpy((void *)smbios_start, (void *)scratch, len);
 
     return len;
 
diff -r 060f5397097b -r b5180edfccda tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h   Tue Apr 12 13:37:03 2011 +0100
+++ b/tools/firmware/hvmloader/util.h   Tue Apr 12 13:38:01 2011 +0100
@@ -186,7 +186,9 @@
 /* Miscellaneous. */
 void cacheattr_init(void);
 void create_mp_tables(void);
-int hvm_write_smbios_tables(void);
+int hvm_write_smbios_tables(unsigned long scratch,
+                           unsigned long smbios_start,
+                           unsigned long smbios_end);
 void smp_initialise(void);
 
 #include "e820.h"
diff -r 060f5397097b -r b5180edfccda tools/firmware/rombios/config.h
--- a/tools/firmware/rombios/config.h   Tue Apr 12 13:37:03 2011 +0100
+++ b/tools/firmware/rombios/config.h   Tue Apr 12 13:38:01 2011 +0100
@@ -11,7 +11,8 @@
 #define ACPI_PHYSICAL_ADDRESS         0x000EA020
 #define E820_PHYSICAL_ADDRESS         0x000EA100
 #define SMBIOS_PHYSICAL_ADDRESS       0x000EB000
-#define SMBIOS_MAXIMUM_SIZE           0x00005000
+#define SMBIOS_PHYSICAL_END           0x000F0000
+
 #define ROMBIOS_PHYSICAL_ADDRESS      0x000F0000
 
 /* Offsets from E820_PHYSICAL_ADDRESS. */

_______________________________________________
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] tools: hvmloader: pass SMBIOS location as a runtime parameter., Xen patchbot-unstable <=