pc: Move legacy_acpi_table_size global to PCMachineClass
[qemu/ar7.git] / include / hw / i386 / pc.h
blobf858b8b692f5e8ec201efe1494a9a8d7c702e27a
1 #ifndef HW_PC_H
2 #define HW_PC_H
4 #include "qemu-common.h"
5 #include "qemu/typedefs.h"
6 #include "exec/memory.h"
7 #include "hw/boards.h"
8 #include "hw/isa/isa.h"
9 #include "hw/block/fdc.h"
10 #include "net/net.h"
11 #include "hw/i386/ioapic.h"
13 #include "qemu/range.h"
14 #include "qemu/bitmap.h"
15 #include "sysemu/sysemu.h"
16 #include "hw/pci/pci.h"
17 #include "hw/boards.h"
18 #include "hw/compat.h"
19 #include "hw/mem/pc-dimm.h"
21 #define HPET_INTCAP "hpet-intcap"
23 #ifdef CONFIG_KVM
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())
30 #else
31 #define kvm_pit_in_kernel() 0
32 #define kvm_pic_in_kernel() 0
33 #define kvm_ioapic_in_kernel() 0
34 #endif
36 /**
37 * PCMachineState:
38 * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
39 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
40 * backend's alignment value if provided
42 struct PCMachineState {
43 /*< private >*/
44 MachineState parent_obj;
46 /* <public> */
47 MemoryHotplugState hotplug_memory;
49 HotplugHandler *acpi_dev;
50 ISADevice *rtc;
52 uint64_t max_ram_below_4g;
53 OnOffAuto vmport;
54 OnOffAuto smm;
55 bool enforce_aligned_dimm;
56 ram_addr_t below_4g_mem_size, above_4g_mem_size;
59 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
60 #define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
61 #define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
62 #define PC_MACHINE_VMPORT "vmport"
63 #define PC_MACHINE_SMM "smm"
64 #define PC_MACHINE_ENFORCE_ALIGNED_DIMM "enforce-aligned-dimm"
66 /**
67 * PCMachineClass:
68 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
70 struct PCMachineClass {
71 /*< private >*/
72 MachineClass parent_class;
74 /*< public >*/
75 bool broken_reserved_end;
76 HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
77 DeviceState *dev);
79 bool pci_enabled;
80 bool has_acpi_build;
81 bool rsdp_in_ram;
82 bool smbios_defaults;
83 bool smbios_legacy_mode;
84 bool smbios_uuid_encoded;
85 /* Make sure that guest addresses aligned at 1Gbyte boundaries get
86 * mapped to host addresses aligned at 1Gbyte boundaries. This way
87 * we can use 1GByte pages in the host.
89 bool gigabyte_align;
90 bool has_reserved_memory;
91 bool kvmclock_enabled;
92 int legacy_acpi_table_size;
95 #define TYPE_PC_MACHINE "generic-pc-machine"
96 #define PC_MACHINE(obj) \
97 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
98 #define PC_MACHINE_GET_CLASS(obj) \
99 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
100 #define PC_MACHINE_CLASS(klass) \
101 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
103 /* PC-style peripherals (also used by other machines). */
105 typedef struct PcPciInfo {
106 Range w32;
107 Range w64;
108 } PcPciInfo;
110 #define ACPI_PM_PROP_S3_DISABLED "disable_s3"
111 #define ACPI_PM_PROP_S4_DISABLED "disable_s4"
112 #define ACPI_PM_PROP_S4_VAL "s4_val"
113 #define ACPI_PM_PROP_SCI_INT "sci_int"
114 #define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
115 #define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
116 #define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
117 #define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
118 #define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
119 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
121 struct PcGuestInfo {
122 bool isapc_ram_fw;
123 hwaddr ram_size, ram_size_below_4g;
124 unsigned apic_id_limit;
125 bool apic_xrupt_override;
126 uint64_t numa_nodes;
127 uint64_t *node_mem;
128 uint64_t *node_cpu;
129 FWCfgState *fw_cfg;
130 int legacy_acpi_table_size;
131 bool has_acpi_build;
132 bool has_reserved_memory;
133 bool rsdp_in_ram;
136 /* parallel.c */
138 void parallel_hds_isa_init(ISABus *bus, int n);
140 bool parallel_mm_init(MemoryRegion *address_space,
141 hwaddr base, int it_shift, qemu_irq irq,
142 CharDriverState *chr);
144 /* i8259.c */
146 extern DeviceState *isa_pic;
147 qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
148 qemu_irq *kvm_i8259_init(ISABus *bus);
149 int pic_read_irq(DeviceState *d);
150 int pic_get_output(DeviceState *d);
151 void hmp_info_pic(Monitor *mon, const QDict *qdict);
152 void hmp_info_irq(Monitor *mon, const QDict *qdict);
154 /* ioapic.c */
156 void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict);
157 void ioapic_dump_state(Monitor *mon, const QDict *qdict);
159 /* Global System Interrupts */
161 #define GSI_NUM_PINS IOAPIC_NUM_PINS
163 typedef struct GSIState {
164 qemu_irq i8259_irq[ISA_NUM_IRQS];
165 qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
166 } GSIState;
168 void gsi_handler(void *opaque, int n, int level);
170 /* vmport.c */
171 typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address);
173 static inline void vmport_init(ISABus *bus)
175 isa_create_simple(bus, "vmport");
178 void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
179 void vmmouse_get_data(uint32_t *data);
180 void vmmouse_set_data(const uint32_t *data);
182 /* pckbd.c */
184 void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
185 void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
186 MemoryRegion *region, ram_addr_t size,
187 hwaddr mask);
188 void i8042_isa_mouse_fake_event(void *opaque);
189 void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
191 /* pc.c */
192 extern int fd_bootchk;
194 bool pc_machine_is_smm_enabled(PCMachineState *pcms);
195 void pc_register_ferr_irq(qemu_irq irq);
196 void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
198 void pc_cpus_init(PCMachineState *pcms);
199 void pc_hot_add_cpu(const int64_t id, Error **errp);
200 void pc_acpi_init(const char *default_dsdt);
202 PcGuestInfo *pc_guest_info_init(PCMachineState *pcms);
204 void pc_set_legacy_acpi_data_size(void);
206 #define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
207 #define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
208 #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
209 #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
210 #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
211 #define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
214 void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
215 MemoryRegion *pci_address_space);
217 FWCfgState *xen_load_linux(PCMachineState *pcms,
218 PcGuestInfo *guest_info);
219 FWCfgState *pc_memory_init(PCMachineState *pcms,
220 MemoryRegion *system_memory,
221 MemoryRegion *rom_memory,
222 MemoryRegion **ram_memory,
223 PcGuestInfo *guest_info);
224 qemu_irq pc_allocate_cpu_irq(void);
225 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
226 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
227 ISADevice **rtc_state,
228 bool create_fdctrl,
229 bool no_vmport,
230 uint32 hpet_irqs);
231 void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
232 void pc_cmos_init(PCMachineState *pcms,
233 BusState *ide0, BusState *ide1,
234 ISADevice *s);
235 void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
236 void pc_pci_device_init(PCIBus *pci_bus);
238 typedef void (*cpu_set_smm_t)(int smm, void *arg);
240 void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
242 /* acpi_piix.c */
244 I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
245 qemu_irq sci_irq, qemu_irq smi_irq,
246 int smm_enabled, DeviceState **piix4_pm);
247 void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
249 /* hpet.c */
250 extern int no_hpet;
252 /* piix_pci.c */
253 struct PCII440FXState;
254 typedef struct PCII440FXState PCII440FXState;
256 #define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
257 #define TYPE_I440FX_PCI_DEVICE "i440FX"
259 #define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
261 PCIBus *i440fx_init(const char *host_type, const char *pci_type,
262 PCII440FXState **pi440fx_state, int *piix_devfn,
263 ISABus **isa_bus, qemu_irq *pic,
264 MemoryRegion *address_space_mem,
265 MemoryRegion *address_space_io,
266 ram_addr_t ram_size,
267 ram_addr_t below_4g_mem_size,
268 ram_addr_t above_4g_mem_size,
269 MemoryRegion *pci_memory,
270 MemoryRegion *ram_memory);
272 PCIBus *find_i440fx(void);
273 /* piix4.c */
274 extern PCIDevice *piix4_dev;
275 int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
277 /* vga.c */
278 enum vga_retrace_method {
279 VGA_RETRACE_DUMB,
280 VGA_RETRACE_PRECISE
283 extern enum vga_retrace_method vga_retrace_method;
285 int isa_vga_mm_init(hwaddr vram_base,
286 hwaddr ctrl_base, int it_shift,
287 MemoryRegion *address_space);
289 /* ne2000.c */
290 static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
292 DeviceState *dev;
293 ISADevice *isadev;
295 qemu_check_nic_model(nd, "ne2k_isa");
297 isadev = isa_try_create(bus, "ne2k_isa");
298 if (!isadev) {
299 return false;
301 dev = DEVICE(isadev);
302 qdev_prop_set_uint32(dev, "iobase", base);
303 qdev_prop_set_uint32(dev, "irq", irq);
304 qdev_set_nic_properties(dev, nd);
305 qdev_init_nofail(dev);
306 return true;
309 /* pc_sysfw.c */
310 void pc_system_firmware_init(MemoryRegion *rom_memory,
311 bool isapc_ram_fw);
313 /* pvpanic.c */
314 uint16_t pvpanic_port(void);
316 /* e820 types */
317 #define E820_RAM 1
318 #define E820_RESERVED 2
319 #define E820_ACPI 3
320 #define E820_NVS 4
321 #define E820_UNUSABLE 5
323 int e820_add_entry(uint64_t, uint64_t, uint32_t);
324 int e820_get_num_entries(void);
325 bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
327 #define PC_COMPAT_2_4 \
328 HW_COMPAT_2_4 \
330 .driver = "Haswell-" TYPE_X86_CPU,\
331 .property = "abm",\
332 .value = "off",\
335 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
336 .property = "abm",\
337 .value = "off",\
340 .driver = "Broadwell-" TYPE_X86_CPU,\
341 .property = "abm",\
342 .value = "off",\
345 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
346 .property = "abm",\
347 .value = "off",\
350 .driver = "host" "-" TYPE_X86_CPU,\
351 .property = "host-cache-info",\
352 .value = "on",\
355 .driver = TYPE_X86_CPU,\
356 .property = "check",\
357 .value = "off",\
360 .driver = "qemu64" "-" TYPE_X86_CPU,\
361 .property = "sse4a",\
362 .value = "on",\
365 .driver = "qemu64" "-" TYPE_X86_CPU,\
366 .property = "abm",\
367 .value = "on",\
370 .driver = "qemu64" "-" TYPE_X86_CPU,\
371 .property = "popcnt",\
372 .value = "on",\
375 .driver = "qemu32" "-" TYPE_X86_CPU,\
376 .property = "popcnt",\
377 .value = "on",\
378 },{\
379 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
380 .property = "rdtscp",\
381 .value = "on",\
382 },{\
383 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
384 .property = "rdtscp",\
385 .value = "on",\
386 },{\
387 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
388 .property = "rdtscp",\
389 .value = "on",\
390 },{\
391 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
392 .property = "rdtscp",\
393 .value = "on",\
397 #define PC_COMPAT_2_3 \
398 PC_COMPAT_2_4 \
399 HW_COMPAT_2_3 \
401 .driver = TYPE_X86_CPU,\
402 .property = "arat",\
403 .value = "off",\
404 },{\
405 .driver = "qemu64" "-" TYPE_X86_CPU,\
406 .property = "level",\
407 .value = stringify(4),\
408 },{\
409 .driver = "kvm64" "-" TYPE_X86_CPU,\
410 .property = "level",\
411 .value = stringify(5),\
412 },{\
413 .driver = "pentium3" "-" TYPE_X86_CPU,\
414 .property = "level",\
415 .value = stringify(2),\
416 },{\
417 .driver = "n270" "-" TYPE_X86_CPU,\
418 .property = "level",\
419 .value = stringify(5),\
420 },{\
421 .driver = "Conroe" "-" TYPE_X86_CPU,\
422 .property = "level",\
423 .value = stringify(4),\
424 },{\
425 .driver = "Penryn" "-" TYPE_X86_CPU,\
426 .property = "level",\
427 .value = stringify(4),\
428 },{\
429 .driver = "Nehalem" "-" TYPE_X86_CPU,\
430 .property = "level",\
431 .value = stringify(4),\
432 },{\
433 .driver = "n270" "-" TYPE_X86_CPU,\
434 .property = "xlevel",\
435 .value = stringify(0x8000000a),\
436 },{\
437 .driver = "Penryn" "-" TYPE_X86_CPU,\
438 .property = "xlevel",\
439 .value = stringify(0x8000000a),\
440 },{\
441 .driver = "Conroe" "-" TYPE_X86_CPU,\
442 .property = "xlevel",\
443 .value = stringify(0x8000000a),\
444 },{\
445 .driver = "Nehalem" "-" TYPE_X86_CPU,\
446 .property = "xlevel",\
447 .value = stringify(0x8000000a),\
448 },{\
449 .driver = "Westmere" "-" TYPE_X86_CPU,\
450 .property = "xlevel",\
451 .value = stringify(0x8000000a),\
452 },{\
453 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
454 .property = "xlevel",\
455 .value = stringify(0x8000000a),\
456 },{\
457 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
458 .property = "xlevel",\
459 .value = stringify(0x8000000a),\
460 },{\
461 .driver = "Haswell" "-" TYPE_X86_CPU,\
462 .property = "xlevel",\
463 .value = stringify(0x8000000a),\
464 },{\
465 .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\
466 .property = "xlevel",\
467 .value = stringify(0x8000000a),\
468 },{\
469 .driver = "Broadwell" "-" TYPE_X86_CPU,\
470 .property = "xlevel",\
471 .value = stringify(0x8000000a),\
472 },{\
473 .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
474 .property = "xlevel",\
475 .value = stringify(0x8000000a),\
478 #define PC_COMPAT_2_2 \
479 PC_COMPAT_2_3 \
480 HW_COMPAT_2_2 \
482 .driver = "kvm64" "-" TYPE_X86_CPU,\
483 .property = "vme",\
484 .value = "off",\
487 .driver = "kvm32" "-" TYPE_X86_CPU,\
488 .property = "vme",\
489 .value = "off",\
492 .driver = "Conroe" "-" TYPE_X86_CPU,\
493 .property = "vme",\
494 .value = "off",\
497 .driver = "Penryn" "-" TYPE_X86_CPU,\
498 .property = "vme",\
499 .value = "off",\
502 .driver = "Nehalem" "-" TYPE_X86_CPU,\
503 .property = "vme",\
504 .value = "off",\
507 .driver = "Westmere" "-" TYPE_X86_CPU,\
508 .property = "vme",\
509 .value = "off",\
512 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
513 .property = "vme",\
514 .value = "off",\
517 .driver = "Haswell" "-" TYPE_X86_CPU,\
518 .property = "vme",\
519 .value = "off",\
522 .driver = "Broadwell" "-" TYPE_X86_CPU,\
523 .property = "vme",\
524 .value = "off",\
527 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
528 .property = "vme",\
529 .value = "off",\
532 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
533 .property = "vme",\
534 .value = "off",\
537 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
538 .property = "vme",\
539 .value = "off",\
542 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
543 .property = "vme",\
544 .value = "off",\
547 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
548 .property = "vme",\
549 .value = "off",\
552 .driver = "Haswell" "-" TYPE_X86_CPU,\
553 .property = "f16c",\
554 .value = "off",\
557 .driver = "Haswell" "-" TYPE_X86_CPU,\
558 .property = "rdrand",\
559 .value = "off",\
562 .driver = "Broadwell" "-" TYPE_X86_CPU,\
563 .property = "f16c",\
564 .value = "off",\
567 .driver = "Broadwell" "-" TYPE_X86_CPU,\
568 .property = "rdrand",\
569 .value = "off",\
572 #define PC_COMPAT_2_1 \
573 PC_COMPAT_2_2 \
574 HW_COMPAT_2_1 \
576 .driver = "coreduo" "-" TYPE_X86_CPU,\
577 .property = "vmx",\
578 .value = "on",\
581 .driver = "core2duo" "-" TYPE_X86_CPU,\
582 .property = "vmx",\
583 .value = "on",\
586 #define PC_COMPAT_2_0 \
587 PC_COMPAT_2_1 \
589 .driver = "virtio-scsi-pci",\
590 .property = "any_layout",\
591 .value = "off",\
592 },{\
593 .driver = "PIIX4_PM",\
594 .property = "memory-hotplug-support",\
595 .value = "off",\
598 .driver = "apic",\
599 .property = "version",\
600 .value = stringify(0x11),\
603 .driver = "nec-usb-xhci",\
604 .property = "superspeed-ports-first",\
605 .value = "off",\
608 .driver = "nec-usb-xhci",\
609 .property = "force-pcie-endcap",\
610 .value = "on",\
613 .driver = "pci-serial",\
614 .property = "prog_if",\
615 .value = stringify(0),\
618 .driver = "pci-serial-2x",\
619 .property = "prog_if",\
620 .value = stringify(0),\
623 .driver = "pci-serial-4x",\
624 .property = "prog_if",\
625 .value = stringify(0),\
628 .driver = "virtio-net-pci",\
629 .property = "guest_announce",\
630 .value = "off",\
633 .driver = "ICH9-LPC",\
634 .property = "memory-hotplug-support",\
635 .value = "off",\
636 },{\
637 .driver = "xio3130-downstream",\
638 .property = COMPAT_PROP_PCP,\
639 .value = "off",\
640 },{\
641 .driver = "ioh3420",\
642 .property = COMPAT_PROP_PCP,\
643 .value = "off",\
646 #define PC_COMPAT_1_7 \
647 PC_COMPAT_2_0 \
649 .driver = TYPE_USB_DEVICE,\
650 .property = "msos-desc",\
651 .value = "no",\
654 .driver = "PIIX4_PM",\
655 .property = "acpi-pci-hotplug-with-bridge-support",\
656 .value = "off",\
659 .driver = "hpet",\
660 .property = HPET_INTCAP,\
661 .value = stringify(4),\
664 #define PC_COMPAT_1_6 \
665 PC_COMPAT_1_7 \
667 .driver = "e1000",\
668 .property = "mitigation",\
669 .value = "off",\
670 },{\
671 .driver = "qemu64-" TYPE_X86_CPU,\
672 .property = "model",\
673 .value = stringify(2),\
674 },{\
675 .driver = "qemu32-" TYPE_X86_CPU,\
676 .property = "model",\
677 .value = stringify(3),\
678 },{\
679 .driver = "i440FX-pcihost",\
680 .property = "short_root_bus",\
681 .value = stringify(1),\
682 },{\
683 .driver = "q35-pcihost",\
684 .property = "short_root_bus",\
685 .value = stringify(1),\
688 #define PC_COMPAT_1_5 \
689 PC_COMPAT_1_6 \
691 .driver = "Conroe-" TYPE_X86_CPU,\
692 .property = "model",\
693 .value = stringify(2),\
694 },{\
695 .driver = "Conroe-" TYPE_X86_CPU,\
696 .property = "level",\
697 .value = stringify(2),\
698 },{\
699 .driver = "Penryn-" TYPE_X86_CPU,\
700 .property = "model",\
701 .value = stringify(2),\
702 },{\
703 .driver = "Penryn-" TYPE_X86_CPU,\
704 .property = "level",\
705 .value = stringify(2),\
706 },{\
707 .driver = "Nehalem-" TYPE_X86_CPU,\
708 .property = "model",\
709 .value = stringify(2),\
710 },{\
711 .driver = "Nehalem-" TYPE_X86_CPU,\
712 .property = "level",\
713 .value = stringify(2),\
714 },{\
715 .driver = "virtio-net-pci",\
716 .property = "any_layout",\
717 .value = "off",\
718 },{\
719 .driver = TYPE_X86_CPU,\
720 .property = "pmu",\
721 .value = "on",\
722 },{\
723 .driver = "i440FX-pcihost",\
724 .property = "short_root_bus",\
725 .value = stringify(0),\
726 },{\
727 .driver = "q35-pcihost",\
728 .property = "short_root_bus",\
729 .value = stringify(0),\
732 #define PC_COMPAT_1_4 \
733 PC_COMPAT_1_5 \
735 .driver = "scsi-hd",\
736 .property = "discard_granularity",\
737 .value = stringify(0),\
738 },{\
739 .driver = "scsi-cd",\
740 .property = "discard_granularity",\
741 .value = stringify(0),\
742 },{\
743 .driver = "scsi-disk",\
744 .property = "discard_granularity",\
745 .value = stringify(0),\
746 },{\
747 .driver = "ide-hd",\
748 .property = "discard_granularity",\
749 .value = stringify(0),\
750 },{\
751 .driver = "ide-cd",\
752 .property = "discard_granularity",\
753 .value = stringify(0),\
754 },{\
755 .driver = "ide-drive",\
756 .property = "discard_granularity",\
757 .value = stringify(0),\
758 },{\
759 .driver = "virtio-blk-pci",\
760 .property = "discard_granularity",\
761 .value = stringify(0),\
762 },{\
763 .driver = "virtio-serial-pci",\
764 .property = "vectors",\
765 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
766 .value = stringify(0xFFFFFFFF),\
767 },{ \
768 .driver = "virtio-net-pci", \
769 .property = "ctrl_guest_offloads", \
770 .value = "off", \
771 },{\
772 .driver = "e1000",\
773 .property = "romfile",\
774 .value = "pxe-e1000.rom",\
775 },{\
776 .driver = "ne2k_pci",\
777 .property = "romfile",\
778 .value = "pxe-ne2k_pci.rom",\
779 },{\
780 .driver = "pcnet",\
781 .property = "romfile",\
782 .value = "pxe-pcnet.rom",\
783 },{\
784 .driver = "rtl8139",\
785 .property = "romfile",\
786 .value = "pxe-rtl8139.rom",\
787 },{\
788 .driver = "virtio-net-pci",\
789 .property = "romfile",\
790 .value = "pxe-virtio.rom",\
791 },{\
792 .driver = "486-" TYPE_X86_CPU,\
793 .property = "model",\
794 .value = stringify(0),\
797 .driver = "n270" "-" TYPE_X86_CPU,\
798 .property = "movbe",\
799 .value = "off",\
802 .driver = "Westmere" "-" TYPE_X86_CPU,\
803 .property = "pclmulqdq",\
804 .value = "off",\
807 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
808 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
810 MachineClass *mc = MACHINE_CLASS(oc); \
811 optsfn(mc); \
812 mc->name = namestr; \
813 mc->init = initfn; \
815 static const TypeInfo pc_machine_type_##suffix = { \
816 .name = namestr TYPE_MACHINE_SUFFIX, \
817 .parent = TYPE_PC_MACHINE, \
818 .class_init = pc_machine_##suffix##_class_init, \
819 }; \
820 static void pc_machine_init_##suffix(void) \
822 type_register(&pc_machine_type_##suffix); \
824 machine_init(pc_machine_init_##suffix)
826 #define SET_MACHINE_COMPAT(m, COMPAT) do { \
827 static GlobalProperty props[] = { \
828 COMPAT \
829 { /* end of list */ } \
830 }; \
831 (m)->compat_props = props; \
832 } while (0)
834 extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
835 #endif