2 * QEMU PC System Emulator
4 * Copyright (c) 2003-2004 Fabrice Bellard
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28 #include "hw/loader.h"
29 #include "hw/i386/pc.h"
30 #include "hw/i386/apic.h"
31 #include "hw/i386/smbios.h"
32 #include "hw/pci/pci.h"
33 #include "hw/pci/pci_ids.h"
36 #include "hw/boards.h"
38 #include "sysemu/kvm.h"
39 #include "hw/kvm/clock.h"
40 #include "sysemu/sysemu.h"
41 #include "hw/sysbus.h"
42 #include "hw/cpu/icc_bus.h"
43 #include "sysemu/arch_init.h"
44 #include "sysemu/block-backend.h"
45 #include "hw/i2c/smbus.h"
46 #include "hw/xen/xen.h"
47 #include "exec/memory.h"
48 #include "exec/address-spaces.h"
49 #include "hw/acpi/acpi.h"
51 #include "qemu/error-report.h"
53 # include <xen/hvm/hvm_info_table.h>
58 static const int ide_iobase
[MAX_IDE_BUS
] = { 0x1f0, 0x170 };
59 static const int ide_iobase2
[MAX_IDE_BUS
] = { 0x3f6, 0x376 };
60 static const int ide_irq
[MAX_IDE_BUS
] = { 14, 15 };
62 static bool has_acpi_build
= true;
63 static int legacy_acpi_table_size
;
64 static bool smbios_defaults
= true;
65 static bool smbios_legacy_mode
;
66 /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
67 * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
70 static bool gigabyte_align
= true;
71 static bool has_reserved_memory
= true;
73 /* PC hardware initialisation */
74 static void pc_init1(MachineState
*machine
,
78 PCMachineState
*pc_machine
= PC_MACHINE(machine
);
79 MemoryRegion
*system_memory
= get_system_memory();
80 MemoryRegion
*system_io
= get_system_io();
82 ram_addr_t below_4g_mem_size
, above_4g_mem_size
;
85 PCII440FXState
*i440fx_state
;
92 DriveInfo
*hd
[MAX_IDE_BUS
* MAX_IDE_DEVS
];
93 BusState
*idebus
[MAX_IDE_BUS
];
96 MemoryRegion
*ram_memory
;
97 MemoryRegion
*pci_memory
;
98 MemoryRegion
*rom_memory
;
99 DeviceState
*icc_bridge
;
100 FWCfgState
*fw_cfg
= NULL
;
101 PcGuestInfo
*guest_info
;
104 /* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory).
105 * If it doesn't, we need to split it in chunks below and above 4G.
106 * In any case, try to make sure that guest addresses aligned at
107 * 1G boundaries get mapped to host addresses aligned at 1G boundaries.
108 * For old machine types, use whatever split we used historically to avoid
109 * breaking migration.
111 if (machine
->ram_size
>= 0xe0000000) {
112 lowmem
= gigabyte_align
? 0xc0000000 : 0xe0000000;
117 /* Handle the machine opt max-ram-below-4g. It is basically doing
118 * min(qemu limit, user limit).
120 if (lowmem
> pc_machine
->max_ram_below_4g
) {
121 lowmem
= pc_machine
->max_ram_below_4g
;
122 if (machine
->ram_size
- lowmem
> lowmem
&&
123 lowmem
& ((1ULL << 30) - 1)) {
124 error_report("Warning: Large machine and max_ram_below_4g(%"PRIu64
125 ") not a multiple of 1G; possible bad performance.",
126 pc_machine
->max_ram_below_4g
);
130 if (machine
->ram_size
>= lowmem
) {
131 above_4g_mem_size
= machine
->ram_size
- lowmem
;
132 below_4g_mem_size
= lowmem
;
134 above_4g_mem_size
= 0;
135 below_4g_mem_size
= machine
->ram_size
;
138 if (xen_enabled() && xen_hvm_init(&below_4g_mem_size
, &above_4g_mem_size
,
140 fprintf(stderr
, "xen hardware virtual machine initialisation failed\n");
144 icc_bridge
= qdev_create(NULL
, TYPE_ICC_BRIDGE
);
145 object_property_add_child(qdev_get_machine(), "icc-bridge",
146 OBJECT(icc_bridge
), NULL
);
148 pc_cpus_init(machine
->cpu_model
, icc_bridge
);
150 if (kvm_enabled() && kvmclock_enabled
) {
155 pci_memory
= g_new(MemoryRegion
, 1);
156 memory_region_init(pci_memory
, NULL
, "pci", UINT64_MAX
);
157 rom_memory
= pci_memory
;
160 rom_memory
= system_memory
;
163 guest_info
= pc_guest_info_init(below_4g_mem_size
, above_4g_mem_size
);
165 guest_info
->has_acpi_build
= has_acpi_build
;
166 guest_info
->legacy_acpi_table_size
= legacy_acpi_table_size
;
168 guest_info
->isapc_ram_fw
= !pci_enabled
;
169 guest_info
->has_reserved_memory
= has_reserved_memory
;
171 if (smbios_defaults
) {
172 MachineClass
*mc
= MACHINE_GET_CLASS(machine
);
173 /* These values are guest ABI, do not change */
174 smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
175 mc
->name
, smbios_legacy_mode
);
178 /* allocate ram and load rom/bios */
179 if (!xen_enabled()) {
180 fw_cfg
= pc_memory_init(machine
, system_memory
,
181 below_4g_mem_size
, above_4g_mem_size
,
182 rom_memory
, &ram_memory
, guest_info
);
183 } else if (machine
->kernel_filename
!= NULL
) {
184 /* For xen HVM direct kernel boot, load linux here */
185 fw_cfg
= xen_load_linux(machine
->kernel_filename
,
186 machine
->kernel_cmdline
,
187 machine
->initrd_filename
,
192 gsi_state
= g_malloc0(sizeof(*gsi_state
));
193 if (kvm_irqchip_in_kernel()) {
194 kvm_pc_setup_irq_routing(pci_enabled
);
195 gsi
= qemu_allocate_irqs(kvm_pc_gsi_handler
, gsi_state
,
198 gsi
= qemu_allocate_irqs(gsi_handler
, gsi_state
, GSI_NUM_PINS
);
202 pci_bus
= i440fx_init(&i440fx_state
, &piix3_devfn
, &isa_bus
, gsi
,
203 system_memory
, system_io
, machine
->ram_size
,
206 pci_memory
, ram_memory
);
210 isa_bus
= isa_bus_new(NULL
, system_io
);
213 isa_bus_irqs(isa_bus
, gsi
);
215 if (kvm_irqchip_in_kernel()) {
216 i8259
= kvm_i8259_init(isa_bus
);
217 } else if (xen_enabled()) {
218 i8259
= xen_interrupt_controller_init();
220 cpu_irq
= pc_allocate_cpu_irq();
221 i8259
= i8259_init(isa_bus
, cpu_irq
[0]);
224 for (i
= 0; i
< ISA_NUM_IRQS
; i
++) {
225 gsi_state
->i8259_irq
[i
] = i8259
[i
];
228 ioapic_init_gsi(gsi_state
, "i440fx");
230 qdev_init_nofail(icc_bridge
);
232 pc_register_ferr_irq(gsi
[13]);
234 pc_vga_init(isa_bus
, pci_enabled
? pci_bus
: NULL
);
236 /* init basic PC hardware */
237 pc_basic_device_init(isa_bus
, gsi
, &rtc_state
, &floppy
,
238 !pc_machine
->vmport
, 0x4);
240 pc_nic_init(isa_bus
, pci_bus
);
242 ide_drive_get(hd
, ARRAY_SIZE(hd
));
246 dev
= pci_piix3_xen_ide_init(pci_bus
, hd
, piix3_devfn
+ 1);
248 dev
= pci_piix3_ide_init(pci_bus
, hd
, piix3_devfn
+ 1);
250 idebus
[0] = qdev_get_child_bus(&dev
->qdev
, "ide.0");
251 idebus
[1] = qdev_get_child_bus(&dev
->qdev
, "ide.1");
253 for(i
= 0; i
< MAX_IDE_BUS
; i
++) {
255 char busname
[] = "ide.0";
256 dev
= isa_ide_init(isa_bus
, ide_iobase
[i
], ide_iobase2
[i
],
258 hd
[MAX_IDE_DEVS
* i
], hd
[MAX_IDE_DEVS
* i
+ 1]);
260 * The ide bus name is ide.0 for the first bus and ide.1 for the
263 busname
[4] = '0' + i
;
264 idebus
[i
] = qdev_get_child_bus(DEVICE(dev
), busname
);
268 pc_cmos_init(below_4g_mem_size
, above_4g_mem_size
, machine
->boot_order
,
269 floppy
, idebus
[0], idebus
[1], rtc_state
);
271 if (pci_enabled
&& usb_enabled(false)) {
272 pci_create_simple(pci_bus
, piix3_devfn
+ 2, "piix3-usb-uhci");
275 if (pci_enabled
&& acpi_enabled
) {
276 DeviceState
*piix4_pm
;
279 smi_irq
= qemu_allocate_irqs(pc_acpi_smi_interrupt
, first_cpu
, 1);
280 /* TODO: Populate SPD eeprom data. */
281 smbus
= piix4_pm_init(pci_bus
, piix3_devfn
+ 3, 0xb100,
283 kvm_enabled(), fw_cfg
, &piix4_pm
);
284 smbus_eeprom_init(smbus
, 8, NULL
, 0);
286 object_property_add_link(OBJECT(machine
), PC_MACHINE_ACPI_DEVICE_PROP
,
287 TYPE_HOTPLUG_HANDLER
,
288 (Object
**)&pc_machine
->acpi_dev
,
289 object_property_allow_set_link
,
290 OBJ_PROP_LINK_UNREF_ON_RELEASE
, &error_abort
);
291 object_property_set_link(OBJECT(machine
), OBJECT(piix4_pm
),
292 PC_MACHINE_ACPI_DEVICE_PROP
, &error_abort
);
296 pc_pci_device_init(pci_bus
);
300 static void pc_init_pci(MachineState
*machine
)
302 pc_init1(machine
, 1, 1);
305 static void pc_compat_2_1(MachineState
*machine
)
309 static void pc_compat_2_0(MachineState
*machine
)
311 pc_compat_2_1(machine
);
312 /* This value depends on the actual DSDT and SSDT compiled into
313 * the source QEMU; unfortunately it depends on the binary and
314 * not on the machine type, so we cannot make pc-i440fx-1.7 work on
315 * both QEMU 1.7 and QEMU 2.0.
317 * Large variations cause migration to fail for more than one
318 * consecutive value of the "-smp" maxcpus option.
320 * For small variations of the kind caused by different iasl versions,
321 * the 4k rounding usually leaves slack. However, there could be still
322 * one or two values that break. For QEMU 1.7 and QEMU 2.0 the
323 * slack is only ~10 bytes before one "-smp maxcpus" value breaks!
325 * 6652 is valid for QEMU 2.0, the right value for pc-i440fx-1.7 on
326 * QEMU 1.7 it is 6414. For RHEL/CentOS 7.0 it is 6418.
328 legacy_acpi_table_size
= 6652;
329 smbios_legacy_mode
= true;
330 has_reserved_memory
= false;
331 pc_set_legacy_acpi_data_size();
334 static void pc_compat_1_7(MachineState
*machine
)
336 pc_compat_2_0(machine
);
337 smbios_defaults
= false;
338 gigabyte_align
= false;
339 option_rom_has_mr
= true;
340 legacy_acpi_table_size
= 6414;
341 x86_cpu_compat_disable_kvm_features(FEAT_1_ECX
, CPUID_EXT_X2APIC
);
344 static void pc_compat_1_6(MachineState
*machine
)
346 pc_compat_1_7(machine
);
347 rom_file_has_mr
= false;
348 has_acpi_build
= false;
351 static void pc_compat_1_5(MachineState
*machine
)
353 pc_compat_1_6(machine
);
356 static void pc_compat_1_4(MachineState
*machine
)
358 pc_compat_1_5(machine
);
359 x86_cpu_compat_set_features("n270", FEAT_1_ECX
, 0, CPUID_EXT_MOVBE
);
360 x86_cpu_compat_set_features("Westmere", FEAT_1_ECX
, 0, CPUID_EXT_PCLMULQDQ
);
363 static void pc_compat_1_3(MachineState
*machine
)
365 pc_compat_1_4(machine
);
366 enable_compat_apic_id_mode();
369 /* PC compat function for pc-0.14 to pc-1.2 */
370 static void pc_compat_1_2(MachineState
*machine
)
372 pc_compat_1_3(machine
);
373 x86_cpu_compat_disable_kvm_features(FEAT_KVM
, KVM_FEATURE_PV_EOI
);
376 static void pc_init_pci_2_1(MachineState
*machine
)
378 pc_compat_2_1(machine
);
379 pc_init_pci(machine
);
382 static void pc_init_pci_2_0(MachineState
*machine
)
384 pc_compat_2_0(machine
);
385 pc_init_pci(machine
);
388 static void pc_init_pci_1_7(MachineState
*machine
)
390 pc_compat_1_7(machine
);
391 pc_init_pci(machine
);
394 static void pc_init_pci_1_6(MachineState
*machine
)
396 pc_compat_1_6(machine
);
397 pc_init_pci(machine
);
400 static void pc_init_pci_1_5(MachineState
*machine
)
402 pc_compat_1_5(machine
);
403 pc_init_pci(machine
);
406 static void pc_init_pci_1_4(MachineState
*machine
)
408 pc_compat_1_4(machine
);
409 pc_init_pci(machine
);
412 static void pc_init_pci_1_3(MachineState
*machine
)
414 pc_compat_1_3(machine
);
415 pc_init_pci(machine
);
418 /* PC machine init function for pc-0.14 to pc-1.2 */
419 static void pc_init_pci_1_2(MachineState
*machine
)
421 pc_compat_1_2(machine
);
422 pc_init_pci(machine
);
425 /* PC init function for pc-0.10 to pc-0.13 */
426 static void pc_init_pci_no_kvmclock(MachineState
*machine
)
428 pc_compat_1_2(machine
);
429 pc_init1(machine
, 1, 0);
432 static void pc_init_isa(MachineState
*machine
)
434 has_acpi_build
= false;
435 smbios_defaults
= false;
436 gigabyte_align
= false;
437 smbios_legacy_mode
= true;
438 has_reserved_memory
= false;
439 option_rom_has_mr
= true;
440 rom_file_has_mr
= false;
441 if (!machine
->cpu_model
) {
442 machine
->cpu_model
= "486";
444 x86_cpu_compat_disable_kvm_features(FEAT_KVM
, KVM_FEATURE_PV_EOI
);
445 enable_compat_apic_id_mode();
446 pc_init1(machine
, 0, 1);
450 static void pc_xen_hvm_init(MachineState
*machine
)
454 pc_init_pci(machine
);
456 bus
= pci_find_primary_bus();
458 pci_create_simple(bus
, -1, "xen-platform");
463 #define PC_I440FX_MACHINE_OPTIONS \
464 PC_DEFAULT_MACHINE_OPTIONS, \
465 .desc = "Standard PC (i440FX + PIIX, 1996)", \
466 .hot_add_cpu = pc_hot_add_cpu
468 #define PC_I440FX_2_2_MACHINE_OPTIONS \
469 PC_I440FX_MACHINE_OPTIONS, \
470 .default_machine_opts = "firmware=bios-256k.bin"
472 static QEMUMachine pc_i440fx_machine_v2_2
= {
473 PC_I440FX_2_2_MACHINE_OPTIONS
,
474 .name
= "pc-i440fx-2.2",
480 #define PC_I440FX_2_1_MACHINE_OPTIONS PC_I440FX_2_2_MACHINE_OPTIONS
482 static QEMUMachine pc_i440fx_machine_v2_1
= {
483 PC_I440FX_2_1_MACHINE_OPTIONS
,
484 .name
= "pc-i440fx-2.1",
485 .init
= pc_init_pci_2_1
,
486 .compat_props
= (GlobalProperty
[]) {
488 { /* end of list */ }
492 #define PC_I440FX_2_0_MACHINE_OPTIONS PC_I440FX_2_1_MACHINE_OPTIONS
494 static QEMUMachine pc_i440fx_machine_v2_0
= {
495 PC_I440FX_2_0_MACHINE_OPTIONS
,
496 .name
= "pc-i440fx-2.0",
497 .init
= pc_init_pci_2_0
,
498 .compat_props
= (GlobalProperty
[]) {
500 { /* end of list */ }
504 #define PC_I440FX_1_7_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
506 static QEMUMachine pc_i440fx_machine_v1_7
= {
507 PC_I440FX_1_7_MACHINE_OPTIONS
,
508 .name
= "pc-i440fx-1.7",
509 .init
= pc_init_pci_1_7
,
510 .compat_props
= (GlobalProperty
[]) {
512 { /* end of list */ }
516 #define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS
518 static QEMUMachine pc_i440fx_machine_v1_6
= {
519 PC_I440FX_1_6_MACHINE_OPTIONS
,
520 .name
= "pc-i440fx-1.6",
521 .init
= pc_init_pci_1_6
,
522 .compat_props
= (GlobalProperty
[]) {
524 { /* end of list */ }
528 static QEMUMachine pc_i440fx_machine_v1_5
= {
529 PC_I440FX_1_6_MACHINE_OPTIONS
,
530 .name
= "pc-i440fx-1.5",
531 .init
= pc_init_pci_1_5
,
532 .compat_props
= (GlobalProperty
[]) {
534 { /* end of list */ }
538 #define PC_I440FX_1_4_MACHINE_OPTIONS \
539 PC_I440FX_1_6_MACHINE_OPTIONS, \
542 static QEMUMachine pc_i440fx_machine_v1_4
= {
543 PC_I440FX_1_4_MACHINE_OPTIONS
,
544 .name
= "pc-i440fx-1.4",
545 .init
= pc_init_pci_1_4
,
546 .compat_props
= (GlobalProperty
[]) {
548 { /* end of list */ }
552 #define PC_COMPAT_1_3 \
555 .driver = "usb-tablet",\
556 .property = "usb_version",\
557 .value = stringify(1),\
559 .driver = "virtio-net-pci",\
560 .property = "ctrl_mac_addr",\
563 .driver = "virtio-net-pci", \
568 .property = "autonegotiation",\
572 static QEMUMachine pc_machine_v1_3
= {
573 PC_I440FX_1_4_MACHINE_OPTIONS
,
575 .init
= pc_init_pci_1_3
,
576 .compat_props
= (GlobalProperty
[]) {
578 { /* end of list */ }
582 #define PC_COMPAT_1_2 \
585 .driver = "nec-usb-xhci",\
589 .driver = "nec-usb-xhci",\
593 .driver = "ivshmem",\
594 .property = "use64",\
598 .property = "revision",\
599 .value = stringify(3),\
601 .driver = "qxl-vga",\
602 .property = "revision",\
603 .value = stringify(3),\
610 #define PC_I440FX_1_2_MACHINE_OPTIONS \
611 PC_I440FX_1_4_MACHINE_OPTIONS, \
612 .init = pc_init_pci_1_2
614 static QEMUMachine pc_machine_v1_2
= {
615 PC_I440FX_1_2_MACHINE_OPTIONS
,
617 .compat_props
= (GlobalProperty
[]) {
619 { /* end of list */ }
623 #define PC_COMPAT_1_1 \
626 .driver = "virtio-scsi-pci",\
627 .property = "hotplug",\
630 .driver = "virtio-scsi-pci",\
631 .property = "param_change",\
635 .property = "vgamem_mb",\
636 .value = stringify(8),\
638 .driver = "vmware-svga",\
639 .property = "vgamem_mb",\
640 .value = stringify(8),\
642 .driver = "qxl-vga",\
643 .property = "vgamem_mb",\
644 .value = stringify(8),\
647 .property = "vgamem_mb",\
648 .value = stringify(8),\
650 .driver = "virtio-blk-pci",\
651 .property = "config-wce",\
655 static QEMUMachine pc_machine_v1_1
= {
656 PC_I440FX_1_2_MACHINE_OPTIONS
,
658 .compat_props
= (GlobalProperty
[]) {
660 { /* end of list */ }
664 #define PC_COMPAT_1_0 \
667 .driver = TYPE_ISA_FDC,\
668 .property = "check_media_rate",\
671 .driver = "virtio-balloon-pci",\
672 .property = "class",\
673 .value = stringify(PCI_CLASS_MEMORY_RAM),\
676 .property = "vapic",\
679 .driver = TYPE_USB_DEVICE,\
680 .property = "full-path",\
684 static QEMUMachine pc_machine_v1_0
= {
685 PC_I440FX_1_2_MACHINE_OPTIONS
,
687 .compat_props
= (GlobalProperty
[]) {
689 { /* end of list */ }
694 #define PC_COMPAT_0_15 \
697 static QEMUMachine pc_machine_v0_15
= {
698 PC_I440FX_1_2_MACHINE_OPTIONS
,
700 .compat_props
= (GlobalProperty
[]) {
702 { /* end of list */ }
704 .hw_version
= "0.15",
707 #define PC_COMPAT_0_14 \
710 .driver = "virtio-blk-pci",\
711 .property = "event_idx",\
714 .driver = "virtio-serial-pci",\
715 .property = "event_idx",\
718 .driver = "virtio-net-pci",\
719 .property = "event_idx",\
722 .driver = "virtio-balloon-pci",\
723 .property = "event_idx",\
727 static QEMUMachine pc_machine_v0_14
= {
728 PC_I440FX_1_2_MACHINE_OPTIONS
,
730 .compat_props
= (GlobalProperty
[]) {
734 .property
= "revision",
735 .value
= stringify(2),
738 .property
= "revision",
739 .value
= stringify(2),
741 { /* end of list */ }
743 .hw_version
= "0.14",
746 #define PC_COMPAT_0_13 \
749 .driver = TYPE_PCI_DEVICE,\
750 .property = "command_serr_enable",\
754 .property = "use_broken_id",\
755 .value = stringify(1),\
758 #define PC_I440FX_0_13_MACHINE_OPTIONS \
759 PC_I440FX_1_2_MACHINE_OPTIONS, \
760 .init = pc_init_pci_no_kvmclock
762 static QEMUMachine pc_machine_v0_13
= {
763 PC_I440FX_0_13_MACHINE_OPTIONS
,
765 .compat_props
= (GlobalProperty
[]) {
768 .driver
= "virtio-9p-pci",
769 .property
= "vectors",
770 .value
= stringify(0),
773 .property
= "rombar",
774 .value
= stringify(0),
776 .driver
= "vmware-svga",
777 .property
= "rombar",
778 .value
= stringify(0),
780 { /* end of list */ }
782 .hw_version
= "0.13",
785 #define PC_COMPAT_0_12 \
788 .driver = "virtio-serial-pci",\
789 .property = "max_ports",\
790 .value = stringify(1),\
792 .driver = "virtio-serial-pci",\
793 .property = "vectors",\
794 .value = stringify(0),\
796 .driver = "usb-mouse",\
797 .property = "serial",\
800 .driver = "usb-tablet",\
801 .property = "serial",\
804 .driver = "usb-kbd",\
805 .property = "serial",\
809 static QEMUMachine pc_machine_v0_12
= {
810 PC_I440FX_0_13_MACHINE_OPTIONS
,
812 .compat_props
= (GlobalProperty
[]) {
816 .property
= "rombar",
817 .value
= stringify(0),
819 .driver
= "vmware-svga",
820 .property
= "rombar",
821 .value
= stringify(0),
823 { /* end of list */ }
825 .hw_version
= "0.12",
828 #define PC_COMPAT_0_11 \
831 .driver = "virtio-blk-pci",\
832 .property = "vectors",\
833 .value = stringify(0),\
835 .driver = TYPE_PCI_DEVICE,\
836 .property = "rombar",\
837 .value = stringify(0),\
840 static QEMUMachine pc_machine_v0_11
= {
841 PC_I440FX_0_13_MACHINE_OPTIONS
,
843 .compat_props
= (GlobalProperty
[]) {
846 .driver
= "ide-drive",
850 .driver
= "scsi-disk",
854 { /* end of list */ }
856 .hw_version
= "0.11",
859 static QEMUMachine pc_machine_v0_10
= {
860 PC_I440FX_0_13_MACHINE_OPTIONS
,
862 .compat_props
= (GlobalProperty
[]) {
865 .driver
= "virtio-blk-pci",
867 .value
= stringify(PCI_CLASS_STORAGE_OTHER
),
869 .driver
= "virtio-serial-pci",
871 .value
= stringify(PCI_CLASS_DISPLAY_OTHER
),
873 .driver
= "virtio-net-pci",
874 .property
= "vectors",
875 .value
= stringify(0),
877 .driver
= "ide-drive",
881 .driver
= "scsi-disk",
885 { /* end of list */ }
887 .hw_version
= "0.10",
890 static QEMUMachine isapc_machine
= {
891 PC_COMMON_MACHINE_OPTIONS
,
893 .desc
= "ISA-only PC",
896 .compat_props
= (GlobalProperty
[]) {
897 { /* end of list */ }
902 static QEMUMachine xenfv_machine
= {
903 PC_COMMON_MACHINE_OPTIONS
,
905 .desc
= "Xen Fully-virtualized PC",
906 .init
= pc_xen_hvm_init
,
907 .max_cpus
= HVM_MAX_VCPUS
,
908 .default_machine_opts
= "accel=xen",
909 .hot_add_cpu
= pc_hot_add_cpu
,
910 .compat_props
= (GlobalProperty
[]) {
911 /* xenfv has no fwcfg and so does not load acpi from QEMU.
912 * as such new acpi features don't work.
915 .driver
= "PIIX4_PM",
916 .property
= "acpi-pci-hotplug-with-bridge-support",
919 { /* end of list */ }
924 static void pc_machine_init(void)
926 qemu_register_pc_machine(&pc_i440fx_machine_v2_2
);
927 qemu_register_pc_machine(&pc_i440fx_machine_v2_1
);
928 qemu_register_pc_machine(&pc_i440fx_machine_v2_0
);
929 qemu_register_pc_machine(&pc_i440fx_machine_v1_7
);
930 qemu_register_pc_machine(&pc_i440fx_machine_v1_6
);
931 qemu_register_pc_machine(&pc_i440fx_machine_v1_5
);
932 qemu_register_pc_machine(&pc_i440fx_machine_v1_4
);
933 qemu_register_pc_machine(&pc_machine_v1_3
);
934 qemu_register_pc_machine(&pc_machine_v1_2
);
935 qemu_register_pc_machine(&pc_machine_v1_1
);
936 qemu_register_pc_machine(&pc_machine_v1_0
);
937 qemu_register_pc_machine(&pc_machine_v0_15
);
938 qemu_register_pc_machine(&pc_machine_v0_14
);
939 qemu_register_pc_machine(&pc_machine_v0_13
);
940 qemu_register_pc_machine(&pc_machine_v0_12
);
941 qemu_register_pc_machine(&pc_machine_v0_11
);
942 qemu_register_pc_machine(&pc_machine_v0_10
);
943 qemu_register_pc_machine(&isapc_machine
);
945 qemu_register_pc_machine(&xenfv_machine
);
949 machine_init(pc_machine_init
);