From ff7e0278255caccb78c38b1278aba5822940b8bb Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Oct 26 2017 15:31:01 +0000 Subject: Fix FTBFS. --- diff --git a/bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch b/bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch deleted file mode 100644 index 9a2eef4..0000000 --- a/bochs-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch +++ /dev/null @@ -1,73 +0,0 @@ -qemu: bios: use preprocessor for pci link routing (Avi Kivity) - -Signed-off-by: Avi Kivity -Signed-off-by: Anthony Liguori - -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 () - --- - - - diff --git a/bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch b/bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch deleted file mode 100644 index 7cdc3d8..0000000 --- a/bochs-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch +++ /dev/null @@ -1,49 +0,0 @@ -bios: add 26 pci slots, bringing the total to 32 (Avi Kivity) - -lack of pci slots causes Windows to complain when installing too many devices. - -Signed-off-by: Avi Kivity -Signed-off-by: Anthony Liguori - -Index: bochs/bios/acpi-dsdt.dsl -=================================================================== ---- bochs.orig/bios/acpi-dsdt.dsl -+++ bochs/bios/acpi-dsdt.dsl -@@ -63,6 +63,32 @@ DefinitionBlock ( - prt_slot3(0x0003), - prt_slot0(0x0004), - prt_slot1(0x0005), -+ prt_slot2(0x0006), -+ prt_slot3(0x0007), -+ prt_slot0(0x0008), -+ prt_slot1(0x0009), -+ prt_slot2(0x000a), -+ prt_slot3(0x000b), -+ prt_slot0(0x000c), -+ prt_slot1(0x000d), -+ prt_slot2(0x000e), -+ prt_slot3(0x000f), -+ prt_slot0(0x0010), -+ prt_slot1(0x0011), -+ prt_slot2(0x0012), -+ prt_slot3(0x0013), -+ prt_slot0(0x0014), -+ prt_slot1(0x0015), -+ prt_slot2(0x0016), -+ prt_slot3(0x0017), -+ prt_slot0(0x0018), -+ prt_slot1(0x0019), -+ prt_slot2(0x001a), -+ prt_slot3(0x001b), -+ prt_slot0(0x001c), -+ prt_slot1(0x001d), -+ prt_slot2(0x001e), -+ prt_slot3(0x001f), - }) - - Name (_CRS, ResourceTemplate () - --- - - - diff --git a/bochs-0011_read-additional-acpi-tables-from-a-vm.patch b/bochs-0011_read-additional-acpi-tables-from-a-vm.patch deleted file mode 100644 index 2297fad..0000000 --- a/bochs-0011_read-additional-acpi-tables-from-a-vm.patch +++ /dev/null @@ -1,155 +0,0 @@ -Read additional ACPI tables from a VM (Gleb Natapov) - -Signed-off-by: Gleb Natapov -Signed-off-by: Anthony Liguori - -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) -@@ -1565,8 +1565,8 @@ - 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; - - if (ram_size - ACPI_DATA_SIZE < 0x100000) { - BX_INFO("Not enough memory for ACPI tables\n"); -@@ -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. - - - diff --git a/bochs-0012_remove_eh_frame_from_bios.patch b/bochs-0012_remove_eh_frame_from_bios.patch deleted file mode 100644 index 7bd026c..0000000 --- a/bochs-0012_remove_eh_frame_from_bios.patch +++ /dev/null @@ -1,16 +0,0 @@ -Remove the .eh_frame section from the rombios. - -This is so that bochs will build under gcc 4.6.0. - -Signed-off-by: Chris Lalancette - -diff -urp bochs-2.4.5.cvs.orig/bios/rombios32.ld bochs-2.4.5.cvs/bios/rombios32.ld ---- bochs-2.4.5.cvs.orig/bios/rombios32.ld 2008-12-04 13:44:14.000000000 -0500 -+++ bochs-2.4.5.cvs/bios/rombios32.ld 2011-02-14 13:53:54.811189023 -0500 -@@ -13,5 +13,6 @@ SECTIONS - *(.stabstr) - *(.comment) - *(.note) -+ *(.eh_frame) - } - } diff --git a/bochs-2.6.9-slirp-include.patch b/bochs-2.6.9-slirp-include.patch new file mode 100644 index 0000000..7ea3dda --- /dev/null +++ b/bochs-2.6.9-slirp-include.patch @@ -0,0 +1,10 @@ +--- iodev/network/slirp/slirp.h~ 2014-12-25 11:58:26.000000000 -0600 ++++ iodev/network/slirp/slirp.h 2017-10-26 09:52:46.147080062 -0500 +@@ -7,6 +7,7 @@ + + #include "config.h" + #include "slirp_config.h" ++#include + + #if defined(WIN32) && !defined(__CYGWIN__) + diff --git a/bochs.spec b/bochs.spec index e786b25..f9e7d51 100644 --- a/bochs.spec +++ b/bochs.spec @@ -1,23 +1,20 @@ %define _hardened_build 1 Name: bochs Version: 2.6.9 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Portable x86 PC emulator License: LGPLv2+ URL: http://bochs.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Patch0: %{name}-0001_bx-qemu.patch -#Patch1: %{name}-0006_qemu-bios-use-preprocessor-for-pci-link-routing.patch -#Patch2: %{name}-0007_bios-add-26-pci-slots,-bringing-the-total-to-32.patch Patch3: %{name}-0008_qemu-bios-provide-gpe-_l0x-methods.patch Patch4: %{name}-0009_qemu-bios-pci-hotplug-support.patch -#Patch5: %{name}-0011_read-additional-acpi-tables-from-a-vm.patch -#Patch6: %{name}-0012_remove_eh_frame_from_bios.patch Patch7: %{name}-nonet-build.patch # Update configure for aarch64 (bz #925112) Patch8: bochs-aarch64.patch Patch9: bochs-2.6.9-string-format.patch Patch10: bochs-usb.patch +Patch11: bochs-2.6.9-slirp-include.patch BuildRequires: libXt-devel libXpm-devel SDL2-devel readline-devel byacc BuildRequires: docbook-utils @@ -87,17 +84,12 @@ Header and source files from bochs source. %prep %setup -q %patch0 -p1 -#%patch1 -p1 -#%patch2 -p1 %patch3 -p1 %patch4 -p1 -#%patch5 -p1 -#%patch6 -p1 %patch7 -p0 -z .nonet -# Update configure for aarch64 (bz #925112) -#%patch8 -p1 %patch9 -p0 %patch10 -p0 +%patch11 -p0 # Fix up some man page paths. sed -i -e 's|/usr/local/share/|%{_datadir}/|' doc/man/*.* @@ -194,7 +186,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/bochs %{_bindir}/bximage %{_bindir}/bxhub -# Note: must include *.la in %{_libdir}/bochs/plugins/ +# Note: must include *.la in %%{_libdir}/bochs/plugins/ %{_libdir}/bochs/ %{_mandir}/man1/bochs.1* %{_mandir}/man1/bximage.1* @@ -226,6 +218,9 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/include/bochs/ %changelog +* Thu Oct 26 2017 Gwyn Ciesla - 2.6.9-5 +- Patch includes to fix FTBFS. + * Wed Aug 02 2017 Fedora Release Engineering - 2.6.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild