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"
24 #define kvm_pit_in_kernel() \
25 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
26 #define kvm_pic_in_kernel() \
27 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
28 #define kvm_ioapic_in_kernel() \
29 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
31 #define kvm_pit_in_kernel() 0
32 #define kvm_pic_in_kernel() 0
33 #define kvm_ioapic_in_kernel() 0
38 * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
39 * @boot_cpus: number of present VCPUs
41 struct PCMachineState
{
43 MachineState parent_obj
;
47 /* State for other subsystems/APIs: */
48 MemoryHotplugState hotplug_memory
;
49 Notifier machine_done
;
51 /* Pointers to devices and objects: */
52 HotplugHandler
*acpi_dev
;
58 /* Configuration options: */
59 uint64_t max_ram_below_4g
;
63 AcpiNVDIMMState acpi_nvdimm_state
;
65 bool acpi_build_enabled
;
70 /* RAM information (sizes, addresses, configuration): */
71 ram_addr_t below_4g_mem_size
, above_4g_mem_size
;
73 /* CPU and apic information: */
74 bool apic_xrupt_override
;
75 unsigned apic_id_limit
;
78 /* NUMA information: */
82 /* Address space used by IOAPIC device. All IOAPIC interrupts
83 * will be translated to MSI messages in the address space. */
84 AddressSpace
*ioapic_as
;
87 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
88 #define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
89 #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
90 #define PC_MACHINE_VMPORT "vmport"
91 #define PC_MACHINE_SMM "smm"
92 #define PC_MACHINE_NVDIMM "nvdimm"
93 #define PC_MACHINE_SMBUS "smbus"
94 #define PC_MACHINE_SATA "sata"
95 #define PC_MACHINE_PIT "pit"
102 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
106 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
107 * backend's alignment value if provided
108 * @acpi_data_size: Size of the chunk of memory at the top of RAM
109 * for the BIOS ACPI tables and other BIOS
111 * @gigabyte_align: Make sure that guest addresses aligned at
112 * 1Gbyte boundaries get mapped to host
113 * addresses aligned at 1Gbyte boundaries. This
114 * way we can use 1GByte pages in the host.
117 struct PCMachineClass
{
119 MachineClass parent_class
;
124 HotplugHandler
*(*get_hotplug_handler
)(MachineState
*machine
,
127 /* Device configuration: */
129 bool kvmclock_enabled
;
131 /* Compat options: */
136 int legacy_acpi_table_size
;
137 unsigned acpi_data_size
;
140 bool smbios_defaults
;
141 bool smbios_legacy_mode
;
142 bool smbios_uuid_encoded
;
144 /* RAM / address space compat: */
146 bool has_reserved_memory
;
147 bool enforce_aligned_dimm
;
148 bool broken_reserved_end
;
150 /* TSC rate migration: */
152 /* generate legacy CPU hotplug AML */
153 bool legacy_cpu_hotplug
;
155 /* use DMA capable linuxboot option rom */
156 bool linuxboot_dma_enabled
;
159 #define TYPE_PC_MACHINE "generic-pc-machine"
160 #define PC_MACHINE(obj) \
161 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
162 #define PC_MACHINE_GET_CLASS(obj) \
163 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
164 #define PC_MACHINE_CLASS(klass) \
165 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
167 /* PC-style peripherals (also used by other machines). */
169 #define ACPI_PM_PROP_S3_DISABLED "disable_s3"
170 #define ACPI_PM_PROP_S4_DISABLED "disable_s4"
171 #define ACPI_PM_PROP_S4_VAL "s4_val"
172 #define ACPI_PM_PROP_SCI_INT "sci_int"
173 #define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
174 #define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
175 #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
176 #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
177 #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
178 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
182 void parallel_hds_isa_init(ISABus
*bus
, int n
);
184 bool parallel_mm_init(MemoryRegion
*address_space
,
185 hwaddr base
, int it_shift
, qemu_irq irq
,
190 extern DeviceState
*isa_pic
;
191 qemu_irq
*i8259_init(ISABus
*bus
, qemu_irq parent_irq
);
192 qemu_irq
*kvm_i8259_init(ISABus
*bus
);
193 int pic_read_irq(DeviceState
*d
);
194 int pic_get_output(DeviceState
*d
);
198 void kvm_ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
199 void ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
201 /* Global System Interrupts */
203 #define GSI_NUM_PINS IOAPIC_NUM_PINS
205 typedef struct GSIState
{
206 qemu_irq i8259_irq
[ISA_NUM_IRQS
];
207 qemu_irq ioapic_irq
[IOAPIC_NUM_PINS
];
210 void gsi_handler(void *opaque
, int n
, int level
);
213 #define TYPE_VMPORT "vmport"
214 typedef uint32_t (VMPortReadFunc
)(void *opaque
, uint32_t address
);
216 static inline void vmport_init(ISABus
*bus
)
218 isa_create_simple(bus
, TYPE_VMPORT
);
221 void vmport_register(unsigned char command
, VMPortReadFunc
*func
, void *opaque
);
222 void vmmouse_get_data(uint32_t *data
);
223 void vmmouse_set_data(const uint32_t *data
);
226 #define I8042_A20_LINE "a20"
228 void i8042_mm_init(qemu_irq kbd_irq
, qemu_irq mouse_irq
,
229 MemoryRegion
*region
, ram_addr_t size
,
231 void i8042_isa_mouse_fake_event(void *opaque
);
232 void i8042_setup_a20_line(ISADevice
*dev
, qemu_irq a20_out
);
235 extern int fd_bootchk
;
237 bool pc_machine_is_smm_enabled(PCMachineState
*pcms
);
238 void pc_register_ferr_irq(qemu_irq irq
);
239 void pc_acpi_smi_interrupt(void *opaque
, int irq
, int level
);
241 void pc_cpus_init(PCMachineState
*pcms
);
242 void pc_hot_add_cpu(const int64_t id
, Error
**errp
);
243 void pc_acpi_init(const char *default_dsdt
);
245 void pc_guest_info_init(PCMachineState
*pcms
);
247 #define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
248 #define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
249 #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
250 #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
251 #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
252 #define PCI_HOST_BELOW_4G_MEM_SIZE "below-4g-mem-size"
253 #define PCI_HOST_ABOVE_4G_MEM_SIZE "above-4g-mem-size"
254 #define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
257 void pc_pci_as_mapping_init(Object
*owner
, MemoryRegion
*system_memory
,
258 MemoryRegion
*pci_address_space
);
260 void xen_load_linux(PCMachineState
*pcms
);
261 void pc_memory_init(PCMachineState
*pcms
,
262 MemoryRegion
*system_memory
,
263 MemoryRegion
*rom_memory
,
264 MemoryRegion
**ram_memory
);
265 qemu_irq
pc_allocate_cpu_irq(void);
266 DeviceState
*pc_vga_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
267 void pc_basic_device_init(ISABus
*isa_bus
, qemu_irq
*gsi
,
268 ISADevice
**rtc_state
,
273 void pc_init_ne2k_isa(ISABus
*bus
, NICInfo
*nd
);
274 void pc_cmos_init(PCMachineState
*pcms
,
275 BusState
*ide0
, BusState
*ide1
,
277 void pc_nic_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
278 void pc_pci_device_init(PCIBus
*pci_bus
);
280 typedef void (*cpu_set_smm_t
)(int smm
, void *arg
);
282 void ioapic_init_gsi(GSIState
*gsi_state
, const char *parent_name
);
284 ISADevice
*pc_find_fdc0(void);
285 int cmos_get_fd_drive_type(FloppyDriveType fd0
);
287 #define FW_CFG_IO_BASE 0x510
289 #define PORT92_A20_LINE "a20"
293 I2CBus
*piix4_pm_init(PCIBus
*bus
, int devfn
, uint32_t smb_io_base
,
294 qemu_irq sci_irq
, qemu_irq smi_irq
,
295 int smm_enabled
, DeviceState
**piix4_pm
);
301 struct PCII440FXState
;
302 typedef struct PCII440FXState PCII440FXState
;
304 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
305 #define TYPE_I440FX_PCI_DEVICE "i440FX"
307 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
310 * Reset Control Register: PCI-accessible ISA-Compatible Register at address
311 * 0xcf9, provided by the PCI/ISA bridge (PIIX3 PCI function 0, 8086:7000).
313 #define RCR_IOPORT 0xcf9
315 PCIBus
*i440fx_init(const char *host_type
, const char *pci_type
,
316 PCII440FXState
**pi440fx_state
, int *piix_devfn
,
317 ISABus
**isa_bus
, qemu_irq
*pic
,
318 MemoryRegion
*address_space_mem
,
319 MemoryRegion
*address_space_io
,
321 ram_addr_t below_4g_mem_size
,
322 ram_addr_t above_4g_mem_size
,
323 MemoryRegion
*pci_memory
,
324 MemoryRegion
*ram_memory
);
326 PCIBus
*find_i440fx(void);
328 extern PCIDevice
*piix4_dev
;
329 int piix4_init(PCIBus
*bus
, ISABus
**isa_bus
, int devfn
);
332 enum vga_retrace_method
{
337 extern enum vga_retrace_method vga_retrace_method
;
339 int isa_vga_mm_init(hwaddr vram_base
,
340 hwaddr ctrl_base
, int it_shift
,
341 MemoryRegion
*address_space
);
344 static inline bool isa_ne2000_init(ISABus
*bus
, int base
, int irq
, NICInfo
*nd
)
349 qemu_check_nic_model(nd
, "ne2k_isa");
351 isadev
= isa_try_create(bus
, "ne2k_isa");
355 dev
= DEVICE(isadev
);
356 qdev_prop_set_uint32(dev
, "iobase", base
);
357 qdev_prop_set_uint32(dev
, "irq", irq
);
358 qdev_set_nic_properties(dev
, nd
);
359 qdev_init_nofail(dev
);
364 void pc_system_firmware_init(MemoryRegion
*rom_memory
,
368 uint16_t pvpanic_port(void);
371 void pc_madt_cpu_entry(AcpiDeviceIf
*adev
, int uid
,
372 const CPUArchIdList
*apic_ids
, GArray
*entry
);
376 #define E820_RESERVED 2
379 #define E820_UNUSABLE 5
381 int e820_add_entry(uint64_t, uint64_t, uint32_t);
382 int e820_get_num_entries(void);
383 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
385 #define PC_COMPAT_2_8 \
388 .driver = "kvmclock",\
389 .property = "x-mach-use-reliable-get-clock",\
393 .driver = "ICH9-LPC",\
394 .property = "x-smi-broadcast",\
398 .driver = TYPE_X86_CPU,\
399 .property = "vmware-cpuid-freq",\
403 .driver = "Haswell-" TYPE_X86_CPU,\
404 .property = "stepping",\
408 #define PC_COMPAT_2_7 \
411 .driver = TYPE_X86_CPU,\
412 .property = "l3-cache",\
416 .driver = TYPE_X86_CPU,\
417 .property = "full-cpuid-auto-level",\
421 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
422 .property = "family",\
426 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
427 .property = "model",\
431 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
432 .property = "stepping",\
436 .driver = "isa-pcspk",\
437 .property = "migrate",\
441 #define PC_COMPAT_2_6 \
444 .driver = TYPE_X86_CPU,\
445 .property = "cpuid-0xb",\
448 .driver = "vmxnet3",\
449 .property = "romfile",\
453 .driver = TYPE_X86_CPU,\
454 .property = "fill-mtrr-mask",\
458 .driver = "apic-common",\
459 .property = "legacy-instance-id",\
463 #define PC_COMPAT_2_5 \
466 /* Helper for setting model-id for CPU models that changed model-id
467 * depending on QEMU versions up to QEMU 2.4.
469 #define PC_CPU_MODEL_IDS(v) \
471 .driver = "qemu32-" TYPE_X86_CPU,\
472 .property = "model-id",\
473 .value = "QEMU Virtual CPU version " v,\
476 .driver = "qemu64-" TYPE_X86_CPU,\
477 .property = "model-id",\
478 .value = "QEMU Virtual CPU version " v,\
481 .driver = "athlon-" TYPE_X86_CPU,\
482 .property = "model-id",\
483 .value = "QEMU Virtual CPU version " v,\
486 #define PC_COMPAT_2_4 \
488 PC_CPU_MODEL_IDS("2.4.0") \
490 .driver = "Haswell-" TYPE_X86_CPU,\
495 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
500 .driver = "Broadwell-" TYPE_X86_CPU,\
505 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
510 .driver = "host" "-" TYPE_X86_CPU,\
511 .property = "host-cache-info",\
515 .driver = TYPE_X86_CPU,\
516 .property = "check",\
520 .driver = "qemu64" "-" TYPE_X86_CPU,\
521 .property = "sse4a",\
525 .driver = "qemu64" "-" TYPE_X86_CPU,\
530 .driver = "qemu64" "-" TYPE_X86_CPU,\
531 .property = "popcnt",\
535 .driver = "qemu32" "-" TYPE_X86_CPU,\
536 .property = "popcnt",\
539 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
540 .property = "rdtscp",\
543 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
544 .property = "rdtscp",\
547 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
548 .property = "rdtscp",\
551 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
552 .property = "rdtscp",\
557 #define PC_COMPAT_2_3 \
559 PC_CPU_MODEL_IDS("2.3.0") \
561 .driver = TYPE_X86_CPU,\
565 .driver = "qemu64" "-" TYPE_X86_CPU,\
566 .property = "level",\
567 .value = stringify(4),\
569 .driver = "kvm64" "-" TYPE_X86_CPU,\
570 .property = "level",\
571 .value = stringify(5),\
573 .driver = "pentium3" "-" TYPE_X86_CPU,\
574 .property = "level",\
575 .value = stringify(2),\
577 .driver = "n270" "-" TYPE_X86_CPU,\
578 .property = "level",\
579 .value = stringify(5),\
581 .driver = "Conroe" "-" TYPE_X86_CPU,\
582 .property = "level",\
583 .value = stringify(4),\
585 .driver = "Penryn" "-" TYPE_X86_CPU,\
586 .property = "level",\
587 .value = stringify(4),\
589 .driver = "Nehalem" "-" TYPE_X86_CPU,\
590 .property = "level",\
591 .value = stringify(4),\
593 .driver = "n270" "-" TYPE_X86_CPU,\
594 .property = "xlevel",\
595 .value = stringify(0x8000000a),\
597 .driver = "Penryn" "-" TYPE_X86_CPU,\
598 .property = "xlevel",\
599 .value = stringify(0x8000000a),\
601 .driver = "Conroe" "-" TYPE_X86_CPU,\
602 .property = "xlevel",\
603 .value = stringify(0x8000000a),\
605 .driver = "Nehalem" "-" TYPE_X86_CPU,\
606 .property = "xlevel",\
607 .value = stringify(0x8000000a),\
609 .driver = "Westmere" "-" TYPE_X86_CPU,\
610 .property = "xlevel",\
611 .value = stringify(0x8000000a),\
613 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
614 .property = "xlevel",\
615 .value = stringify(0x8000000a),\
617 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
618 .property = "xlevel",\
619 .value = stringify(0x8000000a),\
621 .driver = "Haswell" "-" TYPE_X86_CPU,\
622 .property = "xlevel",\
623 .value = stringify(0x8000000a),\
625 .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\
626 .property = "xlevel",\
627 .value = stringify(0x8000000a),\
629 .driver = "Broadwell" "-" TYPE_X86_CPU,\
630 .property = "xlevel",\
631 .value = stringify(0x8000000a),\
633 .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
634 .property = "xlevel",\
635 .value = stringify(0x8000000a),\
637 .driver = TYPE_X86_CPU,\
638 .property = "kvm-no-smi-migration",\
642 #define PC_COMPAT_2_2 \
644 PC_CPU_MODEL_IDS("2.3.0") \
646 .driver = "kvm64" "-" TYPE_X86_CPU,\
651 .driver = "kvm32" "-" TYPE_X86_CPU,\
656 .driver = "Conroe" "-" TYPE_X86_CPU,\
661 .driver = "Penryn" "-" TYPE_X86_CPU,\
666 .driver = "Nehalem" "-" TYPE_X86_CPU,\
671 .driver = "Westmere" "-" TYPE_X86_CPU,\
676 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
681 .driver = "Haswell" "-" TYPE_X86_CPU,\
686 .driver = "Broadwell" "-" TYPE_X86_CPU,\
691 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
696 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
701 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
706 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
711 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
716 .driver = "Haswell" "-" TYPE_X86_CPU,\
721 .driver = "Haswell" "-" TYPE_X86_CPU,\
722 .property = "rdrand",\
726 .driver = "Broadwell" "-" TYPE_X86_CPU,\
731 .driver = "Broadwell" "-" TYPE_X86_CPU,\
732 .property = "rdrand",\
736 #define PC_COMPAT_2_1 \
738 PC_CPU_MODEL_IDS("2.1.0") \
740 .driver = "coreduo" "-" TYPE_X86_CPU,\
745 .driver = "core2duo" "-" TYPE_X86_CPU,\
750 #define PC_COMPAT_2_0 \
751 PC_CPU_MODEL_IDS("2.0.0") \
753 .driver = "virtio-scsi-pci",\
754 .property = "any_layout",\
757 .driver = "PIIX4_PM",\
758 .property = "memory-hotplug-support",\
763 .property = "version",\
764 .value = stringify(0x11),\
767 .driver = "nec-usb-xhci",\
768 .property = "superspeed-ports-first",\
772 .driver = "nec-usb-xhci",\
773 .property = "force-pcie-endcap",\
777 .driver = "pci-serial",\
778 .property = "prog_if",\
779 .value = stringify(0),\
782 .driver = "pci-serial-2x",\
783 .property = "prog_if",\
784 .value = stringify(0),\
787 .driver = "pci-serial-4x",\
788 .property = "prog_if",\
789 .value = stringify(0),\
792 .driver = "virtio-net-pci",\
793 .property = "guest_announce",\
797 .driver = "ICH9-LPC",\
798 .property = "memory-hotplug-support",\
801 .driver = "xio3130-downstream",\
802 .property = COMPAT_PROP_PCP,\
805 .driver = "ioh3420",\
806 .property = COMPAT_PROP_PCP,\
810 #define PC_COMPAT_1_7 \
811 PC_CPU_MODEL_IDS("1.7.0") \
813 .driver = TYPE_USB_DEVICE,\
814 .property = "msos-desc",\
818 .driver = "PIIX4_PM",\
819 .property = "acpi-pci-hotplug-with-bridge-support",\
824 .property = HPET_INTCAP,\
825 .value = stringify(4),\
828 #define PC_COMPAT_1_6 \
829 PC_CPU_MODEL_IDS("1.6.0") \
832 .property = "mitigation",\
835 .driver = "qemu64-" TYPE_X86_CPU,\
836 .property = "model",\
837 .value = stringify(2),\
839 .driver = "qemu32-" TYPE_X86_CPU,\
840 .property = "model",\
841 .value = stringify(3),\
843 .driver = "i440FX-pcihost",\
844 .property = "short_root_bus",\
845 .value = stringify(1),\
847 .driver = "q35-pcihost",\
848 .property = "short_root_bus",\
849 .value = stringify(1),\
852 #define PC_COMPAT_1_5 \
853 PC_CPU_MODEL_IDS("1.5.0") \
855 .driver = "Conroe-" TYPE_X86_CPU,\
856 .property = "model",\
857 .value = stringify(2),\
859 .driver = "Conroe-" TYPE_X86_CPU,\
860 .property = "level",\
861 .value = stringify(2),\
863 .driver = "Penryn-" TYPE_X86_CPU,\
864 .property = "model",\
865 .value = stringify(2),\
867 .driver = "Penryn-" TYPE_X86_CPU,\
868 .property = "level",\
869 .value = stringify(2),\
871 .driver = "Nehalem-" TYPE_X86_CPU,\
872 .property = "model",\
873 .value = stringify(2),\
875 .driver = "Nehalem-" TYPE_X86_CPU,\
876 .property = "level",\
877 .value = stringify(2),\
879 .driver = "virtio-net-pci",\
880 .property = "any_layout",\
883 .driver = TYPE_X86_CPU,\
887 .driver = "i440FX-pcihost",\
888 .property = "short_root_bus",\
889 .value = stringify(0),\
891 .driver = "q35-pcihost",\
892 .property = "short_root_bus",\
893 .value = stringify(0),\
896 #define PC_COMPAT_1_4 \
897 PC_CPU_MODEL_IDS("1.4.0") \
899 .driver = "scsi-hd",\
900 .property = "discard_granularity",\
901 .value = stringify(0),\
903 .driver = "scsi-cd",\
904 .property = "discard_granularity",\
905 .value = stringify(0),\
907 .driver = "scsi-disk",\
908 .property = "discard_granularity",\
909 .value = stringify(0),\
912 .property = "discard_granularity",\
913 .value = stringify(0),\
916 .property = "discard_granularity",\
917 .value = stringify(0),\
919 .driver = "ide-drive",\
920 .property = "discard_granularity",\
921 .value = stringify(0),\
923 .driver = "virtio-blk-pci",\
924 .property = "discard_granularity",\
925 .value = stringify(0),\
927 .driver = "virtio-serial-pci",\
928 .property = "vectors",\
929 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
930 .value = stringify(0xFFFFFFFF),\
932 .driver = "virtio-net-pci", \
933 .property = "ctrl_guest_offloads", \
937 .property = "romfile",\
938 .value = "pxe-e1000.rom",\
940 .driver = "ne2k_pci",\
941 .property = "romfile",\
942 .value = "pxe-ne2k_pci.rom",\
945 .property = "romfile",\
946 .value = "pxe-pcnet.rom",\
948 .driver = "rtl8139",\
949 .property = "romfile",\
950 .value = "pxe-rtl8139.rom",\
952 .driver = "virtio-net-pci",\
953 .property = "romfile",\
954 .value = "pxe-virtio.rom",\
956 .driver = "486-" TYPE_X86_CPU,\
957 .property = "model",\
958 .value = stringify(0),\
961 .driver = "n270" "-" TYPE_X86_CPU,\
962 .property = "movbe",\
966 .driver = "Westmere" "-" TYPE_X86_CPU,\
967 .property = "pclmulqdq",\
971 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
972 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
974 MachineClass *mc = MACHINE_CLASS(oc); \
978 static const TypeInfo pc_machine_type_##suffix = { \
979 .name = namestr TYPE_MACHINE_SUFFIX, \
980 .parent = TYPE_PC_MACHINE, \
981 .class_init = pc_machine_##suffix##_class_init, \
983 static void pc_machine_init_##suffix(void) \
985 type_register(&pc_machine_type_##suffix); \
987 type_init(pc_machine_init_##suffix)
989 extern void igd_passthrough_isa_bridge_create(PCIBus
*bus
, uint16_t gpu_dev_id
);