From aeca6e8d8b7dba78c3d1622463e238b773d9df13 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 2 Dec 2013 12:47:29 +0100 Subject: add pc-{i440fx,q35}-2.0 machine types Signed-off-by: Gerd Hoffmann --- hw/i386/pc_piix.c | 14 ++++++++++++-- hw/i386/pc_q35.c | 11 ++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 2111f0192c..9329f04b09 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -339,13 +339,22 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args) .desc = "Standard PC (i440FX + PIIX, 1996)", \ .hot_add_cpu = pc_hot_add_cpu +#define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS + +static QEMUMachine pc_i440fx_machine_v2_0 = { + PC_I440FX_2_0_MACHINE_OPTIONS, + .name = "pc-i440fx-2.0", + .alias = "pc", + .init = pc_init_pci, + .is_default = 1, +}; + #define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS + static QEMUMachine pc_i440fx_machine_v1_7 = { PC_I440FX_1_7_MACHINE_OPTIONS, .name = "pc-i440fx-1.7", - .alias = "pc", .init = pc_init_pci, - .is_default = 1, }; #define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS @@ -747,6 +756,7 @@ static QEMUMachine xenfv_machine = { static void pc_machine_init(void) { + qemu_register_machine(&pc_i440fx_machine_v2_0); qemu_register_machine(&pc_i440fx_machine_v1_7); qemu_register_machine(&pc_i440fx_machine_v1_6); qemu_register_machine(&pc_i440fx_machine_v1_5); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 600fc02ebe..ac69e5d20b 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -259,12 +259,20 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args) .desc = "Standard PC (Q35 + ICH9, 2009)", \ .hot_add_cpu = pc_hot_add_cpu +#define PC_Q35_2_0_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS + +static QEMUMachine pc_q35_machine_v2_0 = { + PC_Q35_2_0_MACHINE_OPTIONS, + .name = "pc-q35-2.0", + .alias = "q35", + .init = pc_q35_init, +}; + #define PC_Q35_1_7_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS static QEMUMachine pc_q35_machine_v1_7 = { PC_Q35_1_7_MACHINE_OPTIONS, .name = "pc-q35-1.7", - .alias = "q35", .init = pc_q35_init, }; @@ -306,6 +314,7 @@ static QEMUMachine pc_q35_machine_v1_4 = { static void pc_q35_machine_init(void) { + qemu_register_machine(&pc_q35_machine_v2_0); qemu_register_machine(&pc_q35_machine_v1_7); qemu_register_machine(&pc_q35_machine_v1_6); qemu_register_machine(&pc_q35_machine_v1_5); -- cgit v1.2.1 From 1442d3e6912d7ec88480099503cfa0aeaedf5634 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 15 Oct 2013 16:57:45 +0200 Subject: add firmware to machine options This patch adds firmware to the machine options. -bios becomes a shortcut for -machine firmware=. Advantage is that the firmware can be specified via config file as -machine is parsed using QemuOpts and it is also possible to use different defaults for different machine types (via QEMUMachine->default_machine_opts). Signed-off-by: Gerd Hoffmann --- vl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index 8d5d874e68..27b09e5873 100644 --- a/vl.c +++ b/vl.c @@ -428,6 +428,10 @@ static QemuOptsList qemu_machine_opts = { .name = "usb", .type = QEMU_OPT_BOOL, .help = "Set on/off to enable/disable usb", + },{ + .name = "firmware", + .type = QEMU_OPT_STRING, + .help = "firmware image", }, { /* End of list */ } }, @@ -3229,7 +3233,7 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_bios: - bios_name = optarg; + qemu_opts_set(qemu_find_opts("machine"), 0, "firmware", optarg); break; case QEMU_OPTION_singlestep: singlestep = 1; @@ -4050,6 +4054,7 @@ int main(int argc, char **argv, char **envp) kernel_filename = qemu_opt_get(machine_opts, "kernel"); initrd_filename = qemu_opt_get(machine_opts, "initrd"); kernel_cmdline = qemu_opt_get(machine_opts, "append"); + bios_name = qemu_opt_get(machine_opts, "firmware"); boot_order = machine->default_boot_order; opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL); -- cgit v1.2.1 From 11938d7863203d5ca523865761cac6130783c858 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 15 Oct 2013 17:02:19 +0200 Subject: roms: update seabios submodule to 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d Updates seabios to git master snapshot. seabios is in freeze now, update to final 1.7.4 will follow later this year. Summary of major changes: * Support for acpi table loading from qemu. * Support for the xhci host adapter. * Support for the pvscsi HBA. * Various minor bug fixes. * Lots of cleanups. Full shortlog since 1.7.3 (note that some of these changes have been cherry-picked into 1.7.3-stable): Evgeny Budilovsky (1): Add pvscsi boot support Gerd Hoffmann (27): coreboot: add cbmem console support Add CONFIG_DEBUG_COREBOOT config option apm: fix shutdown ahci: add missing check for allocation failure bochsvga: fallback to stdvga if dispi interface isn't present Add generic qemu detection Drop coreboot qemu detection Add qemu detection to csm uas: add (temporary) superspeed stopgap usb: add usb_update_pipe() usb: add xhci support fix buildversion.sh build: simplify cross builds build: create output dirs in do-kconfig build: explicitly set ROM size Add qemu_cfg_e820 function. Add support for etc/e820 fw_cfg file pci: don't reorder entries when moving to 64bit list pci: don't map usb host adapters above 4G pci: align 64bit pci regions to 1G pci: tweak + comment minimum allocations pci: log pci windows pci: map 64-bit BARs at location provided by emulator ahci: zap real mode macros ahci: remote some parentheses ahci: alloc structs in high memory add hw/serialio.c to SRC32SEG Jonathan A. Kollasch (1): vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470 Kevin O'Connor (80): Fix USB EHCI detection that was broken in hlist conversion of PCIDevices. Update README to include info on VARLOW variables. PIC code cleanups. Move internal timer code from clock.c to a new file timer.c. Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY. Add helper functions to convert timer irqs to milliseconds. Improve accuracy of internal timers. Rename cpu_khz to TimerKHz. Shift CPU TSC down to reduce need for 64bit variables. Rename check_timer() function (and similar) to irqtimer_check(). Rename check_tsc() (and similar) to timer_check() and use u32. Separate out timer setup code. Unify pmtimer_read() and pittimer_read() code. Default unused UMB areas to be read-only. Add missing mathcp_setup() call to CSM code. Fix bug in CBFS file walking with compressed files. Support custom boot menu prompt and custom boot menu key. Minor cleanups to smm assembler. Add config option to support memory allocations in 9-segment. Minor - no need to declare MaxCountCPUs as VARFSEG. Minor - simplify rom_reserve(). Rename tools/ directory to scripts/ directory. Update kconfig to latest version. build: Don't use vpath makefile directive. Move code centered around specific hardware devices to src/hw/ Move code cenetered around firmware initialization to src/fw/ build: Reorder makefile source list to group like files together. README: Update readme to note scripts/ directory rename and vgasrc/ directory. vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio. vgabios: Limit the range of the VBE number of "pages" parameter. readme: Minor - fix typo in readme. Split x86 specific functions out of util.c/h to new files x86.c/h. Move keyboard calling code from util.c to boot.c. Rename util.c to string.c and introduce string.h. build: Perform compile checking on vgasrc code. Move stacks.c definitions from util.h to new file stacks.h. Move romfile definitions from util.h to new file romfile.h. Move malloc code from pmm.c to new files malloc.c and malloc.h. Move function definitions for output.c from util.h to new file output.h. Move definition of struct segoff_s from farptr.h to types.h. build: Fix import of gcc dependency files. Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h. Move optionroms.h to std/optionrom.h and util.h. Move vbe.h to std/vbe.h. Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h. Move fw/smbios.h to std/smbios.h. Move fw/mptable.h to std/mptable.h. Move fw/acpi.h to std/acpi.h. Move pnpbios definition to new file std/pnpbios.h. Move pmm definitions to new file std/pmm.h. Split disk.h into block.h and std/disk.h. Move standard bda type info from biosvar.h to std/bda.h. Merge bmp.h, boot.h, jpeg.h, and post.h into util.h. Sort the sections of util.h. Move PIT setup from clock.c to hw/timer.c. Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c. Move dma code to new file hw/dma.c. Remove ioport.h; disperse its contents to other header files. Minor - update file comments in src/malloc.c. Rename fields of 'struct chs_s' and use in floppy lba2chs(). Rearrange stack_hop_back() call in wait_irq, check_irqs, and _farcall16. Minor - move call16 assembler in romlayout.S. Make __call16 use C calling convention and support two passed parameters. Update _farcall16() to pass segment of callregs explicitly. Support call16() calls after entering 32bit mode from call32(). Run ahci code entirely in 32bit mode. Build different final files for QEMU, coreboot, and CSM. Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer. megasas: Don't attempt to access 'struct pci_device' at runtime. Minor - eliminate the SET_GLOBAL macro. Move low-level hardware writing from output.c to new file hw/serialio.c. vgabios: Load the DAC palette in "packed" modes on Cirrus and BochsVGA. vgabios: Support custom fonts in vga framebuffer text writing. vgabios: Add bochsvga "HDTV" resolutions. vgabios: Avoid possible divide by zero in bochsvga_set_displaystart. vgabios: Work around lack of support for "calll" in x86emu emulation. Minor - update file comment on bootsplash.c. vgabios: Support allocating an extra stack for vgabios calls and default on. vgabios: Move initialization code to new file vgainit.c. floppy: Minor - add warnings if timeouts occur. Michael S. Tsirkin (6): acpi: sync FADT flags from PIIX4 to Q35 acpi_extract.py: document DEVICE directives biostables: support looking up RSDP romfile_loader: utility to patch in-memory ROM files acpi: load and link tables through romfile loader acpi: strip compiler info in built-in DSDT if any Paul Menzel (2): ACPI DSDT: Make control method `IQCR` serialized hw/usb-xhci.c: Code refactoring to not override initializers in `speed_from_xhci[16]` Signed-off-by: Gerd Hoffmann --- roms/seabios | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roms/seabios b/roms/seabios index ece025f598..31b8b4eea9 160000 --- a/roms/seabios +++ b/roms/seabios @@ -1 +1 @@ -Subproject commit ece025f5980bae88fa677bc9c0d24d2e580e205d +Subproject commit 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d -- cgit v1.2.1 From 94e68caaa089f90f5210435c7e07e97701c98ee5 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 30 Sep 2013 11:37:12 +0200 Subject: roms: build two seabios binaries Adding xhci support to seabios made it jump over the 128k line. Changing the bios size breaks migration, so we have to keep a 128k seabios binary for old machine types. New machine types can use a large 256k bios which should be big enougth for a while. This patch updates the seabios build process to build seabios twice, once full featured and once with xen and xhci turned off so the resulting binary is small enougth to fit into 128k. Signed-off-by: Gerd Hoffmann --- roms/Makefile | 7 ++++--- roms/config.seabios | 1 - roms/config.seabios-128k | 6 ++++++ roms/config.seabios-256k | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) delete mode 100644 roms/config.seabios create mode 100644 roms/config.seabios-128k create mode 100644 roms/config.seabios-256k diff --git a/roms/Makefile b/roms/Makefile index 10d5a65d61..fc716c1b10 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -56,9 +56,10 @@ default: @echo " the EfiRom utility from edk2 / tianocore)" @echo " slof -- update slof.bin" -bios: build-seabios-config-seabios - cp seabios/builds/seabios/bios.bin ../pc-bios/bios.bin - cp seabios/builds/seabios/*dsdt.aml ../pc-bios/ +bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k + cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin + cp seabios/builds/seabios-256k/bios.bin ../pc-bios/bios-256k.bin + cp seabios/builds/seabios-256k/src/fw/*dsdt.aml ../pc-bios/ seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants)) diff --git a/roms/config.seabios b/roms/config.seabios deleted file mode 100644 index c373b87a98..0000000000 --- a/roms/config.seabios +++ /dev/null @@ -1 +0,0 @@ -# empty, default config works for us diff --git a/roms/config.seabios-128k b/roms/config.seabios-128k new file mode 100644 index 0000000000..41f83816fc --- /dev/null +++ b/roms/config.seabios-128k @@ -0,0 +1,6 @@ +# for qemu machine types 1.7 + older +# need to turn off features (xhci) to make it fit into 128k +CONFIG_QEMU=y +CONFIG_ROM_SIZE=128 +CONFIG_XEN=n +CONFIG_USB_XHCI=n diff --git a/roms/config.seabios-256k b/roms/config.seabios-256k new file mode 100644 index 0000000000..65e5015c2f --- /dev/null +++ b/roms/config.seabios-256k @@ -0,0 +1,3 @@ +# for qemu machine types 2.0 + newer +CONFIG_QEMU=y +CONFIG_ROM_SIZE=256 -- cgit v1.2.1 From 07403a5a0319d1c9783ea7da13782c8835a42cc9 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 15 Oct 2013 17:05:55 +0200 Subject: roms: enable seabios cross builds Signed-off-by: Gerd Hoffmann --- roms/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roms/Makefile b/roms/Makefile index fc716c1b10..1e04669af4 100644 --- a/roms/Makefile +++ b/roms/Makefile @@ -73,9 +73,11 @@ build-seabios-config-%: config.% mkdir -p seabios/builds/$* cp $< seabios/builds/$*/.config $(MAKE) $(MAKEFLAGS) -C seabios \ + CROSS_COMPILE=$(x86_64_cross_prefix) \ KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \ OUT=$(CURDIR)/seabios/builds/$*/ oldnoconfig $(MAKE) $(MAKEFLAGS) -C seabios \ + CROSS_COMPILE=$(x86_64_cross_prefix) \ KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \ OUT=$(CURDIR)/seabios/builds/$*/ all -- cgit v1.2.1 From 385724e7887670e17865d97cd8106a235f113faa Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 2 Dec 2013 12:58:45 +0100 Subject: roms: update seabios binaries Signed-off-by: Gerd Hoffmann --- pc-bios/acpi-dsdt.aml | Bin 4407 -> 4407 bytes pc-bios/bios-256k.bin | Bin 0 -> 262144 bytes pc-bios/bios.bin | Bin 131072 -> 131072 bytes pc-bios/q35-acpi-dsdt.aml | Bin 7344 -> 7344 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 pc-bios/bios-256k.bin diff --git a/pc-bios/acpi-dsdt.aml b/pc-bios/acpi-dsdt.aml index 528372b41e..cfd16d756e 100644 Binary files a/pc-bios/acpi-dsdt.aml and b/pc-bios/acpi-dsdt.aml differ diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin new file mode 100644 index 0000000000..68017e59ce Binary files /dev/null and b/pc-bios/bios-256k.bin differ diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin index 697440c26c..4f4383b06a 100644 Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ diff --git a/pc-bios/q35-acpi-dsdt.aml b/pc-bios/q35-acpi-dsdt.aml index 4d23746ebf..d71b3a328c 100644 Binary files a/pc-bios/q35-acpi-dsdt.aml and b/pc-bios/q35-acpi-dsdt.aml differ -- cgit v1.2.1 From 6eefccc0bb9c34051b1e21880fc3a1c1c8686edd Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 2 Dec 2013 13:01:20 +0100 Subject: roms: update vgabios binaries This also switches from lgplvgabios to seavgabios. Signed-off-by: Gerd Hoffmann --- pc-bios/vgabios-cirrus.bin | Bin 35840 -> 36864 bytes pc-bios/vgabios-qxl.bin | Bin 40448 -> 37376 bytes pc-bios/vgabios-stdvga.bin | Bin 40448 -> 37376 bytes pc-bios/vgabios-vmware.bin | Bin 40448 -> 37376 bytes pc-bios/vgabios.bin | Bin 40448 -> 36864 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin index 424dd0c70c..36b197d190 100644 Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin index 3156c6e3f1..aaa3b10c7c 100644 Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin index 5123c5fd07..d329e240f9 100644 Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin index 5e8c06b228..31d56a94d0 100644 Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin index 892a2b5374..b87f74de7c 100644 Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ -- cgit v1.2.1 From bcf2b7d2af7c54bb42be1229df9e78ba7d08d2a7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 2 Dec 2013 12:52:04 +0100 Subject: pc: switch 2.0 machine types to large seabios binary Signed-off-by: Gerd Hoffmann --- hw/i386/pc_piix.c | 4 +++- hw/i386/pc_q35.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9329f04b09..ab562853b8 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -339,7 +339,9 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args) .desc = "Standard PC (i440FX + PIIX, 1996)", \ .hot_add_cpu = pc_hot_add_cpu -#define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS +#define PC_I440FX_2_0_MACHINE_OPTIONS \ + PC_I440FX_MACHINE_OPTIONS, \ + .default_machine_opts = "firmware=bios-256k.bin" static QEMUMachine pc_i440fx_machine_v2_0 = { PC_I440FX_2_0_MACHINE_OPTIONS, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index ac69e5d20b..97aa84264c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -259,7 +259,9 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args) .desc = "Standard PC (Q35 + ICH9, 2009)", \ .hot_add_cpu = pc_hot_add_cpu -#define PC_Q35_2_0_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS +#define PC_Q35_2_0_MACHINE_OPTIONS \ + PC_Q35_MACHINE_OPTIONS, \ + .default_machine_opts = "firmware=bios-256k.bin" static QEMUMachine pc_q35_machine_v2_0 = { PC_Q35_2_0_MACHINE_OPTIONS, -- cgit v1.2.1