Hello community, here is the log from the commit of package kvm for openSUSE:Factory checked in at Tue Oct 11 16:56:50 CEST 2011.
-------- --- openSUSE:Factory/kvm/kvm.changes 2011-09-23 02:07:29.000000000 +0200 +++ /mounts/work_src_done/STABLE/kvm/kvm.changes 2011-10-10 23:22:28.000000000 +0200 @@ -1,0 +2,8 @@ +Mon Oct 10 21:05:56 UTC 2011 - [email protected] + +- Update seabios to v1.6.3 +- fix curl based disk access +- fix termination by signal with -no-shutdown option set +- dont set e1000 capabilities list bit + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- seabios-git-8e30147.tar.bz2 New: ---- kvm-qemu-preXX-Fix-termination-by-signal-with-no-shutdown.patch kvm-qemu-preXX-block-curl-Don-t-finish-AIOCBs-too-early.patch kvm-qemu-preXX-block-curl-Implement-a-flush-function-on-the-fd-han.patch kvm-qemu-preXX-e1000-Don-t-set-the-Capabilities-List-bit.patch seabios-1.6.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kvm.spec ++++++ --- /var/tmp/diff_new_pack.zEruSF/_old 2011-10-11 16:56:42.000000000 +0200 +++ /var/tmp/diff_new_pack.zEruSF/_new 2011-10-11 16:56:42.000000000 +0200 @@ -22,7 +22,7 @@ %define package_true_version 0.15.0 %define package_base_version 0.15.0 -%define bios_id seabios-git-8e30147 +%define bios_id seabios-1.6.3 %define pxe_rom_id ipxe-git-149b502 %define vgabios_id vgabios-0.6c # sgabios comes from: http://sgabios.googlecode.com/svn/trunk, Rev 8 @@ -87,7 +87,7 @@ Summary: Kernel-based Virtual Machine Url: http://www.linux-kvm.org Version: %{package_true_version} -Release: 1 +Release: 2 Source0: qemu-%{name}-%{package_true_version}.tar.bz2 Source1: 60-kvm.rules Source2: qemu-ifup @@ -99,16 +99,24 @@ Source8: bcc-0.16.17-2.i486.rpm Source9: %{vgabios_id}.tar.bz2 Source10: %{sgabios_id}.tar.bz2 -# common and X86 patches + +# ipxe patches Patch01: ipxe-rom-settings.patch -Patch02: seabios-sanitize-version.patch -Patch03: vgabios-bcc-paths.patch -Patch04: qemu-datadir.diff -Patch05: kvm-qemu-default-memsize.patch -Patch06: kvm-qemu-user-space-tool-name.patch -Patch07: kvm-qemu-fix-unused-but-set.patch -Patch08: kvm-qemu-madvise-DONTFORK-for-tight-memory-migration.patch -Patch09: kvm-qemu-fix-1mb-memory-assert.patch + +# seabios patches +Patch20: seabios-sanitize-version.patch + +# vgabios patches +Patch40: vgabios-bcc-paths.patch + +# common and X86 patches +# qemu-kvm patches +Patch60: qemu-datadir.diff +Patch61: kvm-qemu-default-memsize.patch +Patch62: kvm-qemu-user-space-tool-name.patch +Patch63: kvm-qemu-fix-unused-but-set.patch +Patch64: kvm-qemu-madvise-DONTFORK-for-tight-memory-migration.patch +Patch65: kvm-qemu-fix-1mb-memory-assert.patch # Post-release upstream patches Patch100: kvm-qemu-preXX-dictzip1.patch @@ -118,8 +126,12 @@ Patch104: kvm-qemu-preXX-vns-tls-don-t-use-depricated-gnutls-functions.patch Patch105: kvm-qemu-preXX-qemu_vmalloc-align-properly-for-transparent-hugepag.patch Patch106: kvm-qemu-madvise-hugepages.patch +Patch107: kvm-qemu-preXX-Fix-termination-by-signal-with-no-shutdown.patch +Patch108: kvm-qemu-preXX-block-curl-Implement-a-flush-function-on-the-fd-han.patch +Patch109: kvm-qemu-preXX-block-curl-Don-t-finish-AIOCBs-too-early.patch +Patch110: kvm-qemu-preXX-e1000-Don-t-set-the-Capabilities-List-bit.patch -Patch155: qemu-kvm-common-code-fixes-for-s390-build.patch +Patch150: qemu-kvm-common-code-fixes-for-s390-build.patch Patch200: qemu-img-vmdk-scsi.patch Patch201: kvm-studio-slirp-nooutgoing.patch @@ -181,6 +193,7 @@ cd bcc-bits/ rpm2cpio %{SOURCE8} | cpio -id ./usr/bin/bcc ./usr/lib/bcc/bcc-cc1 %setup -q -T -D -n %{pxe_rom_id} -b 7 +# ipxe patches %patch01 -p1 %endif %setup -q -n qemu-%{name}-%{package_true_version} -a 6 -a 9 -a 10 @@ -190,16 +203,21 @@ do rm -f pc-bios/$i done -%patch02 -p1 -%patch03 -p1 +# seabios patches +%patch20 -p1 + +# vgabios patches +%patch40 -p1 %endif -cp %{SOURCE3} . -%patch04 -p1 -%patch05 -p1 -%patch06 -p1 -%patch07 -p1 -%patch08 -p1 -%patch09 -p1 + +# qemu-kvm patches +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 + # Post-release patches %patch100 -p1 %patch101 -p1 @@ -208,8 +226,12 @@ %patch104 -p1 %patch105 -p1 %patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 -%patch155 -p1 +%patch150 -p1 # Studio addons %patch200 -p1 @@ -232,6 +254,8 @@ %patch706 -p1 %endif +cp %{SOURCE3} . + %build # change from devel version to actual version echo "%{package_base_version}" > VERSION ++++++ kvm-qemu-preXX-Fix-termination-by-signal-with-no-shutdown.patch ++++++ >From d9389b9664df561db796b18eb8309fffe58faf8b Mon Sep 17 00:00:00 2001 From: Kevin Wolf <[email protected]> Date: Wed, 14 Sep 2011 15:38:40 +0200 Subject: [PATCH] Fix termination by signal with -no-shutdown On signals such as SIGTERM qemu should exit instead of just stopping the VM even with -no-shutdown. Signed-off-by: Kevin Wolf <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> --- vl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index b773d2f..0c2fc3f 100644 --- a/vl.c +++ b/vl.c @@ -1296,6 +1296,7 @@ void qemu_system_killed(int signal, pid_t pid) { shutdown_signal = signal; shutdown_pid = pid; + no_shutdown = 0; qemu_system_shutdown_request(); } -- 1.6.0.2 ++++++ kvm-qemu-preXX-block-curl-Don-t-finish-AIOCBs-too-early.patch ++++++ >From 363c3c85350d79d224265aac11db1fbcb61215dc Mon Sep 17 00:00:00 2001 From: Nick Thomas <[email protected]> Date: Wed, 21 Sep 2011 11:55:50 +0100 Subject: [PATCH] block/curl: Don't finish AIOCBs too early The previous behaviour was to finish AIOCBs inside curl_aio_readv() if the data was cached. This caused the following failed assertion at hw/ide/pci.c:314: bmdma_cmd_writeb "Assertion `bm->bus->dma->aiocb == ((void *)0)' failed." By scheduling a QEMUBH and performing the completion inside the callback, we avoid this problem. Signed-off-by: Nick Thomas <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> --- block/curl.c | 68 +++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 49 insertions(+), 19 deletions(-) diff --git a/block/curl.c b/block/curl.c index 21fed93..4209ac8 100644 --- a/block/curl.c +++ b/block/curl.c @@ -47,7 +47,12 @@ struct BDRVCURLState; typedef struct CURLAIOCB { BlockDriverAIOCB common; + QEMUBH *bh; QEMUIOVector *qiov; + + int64_t sector_num; + int nb_sectors; + size_t start; size_t end; } CURLAIOCB; @@ -440,43 +445,42 @@ static AIOPool curl_aio_pool = { .cancel = curl_aio_cancel, }; -static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, - int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, - BlockDriverCompletionFunc *cb, void *opaque) + +static void curl_readv_bh_cb(void *p) { - BDRVCURLState *s = bs->opaque; - CURLAIOCB *acb; - size_t start = sector_num * SECTOR_SIZE; - size_t end; CURLState *state; - acb = qemu_aio_get(&curl_aio_pool, bs, cb, opaque); - if (!acb) - return NULL; + CURLAIOCB *acb = p; + BDRVCURLState *s = acb->common.bs->opaque; - acb->qiov = qiov; + qemu_bh_delete(acb->bh); + acb->bh = NULL; + + size_t start = acb->sector_num * SECTOR_SIZE; + size_t end; // In case we have the requested data already (e.g. read-ahead), // we can just call the callback and be done. - - switch (curl_find_buf(s, start, nb_sectors * SECTOR_SIZE, acb)) { + switch (curl_find_buf(s, start, acb->nb_sectors * SECTOR_SIZE, acb)) { case FIND_RET_OK: qemu_aio_release(acb); // fall through case FIND_RET_WAIT: - return &acb->common; + return; default: break; } // No cache found, so let's start a new request - state = curl_init_state(s); - if (!state) - return NULL; + if (!state) { + acb->common.cb(acb->common.opaque, -EIO); + qemu_aio_release(acb); + return; + } acb->start = 0; - acb->end = (nb_sectors * SECTOR_SIZE); + acb->end = (acb->nb_sectors * SECTOR_SIZE); state->buf_off = 0; if (state->orig_buf) @@ -489,12 +493,38 @@ static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, snprintf(state->range, 127, "%zd-%zd", start, end); DPRINTF("CURL (AIO): Reading %d at %zd (%s)\n", - (nb_sectors * SECTOR_SIZE), start, state->range); + (acb->nb_sectors * SECTOR_SIZE), start, state->range); curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range); curl_multi_add_handle(s->multi, state->curl); curl_multi_do(s); +} + +static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, + int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque) +{ + CURLAIOCB *acb; + + acb = qemu_aio_get(&curl_aio_pool, bs, cb, opaque); + + if (!acb) { + return NULL; + } + + acb->qiov = qiov; + acb->sector_num = sector_num; + acb->nb_sectors = nb_sectors; + + acb->bh = qemu_bh_new(curl_readv_bh_cb, acb); + + if (!acb->bh) { + DPRINTF("CURL: qemu_bh_new failed\n"); + return NULL; + } + + qemu_bh_schedule(acb->bh); return &acb->common; } -- 1.6.0.2 ++++++ kvm-qemu-preXX-block-curl-Implement-a-flush-function-on-the-fd-han.patch ++++++ >From c84dcdc1d6583ebe5841907c99d95deb8c40a6e0 Mon Sep 17 00:00:00 2001 From: Nick Thomas <[email protected]> Date: Wed, 21 Sep 2011 11:55:49 +0100 Subject: [PATCH] block/curl: Implement a flush function on the fd handlers Signed-off-by: Nick Thomas <[email protected]> Signed-off-by: Kevin Wolf <[email protected]> --- block/curl.c | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/block/curl.c b/block/curl.c index f3f61cc..21fed93 100644 --- a/block/curl.c +++ b/block/curl.c @@ -76,6 +76,7 @@ typedef struct BDRVCURLState { static void curl_clean_state(CURLState *s); static void curl_multi_do(void *arg); +static int curl_aio_flush(void *opaque); static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, void *s, void *sp) @@ -83,14 +84,16 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd); switch (action) { case CURL_POLL_IN: - qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, NULL, NULL, s); + qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, curl_aio_flush, + NULL, s); break; case CURL_POLL_OUT: - qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, NULL, NULL, s); + qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, curl_aio_flush, + NULL, s); break; case CURL_POLL_INOUT: - qemu_aio_set_fd_handler(fd, curl_multi_do, - curl_multi_do, NULL, NULL, s); + qemu_aio_set_fd_handler(fd, curl_multi_do, curl_multi_do, + curl_aio_flush, NULL, s); break; case CURL_POLL_REMOVE: qemu_aio_set_fd_handler(fd, NULL, NULL, NULL, NULL, NULL); @@ -412,6 +415,21 @@ out_noclean: return -EINVAL; } +static int curl_aio_flush(void *opaque) +{ + BDRVCURLState *s = opaque; + int i, j; + + for (i=0; i < CURL_NUM_STATES; i++) { + for(j=0; j < CURL_NUM_ACB; j++) { + if (s->states[i].acb[j]) { + return 1; + } + } + } + return 0; +} + static void curl_aio_cancel(BlockDriverAIOCB *blockacb) { // Do we have to implement canceling? Seems to work without... -- 1.6.0.2 ++++++ kvm-qemu-preXX-e1000-Don-t-set-the-Capabilities-List-bit.patch ++++++ >From dd8e93799f13ef82d83c185b8e71e049452f7d40 Mon Sep 17 00:00:00 2001 From: dann frazier <[email protected]> Date: Wed, 21 Sep 2011 14:06:25 -0600 Subject: [PATCH] e1000: Don't set the Capabilities List bit [Originally sent to qemu-kvm list, but I was redirected here] The Capabilities Pointer is NULL, so this bit shouldn't be set. The state of this bit doesn't appear to change any behavior on Linux/Windows versions we've tested, but it does cause Windows' PCI/PCI Express Compliance Test to balk. I happen to have a physical 82540EM controller, and it also sets the Capabilities Bit, but it actually has items on the capabilities list to go with it :) Signed-off-by: dann frazier <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> --- hw/e1000.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 6a3a941..ce8fc8b 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1151,8 +1151,6 @@ static int pci_e1000_init(PCIDevice *pci_dev) pci_conf = d->dev.config; - /* TODO: we have no capabilities, so why is this bit set? */ - pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST); /* TODO: RST# value should be 0, PCI spec 6.2.4 */ pci_conf[PCI_CACHE_LINE_SIZE] = 0x10; -- 1.6.0.2 ++++++ seabios-git-8e30147.tar.bz2 -> seabios-1.6.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/Makefile new/roms/seabios/Makefile --- old/roms/seabios/Makefile 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/Makefile 2011-10-05 03:14:09.000000000 +0200 @@ -5,13 +5,13 @@ # This file may be distributed under the terms of the GNU LGPLv3 license. # Program version -VERSION=pre-0.6.3-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) +VERSION=1.6.3-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) # Output directory OUT=out/ # Source files -SRCBOTH=misc.c pmm.c stacks.c output.c util.c block.c floppy.c ata.c mouse.c \ +SRCBOTH=misc.c stacks.c pmm.c output.c util.c block.c floppy.c ata.c mouse.c \ kbd.c pci.c serial.c clock.c pic.c cdrom.c ps2port.c smp.c resume.c \ pnpbios.c pirtable.c vgahooks.c ramdisk.c pcibios.c blockcmd.c \ usb.c usb-uhci.c usb-ohci.c usb-ehci.c usb-hid.c usb-msc.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/README new/roms/seabios/README --- old/roms/seabios/README 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/README 2011-10-05 03:14:09.000000000 +0200 @@ -24,24 +24,6 @@ qemu -L mybiosdir/ -fda myfdimage.img -The following payloads have been tested: - -Freedos - see http://www.freedos.org/ . Useful tests include: booting -from installation cdrom, installing to hard drive and floppy, making -sure hard drive and floppy boots then work. It is also useful to take -the bootable floppy and hard-drive images, write them to an el-torito -bootable cdrom using the Linux mkisofs utility, and then boot those -cdrom images. - -Linux - useful hard drive image available from -http://fabrice.bellard.free.fr/qemu/linux-0.2.img.bz2 . It is also -useful to test standard distribution bootup and live cdroms. - -NetBSD - useful hard drive image available from -http://nopid.free.fr/small.ffs.bz2 . It is also useful to test -standard distribution installation cdroms. - - Overview of files: The src/ directory contains the bios source code. Several of the @@ -62,20 +44,20 @@ The gcc "-fwhole-program" and "-ffunction-sections -fdata-sections" options are used to optimize the process so that gcc can efficiently compile and discard unneeded code. (In the code, one can use the -macros 'VISIBLE16' and 'VISIBLE32' to instruct a symbol to be +macros 'VISIBLE16' and 'VISIBLE32FLAT' to instruct a symbol to be outputted in 16bit and 32bit mode respectively.) This resulting assembler code is pulled into romlayout.S. The gas option ".code16gcc" is used prior to including the gcc generated assembler - this option enables gcc to generate valid 16 bit code. -The post code (post.c) is entered, via the function _start(), in 32bit -mode. The 16bit post vector (in romlayout.S) transitions the cpu into -32 bit mode before calling the post.c code. +The post code (post.c) is entered, via the function handle_post(), in +32bit mode. The 16bit post vector (in romlayout.S) transitions the +cpu into 32 bit mode before calling the post.c code. In the last step of compilation, the 32 bit code is merged into the 16 bit code so that one binary file contains both. Currently, both 16bit -and 32bit code will be located in the 64K block at segment 0xf000. +and 32bit code will be located in the memory at 0xe0000-0xfffff. GCC 16 bit limitations: @@ -164,9 +146,10 @@ Debugging the bios: The bios will output information messages to a special debug port. -Under qemu, one can view these messages by enabling the '#define -DEBUG_BIOS' definition in 'qemu/hw/pc.c'. Once this is done (and qemu -is recompiled), one should see status messages on the console. +Under qemu, one can view these messages by adding '-chardev +stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios' to +the qemu command line. Once this is done, one should see status +messages on the console. The gdb-server mechanism of qemu is also useful. One can use gdb with qemu to debug system images. To use this, add '-s -S' to the qemu diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/acpi.c new/roms/seabios/src/acpi.c --- old/roms/seabios/src/acpi.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/acpi.c 2011-10-05 03:14:09.000000000 +0200 @@ -156,7 +156,9 @@ u16 min_tick; u8 page_protect; } PACKED; -#define ACPI_HPET_ADDRESS 0xFED00000UL + +#define HPET_ID 0x000 +#define HPET_PERIOD 0x004 /* * SRAT (NUMA topology description) table @@ -205,9 +207,9 @@ h->revision = rev; memcpy(h->oem_id, CONFIG_APPNAME6, 6); memcpy(h->oem_table_id, CONFIG_APPNAME4, 4); - memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4); memcpy(h->oem_table_id + 4, (void*)&sig, 4); h->oem_revision = cpu_to_le32(1); + memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4); h->asl_compiler_revision = cpu_to_le32(1); h->checksum -= checksum(h, len); } @@ -460,11 +462,20 @@ return ssdt; } -#define HPET_SIGNATURE 0x54455048 //HPET +#define HPET_SIGNATURE 0x54455048 // HPET static void* build_hpet(void) { - struct acpi_20_hpet *hpet = malloc_high(sizeof(*hpet)); + struct acpi_20_hpet *hpet; + const void *hpet_base = (void *)BUILD_HPET_ADDRESS; + u32 hpet_vendor = readl(hpet_base + HPET_ID) >> 16; + u32 hpet_period = readl(hpet_base + HPET_PERIOD); + + if (hpet_vendor == 0 || hpet_vendor == 0xffff || + hpet_period == 0 || hpet_period > 100000000) + return NULL; + + hpet = malloc_high(sizeof(*hpet)); if (!hpet) { warn_noalloc(); return NULL; @@ -475,7 +486,7 @@ * emulated hpet */ hpet->timer_block_id = cpu_to_le32(0x8086a201); - hpet->addr.address = cpu_to_le32(ACPI_HPET_ADDRESS); + hpet->addr.address = cpu_to_le32(BUILD_HPET_ADDRESS); build_header((void*)hpet, HPET_SIGNATURE, sizeof(*hpet), 1); return hpet; @@ -487,7 +498,7 @@ { numamem->type = SRAT_MEMORY; numamem->length = sizeof(*numamem); - memset (numamem->proximity, 0 ,4); + memset(numamem->proximity, 0 ,4); numamem->proximity[0] = node; numamem->flags = cpu_to_le32(!!enabled); numamem->base_addr_low = base & 0xFFFFFFFF; @@ -496,7 +507,7 @@ numamem->length_high = len >> 32; } -#define SRAT_SIGNATURE 0x54415253 //HPET +#define SRAT_SIGNATURE 0x54415253 // SRAT static void * build_srat(void) { @@ -616,13 +627,7 @@ // Device not found return; - // Create initial rsdt table - struct rsdp_descriptor *rsdp = malloc_fseg(sizeof(*rsdp)); - if (!rsdp) { - warn_noalloc(); - return; - } - + // Build ACPI tables u32 tables[MAX_ACPI_TABLES], tbl_idx = 0; #define ACPI_INIT_TABLE(X) \ @@ -632,7 +637,6 @@ tbl_idx++; \ } while(0) - // Add tables ACPI_INIT_TABLE(build_fadt(pci)); ACPI_INIT_TABLE(build_ssdt()); ACPI_INIT_TABLE(build_madt()); @@ -641,7 +645,7 @@ u16 i, external_tables = qemu_cfg_acpi_additional_tables(); - for(i = 0; i < external_tables; i++) { + for (i = 0; i < external_tables; i++) { u16 len = qemu_cfg_next_acpi_table_len(); void *addr = malloc_high(len); if (!addr) { @@ -655,20 +659,24 @@ } } + // Build final rsdt table struct rsdt_descriptor_rev1 *rsdt; size_t rsdt_len = sizeof(*rsdt) + sizeof(u32) * tbl_idx; rsdt = malloc_high(rsdt_len); - if (!rsdt) { warn_noalloc(); return; } memset(rsdt, 0, rsdt_len); memcpy(rsdt->table_offset_entry, tables, sizeof(u32) * tbl_idx); - build_header((void*)rsdt, RSDT_SIGNATURE, rsdt_len, 1); // Build rsdp pointer table + struct rsdp_descriptor *rsdp = malloc_fseg(sizeof(*rsdp)); + if (!rsdp) { + warn_noalloc(); + return; + } memset(rsdp, 0, sizeof(*rsdp)); rsdp->signature = RSDP_SIGNATURE; memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/biostables.c new/roms/seabios/src/biostables.c --- old/roms/seabios/src/biostables.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/biostables.c 2011-10-05 03:14:09.000000000 +0200 @@ -86,6 +86,8 @@ void copy_smbios(void *pos) { + if (SMBiosAddr) + return; struct smbios_entry_point *p = pos; if (memcmp(p->anchor_string, "_SM_", 4)) return; @@ -102,4 +104,5 @@ } dprintf(1, "Copying SMBIOS entry point from %p to %p\n", pos, newpos); memcpy(newpos, pos, p->length); + SMBiosAddr = newpos; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/config.h new/roms/seabios/src/config.h --- old/roms/seabios/src/config.h 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/config.h 2011-10-05 03:14:09.000000000 +0200 @@ -22,6 +22,8 @@ #define CONFIG_MAX_HIGHTABLE (64*1024) // Largest supported externaly facing drive id #define CONFIG_MAX_EXTDRIVE 16 +// Number of bytes the smbios may be and still live in the f-segment +#define BUILD_MAX_SMBIOS_FSEG 600 #define CONFIG_MODEL_ID 0xFC #define CONFIG_SUBMODEL_ID 0x00 @@ -38,20 +40,17 @@ #define BUILD_BIOS_SIZE 0x10000 // 32KB for shadow ram copying (works around emulator deficiencies) #define BUILD_BIOS_TMP_ADDR 0x30000 +#define BUILD_SMM_INIT_ADDR 0x38000 +#define BUILD_SMM_ADDR 0xa8000 +#define BUILD_SMM_SIZE 0x8000 #define BUILD_MAX_HIGHMEM 0xe0000000 #define BUILD_PCIMEM_START 0xe0000000 -#define BUILD_PCIMEM_SIZE (BUILD_PCIMEM_END - BUILD_PCIMEM_START) #define BUILD_PCIMEM_END 0xfec00000 /* IOAPIC is mapped at */ -#define BUILD_APIC_ADDR 0xfee00000 #define BUILD_IOAPIC_ADDR 0xfec00000 - -#define BUILD_SMM_INIT_ADDR 0x38000 -#define BUILD_SMM_ADDR 0xa8000 -#define BUILD_SMM_SIZE 0x8000 - -#define BUILD_MAX_SMBIOS_FSEG 600 +#define BUILD_HPET_ADDRESS 0xfed00000 +#define BUILD_APIC_ADDR 0xfee00000 // Important real-mode segments #define SEG_IVT 0x0000 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/coreboot.c new/roms/seabios/src/coreboot.c --- old/roms/seabios/src/coreboot.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/coreboot.c 2011-10-05 03:14:09.000000000 +0200 @@ -201,6 +201,7 @@ copy_pir(p); copy_mptable(p); copy_acpi_rsdp(p); + copy_smbios(p); } } @@ -221,9 +222,9 @@ scan_tables(m->start, m->size); } - // XXX - just create dummy smbios table for now - should detect if - // smbios/dmi table is found from coreboot and use that instead. - smbios_init(); + // XXX - create a dummy smbios table for now. + if (!SMBiosAddr) + smbios_init(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/pci.c new/roms/seabios/src/pci.c --- old/roms/seabios/src/pci.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/pci.c 2011-10-05 03:14:09.000000000 +0200 @@ -88,9 +88,21 @@ struct pci_device *PCIDevices; int MaxPCIBus VAR16VISIBLE; +// Check if PCI is available at all +int +pci_probe_host(void) +{ + outl(0x80000000, PORT_PCI_CMD); + if (inl(PORT_PCI_CMD) != 0x80000000) { + dprintf(1, "Detected non-PCI system\n"); + return -1; + } + return 0; +} + // Find all PCI devices and populate PCIDevices linked list. void -pci_probe(void) +pci_probe_devices(void) { dprintf(3, "PCI probe\n"); struct pci_device *busdevs[256]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/pci.h new/roms/seabios/src/pci.h --- old/roms/seabios/src/pci.h 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/pci.h 2011-10-05 03:14:09.000000000 +0200 @@ -62,7 +62,8 @@ }; extern struct pci_device *PCIDevices; extern int MaxPCIBus; -void pci_probe(void); +int pci_probe_host(void); +void pci_probe_devices(void); static inline u32 pci_classprog(struct pci_device *pci) { return (pci->class << 8) | pci->prog_if; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/pciinit.c new/roms/seabios/src/pciinit.c --- old/roms/seabios/src/pciinit.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/pciinit.c 2011-10-05 03:14:09.000000000 +0200 @@ -536,7 +536,7 @@ } } -#define ROOT_BASE(top, sum, align) ALIGN_DOWN((top)-(sum),(align)) +#define ROOT_BASE(top, sum, max) ALIGN_DOWN((top)-(sum),(max) ?: 1) static int pci_bios_init_root_regions(u32 start, u32 end) { @@ -577,7 +577,7 @@ { if (CONFIG_COREBOOT || usingXen()) { // PCI setup already done by coreboot or Xen - just do probe. - pci_probe(); + pci_probe_devices(); return; } @@ -587,10 +587,13 @@ u32 end = BUILD_PCIMEM_END; dprintf(1, "=== PCI bus & bridge init ===\n"); + if (pci_probe_host() != 0) { + return; + } pci_bios_init_bus(); dprintf(1, "=== PCI device probing ===\n"); - pci_probe(); + pci_probe_devices(); dprintf(1, "=== PCI new allocation pass #1 ===\n"); busses = malloc_tmp(sizeof(*busses) * busses_count); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/post.c new/roms/seabios/src/post.c --- old/roms/seabios/src/post.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/post.c 2011-10-05 03:14:09.000000000 +0200 @@ -333,10 +333,25 @@ func(); } -// Start of Power On Self Test (POST) - the BIOS initilization phase. -// This function does the setup needed for code relocation, and then -// invokes the relocation and main setup code. +// Setup for code relocation and then call reloc_init void VISIBLE32INIT +dopost(void) +{ + HaveRunPost = 1; + + // Detect ram and setup internal malloc. + qemu_cfg_port_probe(); + ram_probe(); + malloc_setup(); + + // Relocate initialization code and call maininit(). + reloc_init(); +} + +// Entry point for Power On Self Test (POST) - the BIOS initilization +// phase. This function makes the memory at 0xc0000-0xfffff +// read/writable and then calls dopost(). +void VISIBLE32FLAT handle_post(void) { debug_serial_setup(); @@ -356,13 +371,7 @@ // Allow writes to modify bios area (0xf0000) make_bios_writable(); - HaveRunPost = 1; - - // Detect ram and setup internal malloc. - qemu_cfg_port_probe(); - ram_probe(); - malloc_setup(); - // Relocate initialization code and call maininit(). - reloc_init(); + // Now that memory is read/writable - start post process. + dopost(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/smbios.c new/roms/seabios/src/smbios.c --- old/roms/seabios/src/smbios.c 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/smbios.c 2011-10-05 03:14:09.000000000 +0200 @@ -10,6 +10,8 @@ #include "paravirt.h" // qemu_cfg_smbios_load_field #include "smbios.h" // struct smbios_entry_point +struct smbios_entry_point *SMBiosAddr; + static void smbios_entry_point_init(u16 max_structure_size, u16 structure_table_length, @@ -50,6 +52,7 @@ ep->intermediate_checksum -= checksum((void*)ep + 0x10, ep->length - 0x10); + SMBiosAddr = ep; dprintf(1, "SMBIOS ptr=%p table=%p size=%d\n" , ep, finaltable, structure_table_length); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roms/seabios/src/smbios.h new/roms/seabios/src/smbios.h --- old/roms/seabios/src/smbios.h 2011-08-10 04:54:35.000000000 +0200 +++ new/roms/seabios/src/smbios.h 2011-10-05 03:14:09.000000000 +0200 @@ -24,6 +24,8 @@ u8 smbios_bcd_revision; } PACKED; +extern struct smbios_entry_point *SMBiosAddr; + /* This goes at the beginning of every SMBIOS structure. */ struct smbios_structure_header { u8 type; ++++++ seabios-sanitize-version.patch ++++++ --- /var/tmp/diff_new_pack.zEruSF/_old 2011-10-11 16:56:43.000000000 +0200 +++ /var/tmp/diff_new_pack.zEruSF/_new 2011-10-11 16:56:43.000000000 +0200 @@ -1,13 +1,13 @@ -Index: qemu-kvm-0.14.50/roms/seabios/Makefile +Index: qemu-kvm-0.15.0/roms/seabios/Makefile =================================================================== ---- qemu-kvm-0.14.50.orig/roms/seabios/Makefile -+++ qemu-kvm-0.14.50/roms/seabios/Makefile +--- qemu-kvm-0.15.0.orig/roms/seabios/Makefile ++++ qemu-kvm-0.15.0/roms/seabios/Makefile @@ -5,7 +5,7 @@ # This file may be distributed under the terms of the GNU LGPLv3 license. # Program version --VERSION=pre-0.6.3-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) -+VERSION=pre-0.6.3-$(shell date +"%Y%m%d_%H%M%S") +-VERSION=1.6.3-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) ++VERSION=1.6.3-$(shell date +"%Y%m%d_%H%M%S") # Output directory OUT=out/ continue with "q"... Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
