]> Git Repo - qemu.git/blame - include/hw/i386/pc.h
pc: Move legacy_acpi_table_size global to PCMachineClass
[qemu.git] / include / hw / i386 / pc.h
CommitLineData
87ecb68b
PB
1#ifndef HW_PC_H
2#define HW_PC_H
376253ec
AL
3
4#include "qemu-common.h"
8170dfa0 5#include "qemu/typedefs.h"
022c62cb 6#include "exec/memory.h"
9521d42b 7#include "hw/boards.h"
0d09e41a
PB
8#include "hw/isa/isa.h"
9#include "hw/block/fdc.h"
1422e32d 10#include "net/net.h"
0d09e41a 11#include "hw/i386/ioapic.h"
376253ec 12
3459a625 13#include "qemu/range.h"
b20c9bd5
MT
14#include "qemu/bitmap.h"
15#include "sysemu/sysemu.h"
16#include "hw/pci/pci.h"
d5747cac 17#include "hw/boards.h"
68a27b20 18#include "hw/compat.h"
a7d69ff1 19#include "hw/mem/pc-dimm.h"
3459a625 20
7a10ef51
LPF
21#define HPET_INTCAP "hpet-intcap"
22
15eafc2e
PB
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
35
619d11e4
IM
36/**
37 * PCMachineState:
781bbd6b 38 * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
91aa70ab
IM
39 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
40 * backend's alignment value if provided
619d11e4 41 */
d5747cac
IM
42struct PCMachineState {
43 /*< private >*/
44 MachineState parent_obj;
619d11e4
IM
45
46 /* <public> */
a7d69ff1 47 MemoryHotplugState hotplug_memory;
781bbd6b
IM
48
49 HotplugHandler *acpi_dev;
2d996150 50 ISADevice *rtc;
c87b1520
DS
51
52 uint64_t max_ram_below_4g;
d1048bef 53 OnOffAuto vmport;
355023f2 54 OnOffAuto smm;
91aa70ab 55 bool enforce_aligned_dimm;
c0aa4e1e 56 ram_addr_t below_4g_mem_size, above_4g_mem_size;
d5747cac
IM
57};
58
781bbd6b 59#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
bf1e8939 60#define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
c87b1520 61#define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
9b23cfb7 62#define PC_MACHINE_VMPORT "vmport"
355023f2 63#define PC_MACHINE_SMM "smm"
91aa70ab 64#define PC_MACHINE_ENFORCE_ALIGNED_DIMM "enforce-aligned-dimm"
781bbd6b 65
95bee274
IM
66/**
67 * PCMachineClass:
68 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
69 */
d5747cac
IM
70struct PCMachineClass {
71 /*< private >*/
72 MachineClass parent_class;
95bee274
IM
73
74 /*< public >*/
2f8b5008 75 bool broken_reserved_end;
95bee274
IM
76 HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
77 DeviceState *dev);
7102fa70
EH
78
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.
88 */
89 bool gigabyte_align;
90 bool has_reserved_memory;
91 bool kvmclock_enabled;
2b0ddf66 92 int legacy_acpi_table_size;
d5747cac
IM
93};
94
d5747cac
IM
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)
102
87ecb68b
PB
103/* PC-style peripherals (also used by other machines). */
104
3459a625
MT
105typedef struct PcPciInfo {
106 Range w32;
107 Range w64;
108} PcPciInfo;
109
f854ecc7
MT
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"
92055797 119#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
f854ecc7 120
3459a625 121struct PcGuestInfo {
6dd2a5c9 122 bool isapc_ram_fw;
f30ee8a9 123 hwaddr ram_size, ram_size_below_4g;
b20c9bd5
MT
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;
3459a625 129 FWCfgState *fw_cfg;
07fb6176 130 int legacy_acpi_table_size;
72c194f7 131 bool has_acpi_build;
de268e13 132 bool has_reserved_memory;
384fb32e 133 bool rsdp_in_ram;
3459a625
MT
134};
135
87ecb68b 136/* parallel.c */
07dc7880
MA
137
138void parallel_hds_isa_init(ISABus *bus, int n);
defdb20e 139
63858cd9 140bool parallel_mm_init(MemoryRegion *address_space,
a8170e5e 141 hwaddr base, int it_shift, qemu_irq irq,
defdb20e 142 CharDriverState *chr);
87ecb68b
PB
143
144/* i8259.c */
145
9aa78c42 146extern DeviceState *isa_pic;
48a18b3c 147qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
10b61882 148qemu_irq *kvm_i8259_init(ISABus *bus);
9aa78c42
JK
149int pic_read_irq(DeviceState *d);
150int pic_get_output(DeviceState *d);
1ce6be24
MA
151void hmp_info_pic(Monitor *mon, const QDict *qdict);
152void hmp_info_irq(Monitor *mon, const QDict *qdict);
87ecb68b 153
d665d696
PB
154/* ioapic.c */
155
156void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict);
6bde8fd6 157void ioapic_dump_state(Monitor *mon, const QDict *qdict);
d665d696 158
b881fbe9 159/* Global System Interrupts */
96051119 160
b881fbe9 161#define GSI_NUM_PINS IOAPIC_NUM_PINS
845773ab 162
b881fbe9 163typedef struct GSIState {
43a0db35 164 qemu_irq i8259_irq[ISA_NUM_IRQS];
b881fbe9
JK
165 qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
166} GSIState;
167
168void gsi_handler(void *opaque, int n, int level);
845773ab 169
87ecb68b 170/* vmport.c */
d67f679d
JK
171typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address);
172
48a18b3c 173static inline void vmport_init(ISABus *bus)
6872ef61 174{
48a18b3c 175 isa_create_simple(bus, "vmport");
6872ef61 176}
d67f679d
JK
177
178void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
86d86414
BS
179void vmmouse_get_data(uint32_t *data);
180void vmmouse_set_data(const uint32_t *data);
87ecb68b 181
87ecb68b
PB
182/* pckbd.c */
183
184void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
185void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
dbff76ac 186 MemoryRegion *region, ram_addr_t size,
a8170e5e 187 hwaddr mask);
956a3e6b
BS
188void i8042_isa_mouse_fake_event(void *opaque);
189void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
87ecb68b 190
87ecb68b
PB
191/* pc.c */
192extern int fd_bootchk;
193
355023f2 194bool pc_machine_is_smm_enabled(PCMachineState *pcms);
8e78eb28 195void pc_register_ferr_irq(qemu_irq irq);
845773ab
IY
196void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
197
4884b7bf 198void pc_cpus_init(PCMachineState *pcms);
c649983b 199void pc_hot_add_cpu(const int64_t id, Error **errp);
f7e4dd6c 200void pc_acpi_init(const char *default_dsdt);
3459a625 201
b9cfc918 202PcGuestInfo *pc_guest_info_init(PCMachineState *pcms);
3459a625 203
927766c7
MT
204void pc_set_legacy_acpi_data_size(void);
205
39848901
IM
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"
1466cef3
MT
211#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
212
39848901 213
83d08f26
MT
214void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
215 MemoryRegion *pci_address_space);
39848901 216
df1f79fd 217FWCfgState *xen_load_linux(PCMachineState *pcms,
b33a5bbf 218 PcGuestInfo *guest_info);
62b160c0 219FWCfgState *pc_memory_init(PCMachineState *pcms,
9521d42b 220 MemoryRegion *system_memory,
a88b362c 221 MemoryRegion *rom_memory,
3459a625
MT
222 MemoryRegion **ram_memory,
223 PcGuestInfo *guest_info);
0b0cc076 224qemu_irq pc_allocate_cpu_irq(void);
48a18b3c
HP
225DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
226void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
1611977c 227 ISADevice **rtc_state,
fd53c87c 228 bool create_fdctrl,
7a10ef51
LPF
229 bool no_vmport,
230 uint32 hpet_irqs);
48a18b3c 231void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
23d30407 232void pc_cmos_init(PCMachineState *pcms,
220a8846 233 BusState *ide0, BusState *ide1,
63ffb564 234 ISADevice *s);
9011a1a7 235void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
845773ab 236void pc_pci_device_init(PCIBus *pci_bus);
8e78eb28 237
f885f1ea 238typedef void (*cpu_set_smm_t)(int smm, void *arg);
f885f1ea 239
a39e3564
JB
240void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
241
9d5e77a2 242/* acpi_piix.c */
53b67b30 243
a5c82852
AF
244I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
245 qemu_irq sci_irq, qemu_irq smi_irq,
61e66c62 246 int smm_enabled, DeviceState **piix4_pm);
87ecb68b 247void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
87ecb68b 248
16b29ae1
AL
249/* hpet.c */
250extern int no_hpet;
251
87ecb68b 252/* piix_pci.c */
0a3bacf3
JQ
253struct PCII440FXState;
254typedef struct PCII440FXState PCII440FXState;
255
7bb836e4
MT
256#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
257#define TYPE_I440FX_PCI_DEVICE "i440FX"
258
595a4f07
TC
259#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
260
7bb836e4
MT
261PCIBus *i440fx_init(const char *host_type, const char *pci_type,
262 PCII440FXState **pi440fx_state, int *piix_devfn,
60573079 263 ISABus **isa_bus, qemu_irq *pic,
aee97b84
AK
264 MemoryRegion *address_space_mem,
265 MemoryRegion *address_space_io,
ae0a5466 266 ram_addr_t ram_size,
ddaaefb4 267 ram_addr_t below_4g_mem_size,
39848901 268 ram_addr_t above_4g_mem_size,
ae0a5466
AK
269 MemoryRegion *pci_memory,
270 MemoryRegion *ram_memory);
87ecb68b 271
277e9340 272PCIBus *find_i440fx(void);
823e675a 273/* piix4.c */
b1d8e52e 274extern PCIDevice *piix4_dev;
142e9787 275int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
87ecb68b
PB
276
277/* vga.c */
cb5a7aa8 278enum vga_retrace_method {
279 VGA_RETRACE_DUMB,
280 VGA_RETRACE_PRECISE
281};
282
283extern enum vga_retrace_method vga_retrace_method;
87ecb68b 284
a8170e5e
AK
285int isa_vga_mm_init(hwaddr vram_base,
286 hwaddr ctrl_base, int it_shift,
be20f9e9 287 MemoryRegion *address_space);
87ecb68b 288
87ecb68b 289/* ne2000.c */
48a18b3c 290static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
60a14ad3 291{
4a17cc4f
AF
292 DeviceState *dev;
293 ISADevice *isadev;
87ecb68b 294
60a14ad3
BS
295 qemu_check_nic_model(nd, "ne2k_isa");
296
4a17cc4f
AF
297 isadev = isa_try_create(bus, "ne2k_isa");
298 if (!isadev) {
cd1b8a8b
BS
299 return false;
300 }
4a17cc4f
AF
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);
cd1b8a8b 306 return true;
60a14ad3 307}
87ecb68b 308
cbc5b5f3 309/* pc_sysfw.c */
6dd2a5c9
PB
310void pc_system_firmware_init(MemoryRegion *rom_memory,
311 bool isapc_ram_fw);
cbc5b5f3 312
3ab135f3 313/* pvpanic.c */
309cd62d 314uint16_t pvpanic_port(void);
3ab135f3 315
4c5b10b7
JS
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
322
323int e820_add_entry(uint64_t, uint64_t, uint32_t);
7bf8ef19
GS
324int e820_get_num_entries(void);
325bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
4c5b10b7 326
87e896ab 327#define PC_COMPAT_2_4 \
becb6667
PB
328 HW_COMPAT_2_4 \
329 {\
330 .driver = "Haswell-" TYPE_X86_CPU,\
331 .property = "abm",\
332 .value = "off",\
333 },\
334 {\
335 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
336 .property = "abm",\
337 .value = "off",\
338 },\
339 {\
340 .driver = "Broadwell-" TYPE_X86_CPU,\
341 .property = "abm",\
342 .value = "off",\
343 },\
344 {\
345 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
346 .property = "abm",\
347 .value = "off",\
e265e3e4
EH
348 },\
349 {\
350 .driver = "host" "-" TYPE_X86_CPU,\
351 .property = "host-cache-info",\
352 .value = "on",\
3e684822
EH
353 },\
354 {\
355 .driver = TYPE_X86_CPU,\
356 .property = "check",\
357 .value = "off",\
0909ad24
EH
358 },\
359 {\
360 .driver = "qemu64" "-" TYPE_X86_CPU,\
361 .property = "sse4a",\
362 .value = "on",\
71195672
EH
363 },\
364 {\
365 .driver = "qemu64" "-" TYPE_X86_CPU,\
366 .property = "abm",\
367 .value = "on",\
6aa91e4a
EH
368 },\
369 {\
370 .driver = "qemu64" "-" TYPE_X86_CPU,\
371 .property = "popcnt",\
372 .value = "on",\
373 },\
374 {\
375 .driver = "qemu32" "-" TYPE_X86_CPU,\
376 .property = "popcnt",\
377 .value = "on",\
33b5e8c0
EH
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",\
becb6667 394 },
87e896ab 395
33b5e8c0 396
42134ac9 397#define PC_COMPAT_2_3 \
87e896ab 398 PC_COMPAT_2_4 \
28b8e4d0
JK
399 HW_COMPAT_2_3 \
400 {\
401 .driver = TYPE_X86_CPU,\
402 .property = "arat",\
403 .value = "off",\
3046bb5d
RK
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),\
27751aab
RK
456 },{\
457 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
458 .property = "xlevel",\
459 .value = stringify(0x8000000a),\
3046bb5d
RK
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),\
28b8e4d0 476 },
42134ac9
EH
477
478#define PC_COMPAT_2_2 \
479 PC_COMPAT_2_3 \
27add381
EH
480 HW_COMPAT_2_2 \
481 {\
482 .driver = "kvm64" "-" TYPE_X86_CPU,\
483 .property = "vme",\
484 .value = "off",\
485 },\
486 {\
487 .driver = "kvm32" "-" TYPE_X86_CPU,\
488 .property = "vme",\
489 .value = "off",\
490 },\
491 {\
492 .driver = "Conroe" "-" TYPE_X86_CPU,\
493 .property = "vme",\
494 .value = "off",\
495 },\
496 {\
497 .driver = "Penryn" "-" TYPE_X86_CPU,\
498 .property = "vme",\
499 .value = "off",\
500 },\
501 {\
502 .driver = "Nehalem" "-" TYPE_X86_CPU,\
503 .property = "vme",\
504 .value = "off",\
505 },\
506 {\
507 .driver = "Westmere" "-" TYPE_X86_CPU,\
508 .property = "vme",\
509 .value = "off",\
510 },\
511 {\
512 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
513 .property = "vme",\
514 .value = "off",\
515 },\
516 {\
517 .driver = "Haswell" "-" TYPE_X86_CPU,\
518 .property = "vme",\
519 .value = "off",\
520 },\
521 {\
522 .driver = "Broadwell" "-" TYPE_X86_CPU,\
523 .property = "vme",\
524 .value = "off",\
525 },\
526 {\
527 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
528 .property = "vme",\
529 .value = "off",\
530 },\
531 {\
532 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
533 .property = "vme",\
534 .value = "off",\
535 },\
536 {\
537 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
538 .property = "vme",\
539 .value = "off",\
540 },\
541 {\
542 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
543 .property = "vme",\
544 .value = "off",\
545 },\
546 {\
547 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
548 .property = "vme",\
549 .value = "off",\
550 },\
551 {\
552 .driver = "Haswell" "-" TYPE_X86_CPU,\
553 .property = "f16c",\
554 .value = "off",\
555 },\
556 {\
557 .driver = "Haswell" "-" TYPE_X86_CPU,\
558 .property = "rdrand",\
559 .value = "off",\
560 },\
561 {\
562 .driver = "Broadwell" "-" TYPE_X86_CPU,\
563 .property = "f16c",\
564 .value = "off",\
565 },\
566 {\
567 .driver = "Broadwell" "-" TYPE_X86_CPU,\
568 .property = "rdrand",\
569 .value = "off",\
570 },
42134ac9
EH
571
572#define PC_COMPAT_2_1 \
573 PC_COMPAT_2_2 \
27add381
EH
574 HW_COMPAT_2_1 \
575 {\
576 .driver = "coreduo" "-" TYPE_X86_CPU,\
577 .property = "vmx",\
578 .value = "on",\
579 },\
580 {\
581 .driver = "core2duo" "-" TYPE_X86_CPU,\
582 .property = "vmx",\
583 .value = "on",\
584 },
42134ac9 585
9df11c9f 586#define PC_COMPAT_2_0 \
42134ac9 587 PC_COMPAT_2_1 \
9df11c9f 588 {\
3eff1f46
PB
589 .driver = "virtio-scsi-pci",\
590 .property = "any_layout",\
591 .value = "off",\
592 },{\
34774320
IM
593 .driver = "PIIX4_PM",\
594 .property = "memory-hotplug-support",\
595 .value = "off",\
596 },\
9df11c9f 597 {\
aa93200b
GS
598 .driver = "apic",\
599 .property = "version",\
600 .value = stringify(0x11),\
34774320
IM
601 },\
602 {\
7bafd888
GH
603 .driver = "nec-usb-xhci",\
604 .property = "superspeed-ports-first",\
605 .value = "off",\
13cc2c3e 606 },\
e6043e92
DDAG
607 {\
608 .driver = "nec-usb-xhci",\
609 .property = "force-pcie-endcap",\
610 .value = "on",\
611 },\
13cc2c3e
BZ
612 {\
613 .driver = "pci-serial",\
614 .property = "prog_if",\
615 .value = stringify(0),\
616 },\
617 {\
618 .driver = "pci-serial-2x",\
fa118d1f 619 .property = "prog_if",\
13cc2c3e
BZ
620 .value = stringify(0),\
621 },\
622 {\
623 .driver = "pci-serial-4x",\
624 .property = "prog_if",\
625 .value = stringify(0),\
f57fcf70
JW
626 },\
627 {\
628 .driver = "virtio-net-pci",\
629 .property = "guest_announce",\
630 .value = "off",\
b8f5cfd6
EH
631 },\
632 {\
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",\
a7cde24d 644 },
9df11c9f 645
5319dc7b 646#define PC_COMPAT_1_7 \
a7cde24d 647 PC_COMPAT_2_0 \
5319dc7b
GH
648 {\
649 .driver = TYPE_USB_DEVICE,\
650 .property = "msos-desc",\
651 .value = "no",\
9e047b98
MT
652 },\
653 {\
654 .driver = "PIIX4_PM",\
655 .property = "acpi-pci-hotplug-with-bridge-support",\
656 .value = "off",\
b8f5cfd6
EH
657 },\
658 {\
659 .driver = "hpet",\
660 .property = HPET_INTCAP,\
661 .value = stringify(4),\
a7cde24d 662 },
5319dc7b 663
e9845f09 664#define PC_COMPAT_1_6 \
a7cde24d 665 PC_COMPAT_1_7 \
e9845f09
VM
666 {\
667 .driver = "e1000",\
668 .property = "mitigation",\
669 .value = "off",\
f8e6a11a
EH
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),\
04c7d8b8
CR
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),\
a7cde24d 686 },
e9845f09 687
ffce9ebb 688#define PC_COMPAT_1_5 \
a7cde24d 689 PC_COMPAT_1_6 \
ffce9ebb
EH
690 {\
691 .driver = "Conroe-" TYPE_X86_CPU,\
692 .property = "model",\
693 .value = stringify(2),\
6b11322e
EH
694 },{\
695 .driver = "Conroe-" TYPE_X86_CPU,\
696 .property = "level",\
697 .value = stringify(2),\
ffce9ebb
EH
698 },{\
699 .driver = "Penryn-" TYPE_X86_CPU,\
700 .property = "model",\
701 .value = stringify(2),\
6b11322e
EH
702 },{\
703 .driver = "Penryn-" TYPE_X86_CPU,\
704 .property = "level",\
705 .value = stringify(2),\
ffce9ebb
EH
706 },{\
707 .driver = "Nehalem-" TYPE_X86_CPU,\
708 .property = "model",\
709 .value = stringify(2),\
6b11322e
EH
710 },{\
711 .driver = "Nehalem-" TYPE_X86_CPU,\
712 .property = "level",\
713 .value = stringify(2),\
488f069b
MT
714 },{\
715 .driver = "virtio-net-pci",\
716 .property = "any_layout",\
717 .value = "off",\
9337e3b6
EH
718 },{\
719 .driver = TYPE_X86_CPU,\
720 .property = "pmu",\
721 .value = "on",\
04c7d8b8
CR
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),\
a7cde24d 730 },
ffce9ebb 731
bf3caa3d 732#define PC_COMPAT_1_4 \
a7cde24d 733 PC_COMPAT_1_5 \
bf3caa3d
PB
734 {\
735 .driver = "scsi-hd",\
736 .property = "discard_granularity",\
737 .value = stringify(0),\
4974920a 738 },{\
bf3caa3d
PB
739 .driver = "scsi-cd",\
740 .property = "discard_granularity",\
741 .value = stringify(0),\
4974920a 742 },{\
bf3caa3d
PB
743 .driver = "scsi-disk",\
744 .property = "discard_granularity",\
745 .value = stringify(0),\
4974920a 746 },{\
bf3caa3d
PB
747 .driver = "ide-hd",\
748 .property = "discard_granularity",\
749 .value = stringify(0),\
4974920a 750 },{\
bf3caa3d
PB
751 .driver = "ide-cd",\
752 .property = "discard_granularity",\
753 .value = stringify(0),\
4974920a 754 },{\
bf3caa3d
PB
755 .driver = "ide-drive",\
756 .property = "discard_granularity",\
757 .value = stringify(0),\
c45e5b5b 758 },{\
bf3caa3d
PB
759 .driver = "virtio-blk-pci",\
760 .property = "discard_granularity",\
761 .value = stringify(0),\
4974920a 762 },{\
554f1997
GH
763 .driver = "virtio-serial-pci",\
764 .property = "vectors",\
765 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
766 .value = stringify(0xFFFFFFFF),\
644c9858
DF
767 },{ \
768 .driver = "virtio-net-pci", \
769 .property = "ctrl_guest_offloads", \
770 .value = "off", \
c45e5b5b
GH
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",\
b2a856d9
AF
791 },{\
792 .driver = "486-" TYPE_X86_CPU,\
793 .property = "model",\
794 .value = stringify(0),\
27add381
EH
795 },\
796 {\
797 .driver = "n270" "-" TYPE_X86_CPU,\
798 .property = "movbe",\
799 .value = "off",\
800 },\
801 {\
802 .driver = "Westmere" "-" TYPE_X86_CPU,\
803 .property = "pclmulqdq",\
804 .value = "off",\
a7cde24d 805 },
bf3caa3d 806
25519b06 807#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
865906f7
EH
808 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
809 { \
810 MachineClass *mc = MACHINE_CLASS(oc); \
811 optsfn(mc); \
812 mc->name = namestr; \
813 mc->init = initfn; \
814 } \
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 }; \
61f219df
EH
820 static void pc_machine_init_##suffix(void) \
821 { \
865906f7 822 type_register(&pc_machine_type_##suffix); \
61f219df
EH
823 } \
824 machine_init(pc_machine_init_##suffix)
825
25519b06
EH
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)
833
bd8107d7 834extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
87ecb68b 835#endif
This page took 0.911443 seconds and 4 git commands to generate.