rpms/bochs/devel bochs-0001_bx-qemu.patch, NONE, 1.1 bochs-0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch, NONE, 1.1 bochs-0003_kvm-bios-generate-mptable-unconditionally.patch, NONE, 1.1 bochs-0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch, NONE, 1.1 bochs-0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch, NONE, 1.1 bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch, NONE, 1.1 bochs-0007_bios-add-26-pci-slots, -bringing-the-total-to-32.patch, NONE, 1.1 bochs-0008_qemu-bios-provide-gpe-_l0x-methods.patch, NONE, 1.1 bochs-0009_qemu-bios-pci-hotplug-support.patch, NONE, 1.1 bochs-0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch, NONE, 1.1 bochs-0011_read-additional-acpi-tables-from-a-vm.patch, NONE, 1.1 bochs.spec, 1.38, 1.39 bochs-2.3.6-gcc43.patch, 1.1, NONE bochs-2.3.7-3dnow-compile-fix.patch, 1.1, NONE bochs-2.3.7-big-endian.patch, 1.1, NONE bochs-wx28.patch, 1.1, NONE

Glauber Costa glommer at fedoraproject.org
Thu Mar 5 17:42:27 UTC 2009


Author: glommer

Update of /cvs/pkgs/rpms/bochs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16988

Modified Files:
	bochs.spec 
Added Files:
	bochs-0001_bx-qemu.patch 
	bochs-0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch 
	bochs-0003_kvm-bios-generate-mptable-unconditionally.patch 
	bochs-0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch 
	bochs-0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch 
	bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch 
	bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch 
	bochs-0008_qemu-bios-provide-gpe-_l0x-methods.patch 
	bochs-0009_qemu-bios-pci-hotplug-support.patch 
	bochs-0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch 
	bochs-0011_read-additional-acpi-tables-from-a-vm.patch 
Removed Files:
	bochs-2.3.6-gcc43.patch bochs-2.3.7-3dnow-compile-fix.patch 
	bochs-2.3.7-big-endian.patch bochs-wx28.patch 
Log Message:
added patches



bochs-0001_bx-qemu.patch:

--- NEW FILE bochs-0001_bx-qemu.patch ---
--- bochs-2.3.7.orig/bios/rombios.h
+++ bochs-2.3.7/bios/rombios.h
@@ -19,7 +19,7 @@
 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 /* define it to include QEMU specific code */
-//#define BX_QEMU
+#define BX_QEMU
 
 #ifndef LEGACY
 #  define BX_ROMBIOS32     1

bochs-0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch:

--- NEW FILE bochs-0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch ---
update SMBIOS table to report memory above 4G (Alex Williamson)

Signed-off-by: Alex Williamson <alex.williamson at hp.com>
Signed-off-by: Avi Kivity <avi at redhat.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/rombios32.c
===================================================================
diff --git a/bios/rombios32.c b/bios/rombios32.c
index 3269be5..9587288 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -429,6 +429,7 @@ uint32_t cpuid_signature;
 uint32_t cpuid_features;
 uint32_t cpuid_ext_features;
 unsigned long ram_size;
+uint64_t ram_end;
 uint8_t bios_uuid[16];
 #ifdef BX_USE_EBDA_TABLES
 unsigned long ebda_cur_addr;
@@ -571,6 +572,13 @@ void ram_probe(void)
     ram_size = (cmos_readb(0x30) | (cmos_readb(0x31) << 8)) * 1024 +
         1 * 1024 * 1024;
   BX_INFO("ram_size=0x%08lx\n", ram_size);
+  if (cmos_readb(0x5b) | cmos_readb(0x5c) | cmos_readb(0x5d))
+    ram_end = (((uint64_t)cmos_readb(0x5b) << 16) |
+               ((uint64_t)cmos_readb(0x5c) << 24) |
+               ((uint64_t)cmos_readb(0x5d) << 32)) + (1ull << 32);
+  else
+    ram_end = ram_size;
+  BX_INFO("end of ram=%ldMB\n", ram_end >> 20);
 #ifdef BX_USE_EBDA_TABLES
   ebda_cur_addr = ((*(uint16_t *)(0x40e)) << 4) + 0x380;
   BX_INFO("ebda_cur_addr: 0x%08lx\n", ebda_cur_addr);
@@ -2174,7 +2182,8 @@ void smbios_init(void)
 {
     unsigned cpu_num, nr_structs = 0, max_struct_size = 0;
     char *start, *p, *q;
-    int memsize = ram_size / (1024 * 1024);
+    int memsize = (ram_end == ram_size) ? ram_size / (1024 * 1024) :
+                  (ram_end - (1ull << 32) + ram_size) / (1024 * 1024);
 
 #ifdef BX_USE_EBDA_TABLES
     ebda_cur_addr = align(ebda_cur_addr, 16);
@@ -2201,8 +2210,8 @@ void smbios_init(void)
         add_struct(smbios_type_4_init(p, cpu_num));
     add_struct(smbios_type_16_init(p, memsize));
     add_struct(smbios_type_17_init(p, memsize));
-    add_struct(smbios_type_19_init(p, memsize));
-    add_struct(smbios_type_20_init(p, memsize));
+    add_struct(smbios_type_19_init(p, ram_end / (1024 * 1024)));
+    add_struct(smbios_type_20_init(p, ram_end / (1024 * 1024)));
     add_struct(smbios_type_32_init(p));
     add_struct(smbios_type_127_init(p));
 

bochs-0003_kvm-bios-generate-mptable-unconditionally.patch:

--- NEW FILE bochs-0003_kvm-bios-generate-mptable-unconditionally.patch ---
generate mptable unconditionally (Avi Kivity)

VMware ESX requires an mptable even for uniprocessor guests.

Signed-off-by: Avi Kivity <avi at qumranet.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/rombios32.c
===================================================================
--- bochs.orig/bios/rombios32.c
+++ bochs/bios/rombios32.c
@@ -970,11 +970,6 @@ static void mptable_init(void)
     int ioapic_id, i, len;
     int mp_config_table_size;

-#ifdef BX_QEMU
-    if (smp_cpus <= 1)
-        return;
-#endif
-
 #ifdef BX_USE_EBDA_TABLES
     mp_config_table = (uint8_t *)(ram_size - ACPI_DATA_SIZE - MPTABLE_MAX_SIZE);
 #else



bochs-0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch:

--- NEW FILE bochs-0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch ---
resolve memory device roll over reporting  issues with >32G guests (Bill Rieske)

The field within the Memory Device type 17 is only a word with the MSB being
used to report MB/KB.  Thereby, a guest with 32G and greater would report
incorrect memory device information rolling over to 0.

This presents more than one memory device and associated memory structures
if the memory is larger than 16G

Signed-off-by: Bill Rieske <brieske at novell.com>
Signed-off-by: Avi Kivity <avi at redhat.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/rombios32.c
===================================================================
--- bochs.orig/bios/rombios32.c
+++ bochs/bios/rombios32.c
@@ -381,6 +381,17 @@ int vsnprintf(char *buf, int buflen, con
     return buf - buf0;
 }

+int snprintf(char * buf, size_t size, const char *fmt, ...)
+{
+	va_list args;
+	int i;
+
+	va_start(args, fmt);
+	i=vsnprintf(buf,size,fmt,args);
+	va_end(args);
+	return i;
+}
+
 void bios_printf(int flags, const char *fmt, ...)
 {
     va_list ap;
@@ -2039,7 +2050,7 @@ smbios_type_4_init(void *start, unsigned

 /* Type 16 -- Physical Memory Array */
 static void *
-smbios_type_16_init(void *start, uint32_t memsize)
+smbios_type_16_init(void *start, uint32_t memsize, int nr_mem_devs)
 {
     struct smbios_type_16 *p = (struct smbios_type_16*)start;

@@ -2052,7 +2063,7 @@ smbios_type_16_init(void *start, uint32_
     p->error_correction = 0x01; /* other */
     p->maximum_capacity = memsize * 1024;
     p->memory_error_information_handle = 0xfffe; /* none provided */
-    p->number_of_memory_devices = 1;
+    p->number_of_memory_devices = nr_mem_devs;

     start += sizeof(struct smbios_type_16);
     *((uint16_t *)start) = 0;
@@ -2062,20 +2073,19 @@ smbios_type_16_init(void *start, uint32_

 /* Type 17 -- Memory Device */
 static void *
-smbios_type_17_init(void *start, uint32_t memory_size_mb)
+smbios_type_17_init(void *start, uint32_t memory_size_mb, int instance)
 {
     struct smbios_type_17 *p = (struct smbios_type_17 *)start;

     p->header.type = 17;
     p->header.length = sizeof(struct smbios_type_17);
-    p->header.handle = 0x1100;
+    p->header.handle = 0x1100 + instance;

     p->physical_memory_array_handle = 0x1000;
     p->total_width = 64;
     p->data_width = 64;
-    /* truncate memory_size_mb to 16 bits and clear most significant
-       bit [indicates size in MB] */
-    p->size = (uint16_t) memory_size_mb & 0x7fff;
+/* TODO: should assert in case something is wrong   ASSERT((memory_size_mb & ~0x7fff) == 0); */
+    p->size = memory_size_mb;
     p->form_factor = 0x09; /* DIMM */
     p->device_set = 0;
     p->device_locator_str = 1;
@@ -2084,8 +2094,8 @@ smbios_type_17_init(void *start, uint32_
     p->type_detail = 0;

     start += sizeof(struct smbios_type_17);
-    memcpy((char *)start, "DIMM 1", 7);
-    start += 7;
+    snprintf(start, 8, "DIMM %d", instance);
+    start += strlen(start) + 1;
     *((uint8_t *)start) = 0;

     return start+1;
@@ -2093,16 +2103,16 @@ smbios_type_17_init(void *start, uint32_

 /* Type 19 -- Memory Array Mapped Address */
 static void *
-smbios_type_19_init(void *start, uint32_t memory_size_mb)
+smbios_type_19_init(void *start, uint32_t memory_size_mb, int instance)
 {
     struct smbios_type_19 *p = (struct smbios_type_19 *)start;

     p->header.type = 19;
     p->header.length = sizeof(struct smbios_type_19);
-    p->header.handle = 0x1300;
+    p->header.handle = 0x1300 + instance;

-    p->starting_address = 0;
-    p->ending_address = (memory_size_mb * 1024) - 1;
+    p->starting_address = instance << 24;
+    p->ending_address = p->starting_address + (memory_size_mb << 10) - 1;
     p->memory_array_handle = 0x1000;
     p->partition_width = 1;

@@ -2114,18 +2124,18 @@ smbios_type_19_init(void *start, uint32_

 /* Type 20 -- Memory Device Mapped Address */
 static void *
-smbios_type_20_init(void *start, uint32_t memory_size_mb)
+smbios_type_20_init(void *start, uint32_t memory_size_mb, int instance)
 {
     struct smbios_type_20 *p = (struct smbios_type_20 *)start;

     p->header.type = 20;
     p->header.length = sizeof(struct smbios_type_20);
-    p->header.handle = 0x1400;
+    p->header.handle = 0x1400 + instance;

-    p->starting_address = 0;
-    p->ending_address = (memory_size_mb * 1024) - 1;
-    p->memory_device_handle = 0x1100;
-    p->memory_array_mapped_address_handle = 0x1300;
+    p->starting_address = instance << 24;
+    p->ending_address = p->starting_address + (memory_size_mb << 10) - 1;
+    p->memory_device_handle = 0x1100 + instance;
+    p->memory_array_mapped_address_handle = 0x1300 + instance;
     p->partition_row_position = 1;
     p->interleave_position = 0;
     p->interleaved_data_depth = 0;
@@ -2176,6 +2186,7 @@ void smbios_init(void)
     char *start, *p, *q;
     int memsize = (ram_end == ram_size) ? ram_size / (1024 * 1024) :
                   (ram_end - (1ull << 32) + ram_size) / (1024 * 1024);
+    int i, nr_mem_devs;

 #ifdef BX_USE_EBDA_TABLES
     ebda_cur_addr = align(ebda_cur_addr, 16);
@@ -2187,23 +2198,32 @@ void smbios_init(void)

 	p = (char *)start + sizeof(struct smbios_entry_point);

-#define add_struct(fn) { \
+#define add_struct(fn) do{ \
     q = (fn); \
     nr_structs++; \
     if ((q - p) > max_struct_size) \
         max_struct_size = q - p; \
     p = q; \
-}
+}while (0)

     add_struct(smbios_type_0_init(p));
     add_struct(smbios_type_1_init(p));
     add_struct(smbios_type_3_init(p));
     for (cpu_num = 1; cpu_num <= smp_cpus; cpu_num++)
         add_struct(smbios_type_4_init(p, cpu_num));
-    add_struct(smbios_type_16_init(p, memsize));
-    add_struct(smbios_type_17_init(p, memsize));
-    add_struct(smbios_type_19_init(p, ram_end / (1024 * 1024)));
-    add_struct(smbios_type_20_init(p, ram_end / (1024 * 1024)));
+
+    /* Each 'memory device' covers up to 16GB of address space. */
+    nr_mem_devs = (memsize + 0x3fff) >> 14;
+    add_struct(smbios_type_16_init(p, memsize, nr_mem_devs));
+    for ( i = 0; i < nr_mem_devs; i++ )
+    {
+        uint32_t dev_memsize = ((i == (nr_mem_devs - 1))
+                                ? (memsize & 0x3fff) : 0x4000);
+        add_struct(smbios_type_17_init(p, dev_memsize, i));
+        add_struct(smbios_type_19_init(p, dev_memsize, i));
+        add_struct(smbios_type_20_init(p, dev_memsize, i));
+    }
+
     add_struct(smbios_type_32_init(p));
     add_struct(smbios_type_127_init(p));




bochs-0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch:

--- NEW FILE bochs-0005_kvm-bios-fix-smbios-memory-device-length-boundary--condition.patch ---
fix smbios memory device length boundary  condition (Bill Rieske)

dev_memsize ends up 0 when it shouldn't be on 16G boundary conditions.
    
Signed-off-by: Bill Rieske <brieske at novell.com>
Signed-off-by: Avi Kivity <avi at redhat.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/rombios32.c
===================================================================
--- bochs.orig/bios/rombios32.c
+++ bochs/bios/rombios32.c
@@ -2218,7 +2218,7 @@ void smbios_init(void)
     for ( i = 0; i < nr_mem_devs; i++ )
     {
         uint32_t dev_memsize = ((i == (nr_mem_devs - 1))
-                                ? (memsize & 0x3fff) : 0x4000);
+                                ? (((memsize-1) & 0x3fff)+1) : 0x4000);
         add_struct(smbios_type_17_init(p, dev_memsize, i));
         add_struct(smbios_type_19_init(p, dev_memsize, i));
         add_struct(smbios_type_20_init(p, dev_memsize, i));



bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch:

--- NEW FILE bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch ---
qemu: bios: use preprocessor for pci link routing (Avi Kivity)

Signed-off-by: Avi Kivity <avi at qumranet.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/acpi-dsdt.dsl
===================================================================
--- bochs.orig/bios/acpi-dsdt.dsl
+++ bochs/bios/acpi-dsdt.dsl
@@ -47,42 +47,22 @@ DefinitionBlock (
                    section 6.2.8.1 */
                 /* Note: we provide the same info as the PCI routing
                    table of the Bochs BIOS */
-
-                // PCI Slot 0
-                Package() {0x0000ffff, 0, LNKD, 0},
-                Package() {0x0000ffff, 1, LNKA, 0},
-                Package() {0x0000ffff, 2, LNKB, 0},
-                Package() {0x0000ffff, 3, LNKC, 0},
-
-                // PCI Slot 1
-                Package() {0x0001ffff, 0, LNKA, 0},
-                Package() {0x0001ffff, 1, LNKB, 0},
-                Package() {0x0001ffff, 2, LNKC, 0},
-                Package() {0x0001ffff, 3, LNKD, 0},
-
-                // PCI Slot 2
-                Package() {0x0002ffff, 0, LNKB, 0},
-                Package() {0x0002ffff, 1, LNKC, 0},
-                Package() {0x0002ffff, 2, LNKD, 0},
-                Package() {0x0002ffff, 3, LNKA, 0},
-
-                // PCI Slot 3
-                Package() {0x0003ffff, 0, LNKC, 0},
-                Package() {0x0003ffff, 1, LNKD, 0},
-                Package() {0x0003ffff, 2, LNKA, 0},
-                Package() {0x0003ffff, 3, LNKB, 0},
-
-                // PCI Slot 4
-                Package() {0x0004ffff, 0, LNKD, 0},
-                Package() {0x0004ffff, 1, LNKA, 0},
-                Package() {0x0004ffff, 2, LNKB, 0},
-                Package() {0x0004ffff, 3, LNKC, 0},
-
-                // PCI Slot 5
-                Package() {0x0005ffff, 0, LNKA, 0},
-                Package() {0x0005ffff, 1, LNKB, 0},
-                Package() {0x0005ffff, 2, LNKC, 0},
-                Package() {0x0005ffff, 3, LNKD, 0},
+#define prt_slot(nr, lnk0, lnk1, lnk2, lnk3) \
+       Package() { nr##ffff, 0, lnk0, 0 }, \
+       Package() { nr##ffff, 1, lnk1, 0 }, \
+       Package() { nr##ffff, 2, lnk2, 0 }, \
+       Package() { nr##ffff, 3, lnk3, 0 }
+
+#define prt_slot0(nr) prt_slot(nr, LNKD, LNKA, LNKB, LNKC)
+#define prt_slot1(nr) prt_slot(nr, LNKA, LNKB, LNKC, LNKD)
+#define prt_slot2(nr) prt_slot(nr, LNKB, LNKC, LNKD, LNKA)
+#define prt_slot3(nr) prt_slot(nr, LNKC, LNKD, LNKA, LNKB)
+               prt_slot0(0x0000),
+               prt_slot1(0x0001),
+               prt_slot2(0x0002),
+               prt_slot3(0x0003),
+               prt_slot0(0x0004),
+               prt_slot1(0x0005),
             })
 
             Name (_CRS, ResourceTemplate ()

-- 




***** Not enough context to create diffstat for file: bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch,NONE,1.1
***** Not enough context to create diff for file: bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch,NONE,1.1
bochs-0008_qemu-bios-provide-gpe-_l0x-methods.patch:

--- NEW FILE bochs-0008_qemu-bios-provide-gpe-_l0x-methods.patch ---
qemu: bios: provide gpe _L0x methods (Glauber Costa)

provide methods for gpe blk 0, even though they do nothing atm
    
Signed-off-by: Glauber Costa <gcosta at redhat.com>
Signed-off-by: Avi Kivity <avi at qumranet.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/acpi-dsdt.dsl
===================================================================
--- bochs.orig/bios/acpi-dsdt.dsl
+++ bochs/bios/acpi-dsdt.dsl
@@ -597,4 +597,59 @@ DefinitionBlock (
         Zero,  /* reserved */
         Zero   /* reserved */
     })
+
+    Scope (\_GPE)
+    {
+        Name(_HID, "ACPI0006")
+
+        Method(_L00) {
+            Return(0x01)
+        }
+        Method(_L01) {
+            Return(0x01)
+        }
+        Method(_L02) {
+            Return(0x01)
+        }
+        Method(_L03) {
+            Return(0x01)
+        }
+        Method(_L04) {
+            Return(0x01)
+        }
+        Method(_L05) {
+            Return(0x01)
+        }
+        Method(_L06) {
+            Return(0x01)
+        }
+        Method(_L07) {
+            Return(0x01)
+        }
+        Method(_L08) {
+            Return(0x01)
+        }
+        Method(_L09) {
+            Return(0x01)
+        }
+        Method(_L0A) {
+            Return(0x01)
+        }
+        Method(_L0B) {
+            Return(0x01)
+        }
+        Method(_L0C) {
+            Return(0x01)
+        }
+        Method(_L0D) {
+            Return(0x01)
+        }
+        Method(_L0E) {
+            Return(0x01)
+        }
+        Method(_L0F) {
+            Return(0x01)
+        }
+    }
+
 }
Index: bochs/bios/rombios32.c
===================================================================
--- bochs.orig/bios/rombios32.c
+++ bochs/bios/rombios32.c
@@ -1647,6 +1647,8 @@ void acpi_bios_init(void)
     fadt->pm_tmr_len = 4;
     fadt->plvl2_lat = cpu_to_le16(0xfff); // C2 state not supported
     fadt->plvl3_lat = cpu_to_le16(0xfff); // C3 state not supported
+    fadt->gpe0_blk = cpu_to_le32(0xafe0);
+    fadt->gpe0_blk_len = 4;
     /* WBINVD + PROC_C1 + PWR_BUTTON + SLP_BUTTON + FIX_RTC */
     fadt->flags = cpu_to_le32((1 << 0) | (1 << 2) | (1 << 4) | (1 << 5) | (1 << 6));
     acpi_build_table_header((struct acpi_table_header *)fadt, "FACP",

-- 






bochs-0009_qemu-bios-pci-hotplug-support.patch:

--- NEW FILE bochs-0009_qemu-bios-pci-hotplug-support.patch ---
qemu: bios: pci hotplug support (Marcelo Tosatti)

Signed-off-by: Marcelo Tosatti <mtosatti at redhat.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/acpi-dsdt.dsl
===================================================================
--- bochs.orig/bios/acpi-dsdt.dsl
+++ bochs/bios/acpi-dsdt.dsl
@@ -91,6 +91,61 @@ DefinitionBlock (
                prt_slot3(0x001f),
             })
 
+            OperationRegion(PCST, SystemIO, 0xae00, 0x08)
+            Field (PCST, DWordAcc, NoLock, WriteAsZeros)
+            {
+                PCIU, 32,
+                PCID, 32,
+            }
+
+            OperationRegion(SEJ, SystemIO, 0xae08, 0x04)
+            Field (SEJ, DWordAcc, NoLock, WriteAsZeros)
+            {
+                B0EJ, 32,
+            }
+
+#define hotplug_slot(name, nr) \
+            Device (S##name) {                    \
+               Name (_ADR, nr##0000)              \
+               Method (_EJ0,1) {                  \
+                    Store(ShiftLeft(1, nr), B0EJ) \
+                    Return (0x0)                  \
+               }                                  \
+               Name (_SUN, name)                  \
+            }
+
+	    hotplug_slot(1, 0x0001)
+	    hotplug_slot(2, 0x0002)
+	    hotplug_slot(3, 0x0003)
+	    hotplug_slot(4, 0x0004)
+	    hotplug_slot(5, 0x0005)
+	    hotplug_slot(6, 0x0006)
+	    hotplug_slot(7, 0x0007)
+	    hotplug_slot(8, 0x0008)
+	    hotplug_slot(9, 0x0009)
+	    hotplug_slot(10, 0x000a)
+	    hotplug_slot(11, 0x000b)
+	    hotplug_slot(12, 0x000c)
+	    hotplug_slot(13, 0x000d)
+	    hotplug_slot(14, 0x000e)
+	    hotplug_slot(15, 0x000f)
+	    hotplug_slot(16, 0x0010)
+	    hotplug_slot(17, 0x0011)
+	    hotplug_slot(18, 0x0012)
+	    hotplug_slot(19, 0x0013)
+	    hotplug_slot(20, 0x0014)
+	    hotplug_slot(21, 0x0015)
+	    hotplug_slot(22, 0x0016)
+	    hotplug_slot(23, 0x0017)
+	    hotplug_slot(24, 0x0018)
+	    hotplug_slot(25, 0x0019)
+	    hotplug_slot(26, 0x001a)
+	    hotplug_slot(27, 0x001b)
+	    hotplug_slot(28, 0x001c)
+	    hotplug_slot(29, 0x001d)
+	    hotplug_slot(30, 0x001e)
+	    hotplug_slot(31, 0x001f)
+
             Name (_CRS, ResourceTemplate ()
             {
                 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
@@ -605,8 +660,50 @@ DefinitionBlock (
         Method(_L00) {
             Return(0x01)
         }
+
+#define gen_pci_hotplug(nr)                                       \
+            If (And(\_SB.PCI0.PCIU, ShiftLeft(1, nr))) {          \
+                Notify(\_SB.PCI0.S##nr, 1)                        \
+            }                                                     \
+            If (And(\_SB.PCI0.PCID, ShiftLeft(1, nr))) {          \
+                Notify(\_SB.PCI0.S##nr, 3)                        \
+            }
+
         Method(_L01) {
-            Return(0x01)
+            gen_pci_hotplug(1)
+            gen_pci_hotplug(2)
+            gen_pci_hotplug(3)
+            gen_pci_hotplug(4)
+            gen_pci_hotplug(5)
+            gen_pci_hotplug(6)
+            gen_pci_hotplug(7)
+            gen_pci_hotplug(8)
+            gen_pci_hotplug(9)
+            gen_pci_hotplug(10)
+            gen_pci_hotplug(11)
+            gen_pci_hotplug(12)
+            gen_pci_hotplug(13)
+            gen_pci_hotplug(14)
+            gen_pci_hotplug(15)
+            gen_pci_hotplug(16)
+            gen_pci_hotplug(17)
+            gen_pci_hotplug(18)
+            gen_pci_hotplug(19)
+            gen_pci_hotplug(20)
+            gen_pci_hotplug(21)
+            gen_pci_hotplug(22)
+            gen_pci_hotplug(23)
+            gen_pci_hotplug(24)
+            gen_pci_hotplug(25)
+            gen_pci_hotplug(26)
+            gen_pci_hotplug(27)
+            gen_pci_hotplug(28)
+            gen_pci_hotplug(29)
+            gen_pci_hotplug(30)
+            gen_pci_hotplug(31)
+
+            Return (0x01)
+
         }
         Method(_L02) {
             Return(0x01)

-- 




bochs-0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch:

--- NEW FILE bochs-0010_bios-mark-the-acpi-sci-interrupt-as-connected-to-irq-9.patch ---
bios: mark the acpi sci interrupt as connected to irq 9 (Avi Kivity)

Due to a chipset bug, the sci interrupt is hardwired to irq 9.  Set the
pci interrupt line register accordingly.
    
Signed-off-by: Avi Kivity <avi at qumranet.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

Index: bochs/bios/rombios32.c
===================================================================
--- bochs.orig/bios/rombios32.c
+++ bochs/bios/rombios32.c
@@ -981,6 +981,8 @@ static void pci_bios_init_device(PCIDevi
         /* PIIX4 Power Management device (for ACPI) */
         pm_io_base = PM_IO_BASE;
         smb_io_base = SMB_IO_BASE;
+        // acpi sci is hardwired to 9
+        pci_config_writeb(d, PCI_INTERRUPT_LINE, 9);
         pm_sci_int = pci_config_readb(d, PCI_INTERRUPT_LINE);
         piix4_pm_enable(d);
         acpi_enabled = 1;

-- 




bochs-0011_read-additional-acpi-tables-from-a-vm.patch:

--- NEW FILE bochs-0011_read-additional-acpi-tables-from-a-vm.patch ---
Read additional ACPI tables from a VM (Gleb Natapov)

Signed-off-by: Gleb Natapov <gleb at redhat.com>
Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>

diff --git a/bios/rombios32.c b/bios/rombios32.c
index 3269be5..191707d 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -457,6 +457,8 @@ void wrmsr_smp(uint32_t index, uint64_t val)
 #define QEMU_CFG_SIGNATURE  0x00
 #define QEMU_CFG_ID         0x01
 #define QEMU_CFG_UUID       0x02
+#define QEMU_CFG_ARCH_LOCAL     0x8000
+#define QEMU_CFG_ACPI_TABLES  (QEMU_CFG_ARCH_LOCAL + 0)
 
 int qemu_cfg_port;
 
@@ -484,6 +486,27 @@ void qemu_cfg_read(uint8_t *buf, int len)
     while (len--)
         *(buf++) = inb(QEMU_CFG_DATA_PORT);
 }
+
+static uint16_t acpi_additional_tables(void)
+{
+    uint16_t cnt;
+
+    qemu_cfg_select(QEMU_CFG_ACPI_TABLES);
+    qemu_cfg_read((uint8_t*)&cnt, sizeof(cnt));
+
+    return cnt;
+}
+
+static int acpi_load_table(int i, uint32_t addr, uint16_t *len)
+{
+    qemu_cfg_read((uint8_t*)len, sizeof(*len));
+
+    if (!*len)
+        return -1;
+
+    qemu_cfg_read((uint8_t*)addr, *len);
+    return 0;
+}
 #endif
 
 void uuid_probe(void)
@@ -1534,8 +1557,8 @@ void acpi_bios_init(void)
     uint32_t hpet_addr;
 #endif
     uint32_t base_addr, rsdt_addr, fadt_addr, addr, facs_addr, dsdt_addr, ssdt_addr;
-    uint32_t acpi_tables_size, madt_addr, madt_size;
-    int i;
+    uint32_t acpi_tables_size, madt_addr, madt_size, rsdt_size;
+    uint16_t i, external_tables;
 
     /* reserve memory space for tables */
 #ifdef BX_USE_EBDA_TABLES
@@ -1548,10 +1571,17 @@ void acpi_bios_init(void)
     bios_table_cur_addr += sizeof(*rsdp);
 #endif
 
+#ifdef BX_QEMU
+    external_tables = acpi_additional_tables();
+#else
+    external_tables = 0;
+#endif
+
     addr = base_addr = ram_size - ACPI_DATA_SIZE;
     rsdt_addr = addr;
     rsdt = (void *)(addr);
-    addr += sizeof(*rsdt);
+    rsdt_size = sizeof(*rsdt) + external_tables * 4;
+    addr += rsdt_size;
 
     fadt_addr = addr;
     fadt = (void *)(addr);
@@ -1590,12 +1620,6 @@ void acpi_bios_init(void)
     addr += sizeof(*hpet);
 #endif
 
-    acpi_tables_size = addr - base_addr;
-
-    BX_INFO("ACPI tables: RSDP addr=0x%08lx ACPI DATA addr=0x%08lx size=0x%x\n",
-            (unsigned long)rsdp,
-            (unsigned long)rsdt, acpi_tables_size);
-
     /* RSDP */
     memset(rsdp, 0, sizeof(*rsdp));
     memcpy(rsdp->signature, "RSD PTR ", 8);
@@ -1607,17 +1631,6 @@ void acpi_bios_init(void)
     rsdp->rsdt_physical_address = cpu_to_le32(rsdt_addr);
     rsdp->checksum = acpi_checksum((void *)rsdp, 20);
 
-    /* RSDT */
-    memset(rsdt, 0, sizeof(*rsdt));
-    rsdt->table_offset_entry[0] = cpu_to_le32(fadt_addr);
-    rsdt->table_offset_entry[1] = cpu_to_le32(madt_addr);
-    rsdt->table_offset_entry[2] = cpu_to_le32(ssdt_addr);
-#ifdef BX_QEMU
-    rsdt->table_offset_entry[3] = cpu_to_le32(hpet_addr);
-#endif
-    acpi_build_table_header((struct acpi_table_header *)rsdt,
-                            "RSDT", sizeof(*rsdt), 1);
-
     /* FADT */
     memset(fadt, 0, sizeof(*fadt));
     fadt->firmware_ctrl = cpu_to_le32(facs_addr);
@@ -1692,6 +1705,7 @@ void acpi_bios_init(void)
                                 "APIC", madt_size, 1);
     }
 
+    memset(rsdt, 0, rsdt_size);
 #ifdef BX_QEMU
     /* HPET */
     memset(hpet, 0, sizeof(*hpet));
@@ -1702,7 +1716,34 @@ void acpi_bios_init(void)
     hpet->addr.address = cpu_to_le32(ACPI_HPET_ADDRESS);
     acpi_build_table_header((struct  acpi_table_header *)hpet,
                              "HPET", sizeof(*hpet), 1);
+
+    acpi_additional_tables(); /* resets cfg to required entry */
+    for(i = 0; i < external_tables; i++) {
+        uint16_t len;
+        if(acpi_load_table(i, addr, &len) < 0)
+            BX_PANIC("Failed to load ACPI table from QEMU\n");
+        rsdt->table_offset_entry[i+4] = cpu_to_le32(addr);
+        addr += len;
+        if(addr >= ram_size)
+            BX_PANIC("ACPI table overflow\n");
+    }
+#endif
+
+    /* RSDT */
+    rsdt->table_offset_entry[0] = cpu_to_le32(fadt_addr);
+    rsdt->table_offset_entry[1] = cpu_to_le32(madt_addr);
+    rsdt->table_offset_entry[2] = cpu_to_le32(ssdt_addr);
+#ifdef BX_QEMU
+    rsdt->table_offset_entry[3] = cpu_to_le32(hpet_addr);
 #endif
+    acpi_build_table_header((struct acpi_table_header *)rsdt,
+                            "RSDT", rsdt_size, 1);
+
+    acpi_tables_size = addr - base_addr;
+
+    BX_INFO("ACPI tables: RSDP addr=0x%08lx ACPI DATA addr=0x%08lx size=0x%x\n",
+            (unsigned long)rsdp,
+            (unsigned long)rsdt, acpi_tables_size);
 
 }
 
--
			Gleb.





Index: bochs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bochs/devel/bochs.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- bochs.spec	5 Mar 2009 17:33:46 -0000	1.38
+++ bochs.spec	5 Mar 2009 17:42:27 -0000	1.39
@@ -1,7 +1,7 @@
 %define githead 04387139e3b
 Name:           bochs
 Version:        2.3.8
-Release:        0.2.git%{githead}%{?dist}
+Release:        0.3.git%{githead}%{?dist}
 Summary:        Portable x86 PC emulator
 Group:          Applications/Emulators
 License:        LGPLv2+
@@ -201,6 +201,9 @@
 
 
 %changelog
+* Thu Mar 05 2009 Glauber Costa <glommer at redhat.com> 2.3.8-0.3.git04387139e3b
+- added patches ;-)
+
 * Thu Mar 05 2009 Glauber Costa <glommer at redhat.com> 2.3.8-0.2.git04387139e3b
 - this time with sources added.
 


--- bochs-2.3.6-gcc43.patch DELETED ---


--- bochs-2.3.7-3dnow-compile-fix.patch DELETED ---


--- bochs-2.3.7-big-endian.patch DELETED ---


--- bochs-wx28.patch DELETED ---




More information about the fedora-extras-commits mailing list