4 #include "qemu-common.h"
5 #include "exec/memory.h"
7 #include "hw/isa/isa.h"
8 #include "hw/block/fdc.h"
10 #include "hw/i386/ioapic.h"
12 #include "qemu/range.h"
13 #include "qemu/bitmap.h"
14 #include "sysemu/sysemu.h"
15 #include "hw/pci/pci.h"
16 #include "hw/compat.h"
17 #include "hw/mem/pc-dimm.h"
18 #include "hw/mem/nvdimm.h"
19 #include "hw/acpi/acpi_dev_interface.h"
21 #define HPET_INTCAP "hpet-intcap"
25 * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
26 * @boot_cpus: number of present VCPUs
28 struct PCMachineState
{
30 MachineState parent_obj
;
34 /* State for other subsystems/APIs: */
35 MemoryHotplugState hotplug_memory
;
36 Notifier machine_done
;
38 /* Pointers to devices and objects: */
39 HotplugHandler
*acpi_dev
;
45 /* Configuration options: */
46 uint64_t max_ram_below_4g
;
50 AcpiNVDIMMState acpi_nvdimm_state
;
52 bool acpi_build_enabled
;
57 /* RAM information (sizes, addresses, configuration): */
58 ram_addr_t below_4g_mem_size
, above_4g_mem_size
;
60 /* CPU and apic information: */
61 bool apic_xrupt_override
;
62 unsigned apic_id_limit
;
65 /* NUMA information: */
69 /* Address space used by IOAPIC device. All IOAPIC interrupts
70 * will be translated to MSI messages in the address space. */
71 AddressSpace
*ioapic_as
;
74 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
75 #define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
76 #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
77 #define PC_MACHINE_VMPORT "vmport"
78 #define PC_MACHINE_SMM "smm"
79 #define PC_MACHINE_NVDIMM "nvdimm"
80 #define PC_MACHINE_SMBUS "smbus"
81 #define PC_MACHINE_SATA "sata"
82 #define PC_MACHINE_PIT "pit"
89 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
93 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
94 * backend's alignment value if provided
95 * @acpi_data_size: Size of the chunk of memory at the top of RAM
96 * for the BIOS ACPI tables and other BIOS
98 * @gigabyte_align: Make sure that guest addresses aligned at
99 * 1Gbyte boundaries get mapped to host
100 * addresses aligned at 1Gbyte boundaries. This
101 * way we can use 1GByte pages in the host.
104 struct PCMachineClass
{
106 MachineClass parent_class
;
111 HotplugHandler
*(*get_hotplug_handler
)(MachineState
*machine
,
114 /* Device configuration: */
116 bool kvmclock_enabled
;
118 /* Compat options: */
123 int legacy_acpi_table_size
;
124 unsigned acpi_data_size
;
127 bool smbios_defaults
;
128 bool smbios_legacy_mode
;
129 bool smbios_uuid_encoded
;
131 /* RAM / address space compat: */
133 bool has_reserved_memory
;
134 bool enforce_aligned_dimm
;
135 bool broken_reserved_end
;
137 /* TSC rate migration: */
139 /* generate legacy CPU hotplug AML */
140 bool legacy_cpu_hotplug
;
142 /* use DMA capable linuxboot option rom */
143 bool linuxboot_dma_enabled
;
146 #define TYPE_PC_MACHINE "generic-pc-machine"
147 #define PC_MACHINE(obj) \
148 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
149 #define PC_MACHINE_GET_CLASS(obj) \
150 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
151 #define PC_MACHINE_CLASS(klass) \
152 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
154 /* PC-style peripherals (also used by other machines). */
156 #define ACPI_PM_PROP_S3_DISABLED "disable_s3"
157 #define ACPI_PM_PROP_S4_DISABLED "disable_s4"
158 #define ACPI_PM_PROP_S4_VAL "s4_val"
159 #define ACPI_PM_PROP_SCI_INT "sci_int"
160 #define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
161 #define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
162 #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
163 #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
164 #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
165 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
169 void parallel_hds_isa_init(ISABus
*bus
, int n
);
171 bool parallel_mm_init(MemoryRegion
*address_space
,
172 hwaddr base
, int it_shift
, qemu_irq irq
,
177 extern DeviceState
*isa_pic
;
178 qemu_irq
*i8259_init(ISABus
*bus
, qemu_irq parent_irq
);
179 qemu_irq
*kvm_i8259_init(ISABus
*bus
);
180 int pic_read_irq(DeviceState
*d
);
181 int pic_get_output(DeviceState
*d
);
185 void kvm_ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
186 void ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
188 /* Global System Interrupts */
190 #define GSI_NUM_PINS IOAPIC_NUM_PINS
192 typedef struct GSIState
{
193 qemu_irq i8259_irq
[ISA_NUM_IRQS
];
194 qemu_irq ioapic_irq
[IOAPIC_NUM_PINS
];
197 void gsi_handler(void *opaque
, int n
, int level
);
200 #define TYPE_VMPORT "vmport"
201 typedef uint32_t (VMPortReadFunc
)(void *opaque
, uint32_t address
);
203 static inline void vmport_init(ISABus
*bus
)
205 isa_create_simple(bus
, TYPE_VMPORT
);
208 void vmport_register(unsigned char command
, VMPortReadFunc
*func
, void *opaque
);
209 void vmmouse_get_data(uint32_t *data
);
210 void vmmouse_set_data(const uint32_t *data
);
213 #define I8042_A20_LINE "a20"
215 void i8042_mm_init(qemu_irq kbd_irq
, qemu_irq mouse_irq
,
216 MemoryRegion
*region
, ram_addr_t size
,
218 void i8042_isa_mouse_fake_event(void *opaque
);
219 void i8042_setup_a20_line(ISADevice
*dev
, qemu_irq a20_out
);
222 extern int fd_bootchk
;
224 bool pc_machine_is_smm_enabled(PCMachineState
*pcms
);
225 void pc_register_ferr_irq(qemu_irq irq
);
226 void pc_acpi_smi_interrupt(void *opaque
, int irq
, int level
);
228 void pc_cpus_init(PCMachineState
*pcms
);
229 void pc_hot_add_cpu(const int64_t id
, Error
**errp
);
230 void pc_acpi_init(const char *default_dsdt
);
232 void pc_guest_info_init(PCMachineState
*pcms
);
234 #define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
235 #define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
236 #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
237 #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
238 #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
239 #define PCI_HOST_BELOW_4G_MEM_SIZE "below-4g-mem-size"
240 #define PCI_HOST_ABOVE_4G_MEM_SIZE "above-4g-mem-size"
243 void pc_pci_as_mapping_init(Object
*owner
, MemoryRegion
*system_memory
,
244 MemoryRegion
*pci_address_space
);
246 void xen_load_linux(PCMachineState
*pcms
);
247 void pc_memory_init(PCMachineState
*pcms
,
248 MemoryRegion
*system_memory
,
249 MemoryRegion
*rom_memory
,
250 MemoryRegion
**ram_memory
);
251 uint64_t pc_pci_hole64_start(void);
252 qemu_irq
pc_allocate_cpu_irq(void);
253 DeviceState
*pc_vga_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
254 void pc_basic_device_init(ISABus
*isa_bus
, qemu_irq
*gsi
,
255 ISADevice
**rtc_state
,
260 void pc_init_ne2k_isa(ISABus
*bus
, NICInfo
*nd
);
261 void pc_cmos_init(PCMachineState
*pcms
,
262 BusState
*ide0
, BusState
*ide1
,
264 void pc_nic_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
265 void pc_pci_device_init(PCIBus
*pci_bus
);
267 typedef void (*cpu_set_smm_t
)(int smm
, void *arg
);
269 void ioapic_init_gsi(GSIState
*gsi_state
, const char *parent_name
);
271 ISADevice
*pc_find_fdc0(void);
272 int cmos_get_fd_drive_type(FloppyDriveType fd0
);
274 #define FW_CFG_IO_BASE 0x510
276 #define PORT92_A20_LINE "a20"
280 I2CBus
*piix4_pm_init(PCIBus
*bus
, int devfn
, uint32_t smb_io_base
,
281 qemu_irq sci_irq
, qemu_irq smi_irq
,
282 int smm_enabled
, DeviceState
**piix4_pm
);
288 struct PCII440FXState
;
289 typedef struct PCII440FXState PCII440FXState
;
291 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
292 #define TYPE_I440FX_PCI_DEVICE "i440FX"
294 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
297 * Reset Control Register: PCI-accessible ISA-Compatible Register at address
298 * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000).
300 #define RCR_IOPORT 0xcf9
302 PCIBus
*i440fx_init(const char *host_type
, const char *pci_type
,
303 PCII440FXState
**pi440fx_state
, int *piix_devfn
,
304 ISABus
**isa_bus
, qemu_irq
*pic
,
305 MemoryRegion
*address_space_mem
,
306 MemoryRegion
*address_space_io
,
308 ram_addr_t below_4g_mem_size
,
309 ram_addr_t above_4g_mem_size
,
310 MemoryRegion
*pci_memory
,
311 MemoryRegion
*ram_memory
);
313 PCIBus
*find_i440fx(void);
315 extern PCIDevice
*piix4_dev
;
316 int piix4_init(PCIBus
*bus
, ISABus
**isa_bus
, int devfn
);
319 enum vga_retrace_method
{
324 extern enum vga_retrace_method vga_retrace_method
;
326 int isa_vga_mm_init(hwaddr vram_base
,
327 hwaddr ctrl_base
, int it_shift
,
328 MemoryRegion
*address_space
);
331 static inline bool isa_ne2000_init(ISABus
*bus
, int base
, int irq
, NICInfo
*nd
)
336 qemu_check_nic_model(nd
, "ne2k_isa");
338 isadev
= isa_try_create(bus
, "ne2k_isa");
342 dev
= DEVICE(isadev
);
343 qdev_prop_set_uint32(dev
, "iobase", base
);
344 qdev_prop_set_uint32(dev
, "irq", irq
);
345 qdev_set_nic_properties(dev
, nd
);
346 qdev_init_nofail(dev
);
351 void pc_system_firmware_init(MemoryRegion
*rom_memory
,
355 uint16_t pvpanic_port(void);
358 void pc_madt_cpu_entry(AcpiDeviceIf
*adev
, int uid
,
359 const CPUArchIdList
*apic_ids
, GArray
*entry
);
363 #define E820_RESERVED 2
366 #define E820_UNUSABLE 5
368 int e820_add_entry(uint64_t, uint64_t, uint32_t);
369 int e820_get_num_entries(void);
370 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
372 #define PC_COMPAT_2_10 \
375 .driver = TYPE_X86_CPU,\
376 .property = "x-hv-max-vps",\
379 .driver = "i440FX-pcihost",\
380 .property = "x-pci-hole64-fix",\
383 .driver = "q35-pcihost",\
384 .property = "x-pci-hole64-fix",\
388 #define PC_COMPAT_2_9 \
392 .property = "extended-tseg-mbytes",\
393 .value = stringify(0),\
396 #define PC_COMPAT_2_8 \
399 .driver = TYPE_X86_CPU,\
400 .property = "tcg-cpuid",\
404 .driver = "kvmclock",\
405 .property = "x-mach-use-reliable-get-clock",\
409 .driver = "ICH9-LPC",\
410 .property = "x-smi-broadcast",\
414 .driver = TYPE_X86_CPU,\
415 .property = "vmware-cpuid-freq",\
419 .driver = "Haswell-" TYPE_X86_CPU,\
420 .property = "stepping",\
424 #define PC_COMPAT_2_7 \
427 .driver = TYPE_X86_CPU,\
428 .property = "l3-cache",\
432 .driver = TYPE_X86_CPU,\
433 .property = "full-cpuid-auto-level",\
437 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
438 .property = "family",\
442 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
443 .property = "model",\
447 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
448 .property = "stepping",\
452 .driver = "isa-pcspk",\
453 .property = "migrate",\
457 #define PC_COMPAT_2_6 \
460 .driver = TYPE_X86_CPU,\
461 .property = "cpuid-0xb",\
464 .driver = "vmxnet3",\
465 .property = "romfile",\
469 .driver = TYPE_X86_CPU,\
470 .property = "fill-mtrr-mask",\
474 .driver = "apic-common",\
475 .property = "legacy-instance-id",\
479 #define PC_COMPAT_2_5 \
482 /* Helper for setting model-id for CPU models that changed model-id
483 * depending on QEMU versions up to QEMU 2.4.
485 #define PC_CPU_MODEL_IDS(v) \
487 .driver = "qemu32-" TYPE_X86_CPU,\
488 .property = "model-id",\
489 .value = "QEMU Virtual CPU version " v,\
492 .driver = "qemu64-" TYPE_X86_CPU,\
493 .property = "model-id",\
494 .value = "QEMU Virtual CPU version " v,\
497 .driver = "athlon-" TYPE_X86_CPU,\
498 .property = "model-id",\
499 .value = "QEMU Virtual CPU version " v,\
502 #define PC_COMPAT_2_4 \
504 PC_CPU_MODEL_IDS("2.4.0") \
506 .driver = "Haswell-" TYPE_X86_CPU,\
511 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
516 .driver = "Broadwell-" TYPE_X86_CPU,\
521 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
526 .driver = "host" "-" TYPE_X86_CPU,\
527 .property = "host-cache-info",\
531 .driver = TYPE_X86_CPU,\
532 .property = "check",\
536 .driver = "qemu64" "-" TYPE_X86_CPU,\
537 .property = "sse4a",\
541 .driver = "qemu64" "-" TYPE_X86_CPU,\
546 .driver = "qemu64" "-" TYPE_X86_CPU,\
547 .property = "popcnt",\
551 .driver = "qemu32" "-" TYPE_X86_CPU,\
552 .property = "popcnt",\
555 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
556 .property = "rdtscp",\
559 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
560 .property = "rdtscp",\
563 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
564 .property = "rdtscp",\
567 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
568 .property = "rdtscp",\
573 #define PC_COMPAT_2_3 \
575 PC_CPU_MODEL_IDS("2.3.0") \
577 .driver = TYPE_X86_CPU,\
581 .driver = "qemu64" "-" TYPE_X86_CPU,\
582 .property = "min-level",\
583 .value = stringify(4),\
585 .driver = "kvm64" "-" TYPE_X86_CPU,\
586 .property = "min-level",\
587 .value = stringify(5),\
589 .driver = "pentium3" "-" TYPE_X86_CPU,\
590 .property = "min-level",\
591 .value = stringify(2),\
593 .driver = "n270" "-" TYPE_X86_CPU,\
594 .property = "min-level",\
595 .value = stringify(5),\
597 .driver = "Conroe" "-" TYPE_X86_CPU,\
598 .property = "min-level",\
599 .value = stringify(4),\
601 .driver = "Penryn" "-" TYPE_X86_CPU,\
602 .property = "min-level",\
603 .value = stringify(4),\
605 .driver = "Nehalem" "-" TYPE_X86_CPU,\
606 .property = "min-level",\
607 .value = stringify(4),\
609 .driver = "n270" "-" TYPE_X86_CPU,\
610 .property = "min-xlevel",\
611 .value = stringify(0x8000000a),\
613 .driver = "Penryn" "-" TYPE_X86_CPU,\
614 .property = "min-xlevel",\
615 .value = stringify(0x8000000a),\
617 .driver = "Conroe" "-" TYPE_X86_CPU,\
618 .property = "min-xlevel",\
619 .value = stringify(0x8000000a),\
621 .driver = "Nehalem" "-" TYPE_X86_CPU,\
622 .property = "min-xlevel",\
623 .value = stringify(0x8000000a),\
625 .driver = "Westmere" "-" TYPE_X86_CPU,\
626 .property = "min-xlevel",\
627 .value = stringify(0x8000000a),\
629 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
630 .property = "min-xlevel",\
631 .value = stringify(0x8000000a),\
633 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
634 .property = "min-xlevel",\
635 .value = stringify(0x8000000a),\
637 .driver = "Haswell" "-" TYPE_X86_CPU,\
638 .property = "min-xlevel",\
639 .value = stringify(0x8000000a),\
641 .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\
642 .property = "min-xlevel",\
643 .value = stringify(0x8000000a),\
645 .driver = "Broadwell" "-" TYPE_X86_CPU,\
646 .property = "min-xlevel",\
647 .value = stringify(0x8000000a),\
649 .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
650 .property = "min-xlevel",\
651 .value = stringify(0x8000000a),\
653 .driver = TYPE_X86_CPU,\
654 .property = "kvm-no-smi-migration",\
658 #define PC_COMPAT_2_2 \
660 PC_CPU_MODEL_IDS("2.3.0") \
662 .driver = "kvm64" "-" TYPE_X86_CPU,\
667 .driver = "kvm32" "-" TYPE_X86_CPU,\
672 .driver = "Conroe" "-" TYPE_X86_CPU,\
677 .driver = "Penryn" "-" TYPE_X86_CPU,\
682 .driver = "Nehalem" "-" TYPE_X86_CPU,\
687 .driver = "Westmere" "-" TYPE_X86_CPU,\
692 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
697 .driver = "Haswell" "-" TYPE_X86_CPU,\
702 .driver = "Broadwell" "-" TYPE_X86_CPU,\
707 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
712 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
717 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
722 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
727 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
732 .driver = "Haswell" "-" TYPE_X86_CPU,\
737 .driver = "Haswell" "-" TYPE_X86_CPU,\
738 .property = "rdrand",\
742 .driver = "Broadwell" "-" TYPE_X86_CPU,\
747 .driver = "Broadwell" "-" TYPE_X86_CPU,\
748 .property = "rdrand",\
752 #define PC_COMPAT_2_1 \
754 PC_CPU_MODEL_IDS("2.1.0") \
756 .driver = "coreduo" "-" TYPE_X86_CPU,\
761 .driver = "core2duo" "-" TYPE_X86_CPU,\
766 #define PC_COMPAT_2_0 \
767 PC_CPU_MODEL_IDS("2.0.0") \
769 .driver = "virtio-scsi-pci",\
770 .property = "any_layout",\
773 .driver = "PIIX4_PM",\
774 .property = "memory-hotplug-support",\
779 .property = "version",\
780 .value = stringify(0x11),\
783 .driver = "nec-usb-xhci",\
784 .property = "superspeed-ports-first",\
788 .driver = "nec-usb-xhci",\
789 .property = "force-pcie-endcap",\
793 .driver = "pci-serial",\
794 .property = "prog_if",\
795 .value = stringify(0),\
798 .driver = "pci-serial-2x",\
799 .property = "prog_if",\
800 .value = stringify(0),\
803 .driver = "pci-serial-4x",\
804 .property = "prog_if",\
805 .value = stringify(0),\
808 .driver = "virtio-net-pci",\
809 .property = "guest_announce",\
813 .driver = "ICH9-LPC",\
814 .property = "memory-hotplug-support",\
817 .driver = "xio3130-downstream",\
818 .property = COMPAT_PROP_PCP,\
821 .driver = "ioh3420",\
822 .property = COMPAT_PROP_PCP,\
826 #define PC_COMPAT_1_7 \
827 PC_CPU_MODEL_IDS("1.7.0") \
829 .driver = TYPE_USB_DEVICE,\
830 .property = "msos-desc",\
834 .driver = "PIIX4_PM",\
835 .property = "acpi-pci-hotplug-with-bridge-support",\
840 .property = HPET_INTCAP,\
841 .value = stringify(4),\
844 #define PC_COMPAT_1_6 \
845 PC_CPU_MODEL_IDS("1.6.0") \
848 .property = "mitigation",\
851 .driver = "qemu64-" TYPE_X86_CPU,\
852 .property = "model",\
853 .value = stringify(2),\
855 .driver = "qemu32-" TYPE_X86_CPU,\
856 .property = "model",\
857 .value = stringify(3),\
859 .driver = "i440FX-pcihost",\
860 .property = "short_root_bus",\
861 .value = stringify(1),\
863 .driver = "q35-pcihost",\
864 .property = "short_root_bus",\
865 .value = stringify(1),\
868 #define PC_COMPAT_1_5 \
869 PC_CPU_MODEL_IDS("1.5.0") \
871 .driver = "Conroe-" TYPE_X86_CPU,\
872 .property = "model",\
873 .value = stringify(2),\
875 .driver = "Conroe-" TYPE_X86_CPU,\
876 .property = "min-level",\
877 .value = stringify(2),\
879 .driver = "Penryn-" TYPE_X86_CPU,\
880 .property = "model",\
881 .value = stringify(2),\
883 .driver = "Penryn-" TYPE_X86_CPU,\
884 .property = "min-level",\
885 .value = stringify(2),\
887 .driver = "Nehalem-" TYPE_X86_CPU,\
888 .property = "model",\
889 .value = stringify(2),\
891 .driver = "Nehalem-" TYPE_X86_CPU,\
892 .property = "min-level",\
893 .value = stringify(2),\
895 .driver = "virtio-net-pci",\
896 .property = "any_layout",\
899 .driver = TYPE_X86_CPU,\
903 .driver = "i440FX-pcihost",\
904 .property = "short_root_bus",\
905 .value = stringify(0),\
907 .driver = "q35-pcihost",\
908 .property = "short_root_bus",\
909 .value = stringify(0),\
912 #define PC_COMPAT_1_4 \
913 PC_CPU_MODEL_IDS("1.4.0") \
915 .driver = "scsi-hd",\
916 .property = "discard_granularity",\
917 .value = stringify(0),\
919 .driver = "scsi-cd",\
920 .property = "discard_granularity",\
921 .value = stringify(0),\
923 .driver = "scsi-disk",\
924 .property = "discard_granularity",\
925 .value = stringify(0),\
928 .property = "discard_granularity",\
929 .value = stringify(0),\
932 .property = "discard_granularity",\
933 .value = stringify(0),\
935 .driver = "ide-drive",\
936 .property = "discard_granularity",\
937 .value = stringify(0),\
939 .driver = "virtio-blk-pci",\
940 .property = "discard_granularity",\
941 .value = stringify(0),\
943 .driver = "virtio-serial-pci",\
944 .property = "vectors",\
945 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
946 .value = stringify(0xFFFFFFFF),\
948 .driver = "virtio-net-pci", \
949 .property = "ctrl_guest_offloads", \
953 .property = "romfile",\
954 .value = "pxe-e1000.rom",\
956 .driver = "ne2k_pci",\
957 .property = "romfile",\
958 .value = "pxe-ne2k_pci.rom",\
961 .property = "romfile",\
962 .value = "pxe-pcnet.rom",\
964 .driver = "rtl8139",\
965 .property = "romfile",\
966 .value = "pxe-rtl8139.rom",\
968 .driver = "virtio-net-pci",\
969 .property = "romfile",\
970 .value = "pxe-virtio.rom",\
972 .driver = "486-" TYPE_X86_CPU,\
973 .property = "model",\
974 .value = stringify(0),\
977 .driver = "n270" "-" TYPE_X86_CPU,\
978 .property = "movbe",\
982 .driver = "Westmere" "-" TYPE_X86_CPU,\
983 .property = "pclmulqdq",\
987 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
988 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
990 MachineClass *mc = MACHINE_CLASS(oc); \
994 static const TypeInfo pc_machine_type_##suffix = { \
995 .name = namestr TYPE_MACHINE_SUFFIX, \
996 .parent = TYPE_PC_MACHINE, \
997 .class_init = pc_machine_##suffix##_class_init, \
999 static void pc_machine_init_##suffix(void) \
1001 type_register(&pc_machine_type_##suffix); \
1003 type_init(pc_machine_init_##suffix)
1005 extern void igd_passthrough_isa_bridge_create(PCIBus
*bus
, uint16_t gpu_dev_id
);