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
;
156 #define TYPE_PC_MACHINE "generic-pc-machine"
157 #define PC_MACHINE(obj) \
158 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
159 #define PC_MACHINE_GET_CLASS(obj) \
160 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
161 #define PC_MACHINE_CLASS(klass) \
162 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
164 /* PC-style peripherals (also used by other machines). */
166 #define ACPI_PM_PROP_S3_DISABLED "disable_s3"
167 #define ACPI_PM_PROP_S4_DISABLED "disable_s4"
168 #define ACPI_PM_PROP_S4_VAL "s4_val"
169 #define ACPI_PM_PROP_SCI_INT "sci_int"
170 #define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
171 #define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
172 #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
173 #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
174 #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
175 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
179 void parallel_hds_isa_init(ISABus
*bus
, int n
);
181 bool parallel_mm_init(MemoryRegion
*address_space
,
182 hwaddr base
, int it_shift
, qemu_irq irq
,
187 extern DeviceState
*isa_pic
;
188 qemu_irq
*i8259_init(ISABus
*bus
, qemu_irq parent_irq
);
189 qemu_irq
*kvm_i8259_init(ISABus
*bus
);
190 int pic_read_irq(DeviceState
*d
);
191 int pic_get_output(DeviceState
*d
);
195 void kvm_ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
196 void ioapic_dump_state(Monitor
*mon
, const QDict
*qdict
);
198 /* Global System Interrupts */
200 #define GSI_NUM_PINS IOAPIC_NUM_PINS
202 typedef struct GSIState
{
203 qemu_irq i8259_irq
[ISA_NUM_IRQS
];
204 qemu_irq ioapic_irq
[IOAPIC_NUM_PINS
];
207 void gsi_handler(void *opaque
, int n
, int level
);
210 #define TYPE_VMPORT "vmport"
211 typedef uint32_t (VMPortReadFunc
)(void *opaque
, uint32_t address
);
213 static inline void vmport_init(ISABus
*bus
)
215 isa_create_simple(bus
, TYPE_VMPORT
);
218 void vmport_register(unsigned char command
, VMPortReadFunc
*func
, void *opaque
);
219 void vmmouse_get_data(uint32_t *data
);
220 void vmmouse_set_data(const uint32_t *data
);
223 #define I8042_A20_LINE "a20"
225 void i8042_mm_init(qemu_irq kbd_irq
, qemu_irq mouse_irq
,
226 MemoryRegion
*region
, ram_addr_t size
,
228 void i8042_isa_mouse_fake_event(void *opaque
);
229 void i8042_setup_a20_line(ISADevice
*dev
, qemu_irq a20_out
);
232 extern int fd_bootchk
;
234 bool pc_machine_is_smm_enabled(PCMachineState
*pcms
);
235 void pc_register_ferr_irq(qemu_irq irq
);
236 void pc_acpi_smi_interrupt(void *opaque
, int irq
, int level
);
238 void pc_cpus_init(PCMachineState
*pcms
);
239 void pc_hot_add_cpu(const int64_t id
, Error
**errp
);
240 void pc_acpi_init(const char *default_dsdt
);
242 void pc_guest_info_init(PCMachineState
*pcms
);
244 #define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
245 #define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
246 #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
247 #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
248 #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
249 #define PCI_HOST_BELOW_4G_MEM_SIZE "below-4g-mem-size"
250 #define PCI_HOST_ABOVE_4G_MEM_SIZE "above-4g-mem-size"
251 #define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
254 void pc_pci_as_mapping_init(Object
*owner
, MemoryRegion
*system_memory
,
255 MemoryRegion
*pci_address_space
);
257 void xen_load_linux(PCMachineState
*pcms
);
258 void pc_memory_init(PCMachineState
*pcms
,
259 MemoryRegion
*system_memory
,
260 MemoryRegion
*rom_memory
,
261 MemoryRegion
**ram_memory
);
262 qemu_irq
pc_allocate_cpu_irq(void);
263 DeviceState
*pc_vga_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
264 void pc_basic_device_init(ISABus
*isa_bus
, qemu_irq
*gsi
,
265 ISADevice
**rtc_state
,
270 void pc_init_ne2k_isa(ISABus
*bus
, NICInfo
*nd
);
271 void pc_cmos_init(PCMachineState
*pcms
,
272 BusState
*ide0
, BusState
*ide1
,
274 void pc_nic_init(ISABus
*isa_bus
, PCIBus
*pci_bus
);
275 void pc_pci_device_init(PCIBus
*pci_bus
);
277 typedef void (*cpu_set_smm_t
)(int smm
, void *arg
);
279 void ioapic_init_gsi(GSIState
*gsi_state
, const char *parent_name
);
281 ISADevice
*pc_find_fdc0(void);
282 int cmos_get_fd_drive_type(FloppyDriveType fd0
);
284 #define FW_CFG_IO_BASE 0x510
286 #define PORT92_A20_LINE "a20"
290 I2CBus
*piix4_pm_init(PCIBus
*bus
, int devfn
, uint32_t smb_io_base
,
291 qemu_irq sci_irq
, qemu_irq smi_irq
,
292 int smm_enabled
, DeviceState
**piix4_pm
);
298 struct PCII440FXState
;
299 typedef struct PCII440FXState PCII440FXState
;
301 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
302 #define TYPE_I440FX_PCI_DEVICE "i440FX"
304 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
306 PCIBus
*i440fx_init(const char *host_type
, const char *pci_type
,
307 PCII440FXState
**pi440fx_state
, int *piix_devfn
,
308 ISABus
**isa_bus
, qemu_irq
*pic
,
309 MemoryRegion
*address_space_mem
,
310 MemoryRegion
*address_space_io
,
312 ram_addr_t below_4g_mem_size
,
313 ram_addr_t above_4g_mem_size
,
314 MemoryRegion
*pci_memory
,
315 MemoryRegion
*ram_memory
);
317 PCIBus
*find_i440fx(void);
319 extern PCIDevice
*piix4_dev
;
320 int piix4_init(PCIBus
*bus
, ISABus
**isa_bus
, int devfn
);
323 enum vga_retrace_method
{
328 extern enum vga_retrace_method vga_retrace_method
;
330 int isa_vga_mm_init(hwaddr vram_base
,
331 hwaddr ctrl_base
, int it_shift
,
332 MemoryRegion
*address_space
);
335 static inline bool isa_ne2000_init(ISABus
*bus
, int base
, int irq
, NICInfo
*nd
)
340 qemu_check_nic_model(nd
, "ne2k_isa");
342 isadev
= isa_try_create(bus
, "ne2k_isa");
346 dev
= DEVICE(isadev
);
347 qdev_prop_set_uint32(dev
, "iobase", base
);
348 qdev_prop_set_uint32(dev
, "irq", irq
);
349 qdev_set_nic_properties(dev
, nd
);
350 qdev_init_nofail(dev
);
355 void pc_system_firmware_init(MemoryRegion
*rom_memory
,
359 uint16_t pvpanic_port(void);
362 void pc_madt_cpu_entry(AcpiDeviceIf
*adev
, int uid
,
363 const CPUArchIdList
*apic_ids
, GArray
*entry
);
367 #define E820_RESERVED 2
370 #define E820_UNUSABLE 5
372 int e820_add_entry(uint64_t, uint64_t, uint32_t);
373 int e820_get_num_entries(void);
374 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
376 #define PC_COMPAT_2_8 \
379 .driver = "kvmclock",\
380 .property = "x-mach-use-reliable-get-clock",\
384 .driver = "ICH9-LPC",\
385 .property = "x-smi-broadcast",\
389 .driver = TYPE_X86_CPU,\
390 .property = "vmware-cpuid-freq",\
394 .driver = "Haswell-" TYPE_X86_CPU,\
395 .property = "stepping",\
399 #define PC_COMPAT_2_7 \
402 .driver = TYPE_X86_CPU,\
403 .property = "l3-cache",\
407 .driver = TYPE_X86_CPU,\
408 .property = "full-cpuid-auto-level",\
412 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
413 .property = "family",\
417 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
418 .property = "model",\
422 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
423 .property = "stepping",\
427 .driver = "isa-pcspk",\
428 .property = "migrate",\
432 #define PC_COMPAT_2_6 \
435 .driver = "fw_cfg_io",\
436 .property = "dma_enabled",\
439 .driver = TYPE_X86_CPU,\
440 .property = "cpuid-0xb",\
443 .driver = "vmxnet3",\
444 .property = "romfile",\
448 .driver = TYPE_X86_CPU,\
449 .property = "fill-mtrr-mask",\
453 .driver = "apic-common",\
454 .property = "legacy-instance-id",\
458 #define PC_COMPAT_2_5 \
461 /* Helper for setting model-id for CPU models that changed model-id
462 * depending on QEMU versions up to QEMU 2.4.
464 #define PC_CPU_MODEL_IDS(v) \
466 .driver = "qemu32-" TYPE_X86_CPU,\
467 .property = "model-id",\
468 .value = "QEMU Virtual CPU version " v,\
471 .driver = "qemu64-" TYPE_X86_CPU,\
472 .property = "model-id",\
473 .value = "QEMU Virtual CPU version " v,\
476 .driver = "athlon-" TYPE_X86_CPU,\
477 .property = "model-id",\
478 .value = "QEMU Virtual CPU version " v,\
481 #define PC_COMPAT_2_4 \
483 PC_CPU_MODEL_IDS("2.4.0") \
485 .driver = "Haswell-" TYPE_X86_CPU,\
490 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
495 .driver = "Broadwell-" TYPE_X86_CPU,\
500 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
505 .driver = "host" "-" TYPE_X86_CPU,\
506 .property = "host-cache-info",\
510 .driver = TYPE_X86_CPU,\
511 .property = "check",\
515 .driver = "qemu64" "-" TYPE_X86_CPU,\
516 .property = "sse4a",\
520 .driver = "qemu64" "-" TYPE_X86_CPU,\
525 .driver = "qemu64" "-" TYPE_X86_CPU,\
526 .property = "popcnt",\
530 .driver = "qemu32" "-" TYPE_X86_CPU,\
531 .property = "popcnt",\
534 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
535 .property = "rdtscp",\
538 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
539 .property = "rdtscp",\
542 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
543 .property = "rdtscp",\
546 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
547 .property = "rdtscp",\
552 #define PC_COMPAT_2_3 \
554 PC_CPU_MODEL_IDS("2.3.0") \
556 .driver = TYPE_X86_CPU,\
560 .driver = "qemu64" "-" TYPE_X86_CPU,\
561 .property = "level",\
562 .value = stringify(4),\
564 .driver = "kvm64" "-" TYPE_X86_CPU,\
565 .property = "level",\
566 .value = stringify(5),\
568 .driver = "pentium3" "-" TYPE_X86_CPU,\
569 .property = "level",\
570 .value = stringify(2),\
572 .driver = "n270" "-" TYPE_X86_CPU,\
573 .property = "level",\
574 .value = stringify(5),\
576 .driver = "Conroe" "-" TYPE_X86_CPU,\
577 .property = "level",\
578 .value = stringify(4),\
580 .driver = "Penryn" "-" TYPE_X86_CPU,\
581 .property = "level",\
582 .value = stringify(4),\
584 .driver = "Nehalem" "-" TYPE_X86_CPU,\
585 .property = "level",\
586 .value = stringify(4),\
588 .driver = "n270" "-" TYPE_X86_CPU,\
589 .property = "xlevel",\
590 .value = stringify(0x8000000a),\
592 .driver = "Penryn" "-" TYPE_X86_CPU,\
593 .property = "xlevel",\
594 .value = stringify(0x8000000a),\
596 .driver = "Conroe" "-" TYPE_X86_CPU,\
597 .property = "xlevel",\
598 .value = stringify(0x8000000a),\
600 .driver = "Nehalem" "-" TYPE_X86_CPU,\
601 .property = "xlevel",\
602 .value = stringify(0x8000000a),\
604 .driver = "Westmere" "-" TYPE_X86_CPU,\
605 .property = "xlevel",\
606 .value = stringify(0x8000000a),\
608 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
609 .property = "xlevel",\
610 .value = stringify(0x8000000a),\
612 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
613 .property = "xlevel",\
614 .value = stringify(0x8000000a),\
616 .driver = "Haswell" "-" TYPE_X86_CPU,\
617 .property = "xlevel",\
618 .value = stringify(0x8000000a),\
620 .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\
621 .property = "xlevel",\
622 .value = stringify(0x8000000a),\
624 .driver = "Broadwell" "-" TYPE_X86_CPU,\
625 .property = "xlevel",\
626 .value = stringify(0x8000000a),\
628 .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
629 .property = "xlevel",\
630 .value = stringify(0x8000000a),\
632 .driver = TYPE_X86_CPU,\
633 .property = "kvm-no-smi-migration",\
637 #define PC_COMPAT_2_2 \
639 PC_CPU_MODEL_IDS("2.3.0") \
641 .driver = "kvm64" "-" TYPE_X86_CPU,\
646 .driver = "kvm32" "-" TYPE_X86_CPU,\
651 .driver = "Conroe" "-" TYPE_X86_CPU,\
656 .driver = "Penryn" "-" TYPE_X86_CPU,\
661 .driver = "Nehalem" "-" TYPE_X86_CPU,\
666 .driver = "Westmere" "-" TYPE_X86_CPU,\
671 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
676 .driver = "Haswell" "-" TYPE_X86_CPU,\
681 .driver = "Broadwell" "-" TYPE_X86_CPU,\
686 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
691 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
696 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
701 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
706 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
711 .driver = "Haswell" "-" TYPE_X86_CPU,\
716 .driver = "Haswell" "-" TYPE_X86_CPU,\
717 .property = "rdrand",\
721 .driver = "Broadwell" "-" TYPE_X86_CPU,\
726 .driver = "Broadwell" "-" TYPE_X86_CPU,\
727 .property = "rdrand",\
731 #define PC_COMPAT_2_1 \
733 PC_CPU_MODEL_IDS("2.1.0") \
735 .driver = "coreduo" "-" TYPE_X86_CPU,\
740 .driver = "core2duo" "-" TYPE_X86_CPU,\
745 #define PC_COMPAT_2_0 \
746 PC_CPU_MODEL_IDS("2.0.0") \
748 .driver = "virtio-scsi-pci",\
749 .property = "any_layout",\
752 .driver = "PIIX4_PM",\
753 .property = "memory-hotplug-support",\
758 .property = "version",\
759 .value = stringify(0x11),\
762 .driver = "nec-usb-xhci",\
763 .property = "superspeed-ports-first",\
767 .driver = "nec-usb-xhci",\
768 .property = "force-pcie-endcap",\
772 .driver = "pci-serial",\
773 .property = "prog_if",\
774 .value = stringify(0),\
777 .driver = "pci-serial-2x",\
778 .property = "prog_if",\
779 .value = stringify(0),\
782 .driver = "pci-serial-4x",\
783 .property = "prog_if",\
784 .value = stringify(0),\
787 .driver = "virtio-net-pci",\
788 .property = "guest_announce",\
792 .driver = "ICH9-LPC",\
793 .property = "memory-hotplug-support",\
796 .driver = "xio3130-downstream",\
797 .property = COMPAT_PROP_PCP,\
800 .driver = "ioh3420",\
801 .property = COMPAT_PROP_PCP,\
805 #define PC_COMPAT_1_7 \
806 PC_CPU_MODEL_IDS("1.7.0") \
808 .driver = TYPE_USB_DEVICE,\
809 .property = "msos-desc",\
813 .driver = "PIIX4_PM",\
814 .property = "acpi-pci-hotplug-with-bridge-support",\
819 .property = HPET_INTCAP,\
820 .value = stringify(4),\
823 #define PC_COMPAT_1_6 \
824 PC_CPU_MODEL_IDS("1.6.0") \
827 .property = "mitigation",\
830 .driver = "qemu64-" TYPE_X86_CPU,\
831 .property = "model",\
832 .value = stringify(2),\
834 .driver = "qemu32-" TYPE_X86_CPU,\
835 .property = "model",\
836 .value = stringify(3),\
838 .driver = "i440FX-pcihost",\
839 .property = "short_root_bus",\
840 .value = stringify(1),\
842 .driver = "q35-pcihost",\
843 .property = "short_root_bus",\
844 .value = stringify(1),\
847 #define PC_COMPAT_1_5 \
848 PC_CPU_MODEL_IDS("1.5.0") \
850 .driver = "Conroe-" TYPE_X86_CPU,\
851 .property = "model",\
852 .value = stringify(2),\
854 .driver = "Conroe-" TYPE_X86_CPU,\
855 .property = "level",\
856 .value = stringify(2),\
858 .driver = "Penryn-" TYPE_X86_CPU,\
859 .property = "model",\
860 .value = stringify(2),\
862 .driver = "Penryn-" TYPE_X86_CPU,\
863 .property = "level",\
864 .value = stringify(2),\
866 .driver = "Nehalem-" TYPE_X86_CPU,\
867 .property = "model",\
868 .value = stringify(2),\
870 .driver = "Nehalem-" TYPE_X86_CPU,\
871 .property = "level",\
872 .value = stringify(2),\
874 .driver = "virtio-net-pci",\
875 .property = "any_layout",\
878 .driver = TYPE_X86_CPU,\
882 .driver = "i440FX-pcihost",\
883 .property = "short_root_bus",\
884 .value = stringify(0),\
886 .driver = "q35-pcihost",\
887 .property = "short_root_bus",\
888 .value = stringify(0),\
891 #define PC_COMPAT_1_4 \
892 PC_CPU_MODEL_IDS("1.4.0") \
894 .driver = "scsi-hd",\
895 .property = "discard_granularity",\
896 .value = stringify(0),\
898 .driver = "scsi-cd",\
899 .property = "discard_granularity",\
900 .value = stringify(0),\
902 .driver = "scsi-disk",\
903 .property = "discard_granularity",\
904 .value = stringify(0),\
907 .property = "discard_granularity",\
908 .value = stringify(0),\
911 .property = "discard_granularity",\
912 .value = stringify(0),\
914 .driver = "ide-drive",\
915 .property = "discard_granularity",\
916 .value = stringify(0),\
918 .driver = "virtio-blk-pci",\
919 .property = "discard_granularity",\
920 .value = stringify(0),\
922 .driver = "virtio-serial-pci",\
923 .property = "vectors",\
924 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
925 .value = stringify(0xFFFFFFFF),\
927 .driver = "virtio-net-pci", \
928 .property = "ctrl_guest_offloads", \
932 .property = "romfile",\
933 .value = "pxe-e1000.rom",\
935 .driver = "ne2k_pci",\
936 .property = "romfile",\
937 .value = "pxe-ne2k_pci.rom",\
940 .property = "romfile",\
941 .value = "pxe-pcnet.rom",\
943 .driver = "rtl8139",\
944 .property = "romfile",\
945 .value = "pxe-rtl8139.rom",\
947 .driver = "virtio-net-pci",\
948 .property = "romfile",\
949 .value = "pxe-virtio.rom",\
951 .driver = "486-" TYPE_X86_CPU,\
952 .property = "model",\
953 .value = stringify(0),\
956 .driver = "n270" "-" TYPE_X86_CPU,\
957 .property = "movbe",\
961 .driver = "Westmere" "-" TYPE_X86_CPU,\
962 .property = "pclmulqdq",\
966 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
967 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
969 MachineClass *mc = MACHINE_CLASS(oc); \
973 static const TypeInfo pc_machine_type_##suffix = { \
974 .name = namestr TYPE_MACHINE_SUFFIX, \
975 .parent = TYPE_PC_MACHINE, \
976 .class_init = pc_machine_##suffix##_class_init, \
978 static void pc_machine_init_##suffix(void) \
980 type_register(&pc_machine_type_##suffix); \
982 type_init(pc_machine_init_##suffix)
984 extern void igd_passthrough_isa_bridge_create(PCIBus
*bus
, uint16_t gpu_dev_id
);