]> Git Repo - qemu.git/blame - include/hw/i386/pc.h
fpu: Replace int32 typedef with int32_t
[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
619d11e4 39 */
d5747cac
IM
40struct PCMachineState {
41 /*< private >*/
42 MachineState parent_obj;
619d11e4
IM
43
44 /* <public> */
13fc8343
EH
45
46 /* State for other subsystems/APIs: */
a7d69ff1 47 MemoryHotplugState hotplug_memory;
781bbd6b 48
13fc8343 49 /* Pointers to devices and objects: */
781bbd6b 50 HotplugHandler *acpi_dev;
2d996150 51 ISADevice *rtc;
13fc8343 52 PCIBus *bus;
c87b1520 53
13fc8343 54 /* Configuration options: */
c87b1520 55 uint64_t max_ram_below_4g;
d1048bef 56 OnOffAuto vmport;
355023f2 57 OnOffAuto smm;
87252e1b 58 bool nvdimm;
13fc8343
EH
59
60 /* RAM information (sizes, addresses, configuration): */
c0aa4e1e 61 ram_addr_t below_4g_mem_size, above_4g_mem_size;
d5747cac
IM
62};
63
781bbd6b 64#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
bf1e8939 65#define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
c87b1520 66#define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
9b23cfb7 67#define PC_MACHINE_VMPORT "vmport"
355023f2 68#define PC_MACHINE_SMM "smm"
87252e1b 69#define PC_MACHINE_NVDIMM "nvdimm"
781bbd6b 70
95bee274
IM
71/**
72 * PCMachineClass:
13fc8343
EH
73 *
74 * Methods:
75 *
95bee274 76 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
13fc8343
EH
77 *
78 * Compat fields:
79 *
16a9e8a5
EH
80 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
81 * backend's alignment value if provided
13fc8343
EH
82 * @acpi_data_size: Size of the chunk of memory at the top of RAM
83 * for the BIOS ACPI tables and other BIOS
84 * datastructures.
85 * @gigabyte_align: Make sure that guest addresses aligned at
86 * 1Gbyte boundaries get mapped to host
87 * addresses aligned at 1Gbyte boundaries. This
88 * way we can use 1GByte pages in the host.
89 *
95bee274 90 */
d5747cac
IM
91struct PCMachineClass {
92 /*< private >*/
93 MachineClass parent_class;
95bee274
IM
94
95 /*< public >*/
13fc8343
EH
96
97 /* Methods: */
95bee274
IM
98 HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
99 DeviceState *dev);
7102fa70 100
13fc8343 101 /* Device configuration: */
7102fa70 102 bool pci_enabled;
13fc8343
EH
103 bool kvmclock_enabled;
104
105 /* Compat options: */
106
107 /* ACPI compat: */
7102fa70
EH
108 bool has_acpi_build;
109 bool rsdp_in_ram;
13fc8343
EH
110 int legacy_acpi_table_size;
111 unsigned acpi_data_size;
112
113 /* SMBIOS compat: */
7102fa70
EH
114 bool smbios_defaults;
115 bool smbios_legacy_mode;
116 bool smbios_uuid_encoded;
13fc8343
EH
117
118 /* RAM / address space compat: */
7102fa70
EH
119 bool gigabyte_align;
120 bool has_reserved_memory;
16a9e8a5 121 bool enforce_aligned_dimm;
13fc8343 122 bool broken_reserved_end;
36f96c4b
HZ
123
124 /* TSC rate migration: */
125 bool save_tsc_khz;
d5747cac
IM
126};
127
d5747cac
IM
128#define TYPE_PC_MACHINE "generic-pc-machine"
129#define PC_MACHINE(obj) \
130 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
131#define PC_MACHINE_GET_CLASS(obj) \
132 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
133#define PC_MACHINE_CLASS(klass) \
134 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
135
87ecb68b
PB
136/* PC-style peripherals (also used by other machines). */
137
3459a625
MT
138typedef struct PcPciInfo {
139 Range w32;
140 Range w64;
141} PcPciInfo;
142
f854ecc7
MT
143#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
144#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
145#define ACPI_PM_PROP_S4_VAL "s4_val"
146#define ACPI_PM_PROP_SCI_INT "sci_int"
147#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
148#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
149#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
150#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
151#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
92055797 152#define ACPI_PM_PROP_TCO_ENABLED "enable_tco"
f854ecc7 153
3459a625 154struct PcGuestInfo {
6dd2a5c9 155 bool isapc_ram_fw;
f30ee8a9 156 hwaddr ram_size, ram_size_below_4g;
b20c9bd5
MT
157 unsigned apic_id_limit;
158 bool apic_xrupt_override;
159 uint64_t numa_nodes;
160 uint64_t *node_mem;
161 uint64_t *node_cpu;
3459a625 162 FWCfgState *fw_cfg;
07fb6176 163 int legacy_acpi_table_size;
72c194f7 164 bool has_acpi_build;
de268e13 165 bool has_reserved_memory;
384fb32e 166 bool rsdp_in_ram;
3459a625
MT
167};
168
87ecb68b 169/* parallel.c */
07dc7880
MA
170
171void parallel_hds_isa_init(ISABus *bus, int n);
defdb20e 172
63858cd9 173bool parallel_mm_init(MemoryRegion *address_space,
a8170e5e 174 hwaddr base, int it_shift, qemu_irq irq,
defdb20e 175 CharDriverState *chr);
87ecb68b
PB
176
177/* i8259.c */
178
9aa78c42 179extern DeviceState *isa_pic;
48a18b3c 180qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
10b61882 181qemu_irq *kvm_i8259_init(ISABus *bus);
9aa78c42
JK
182int pic_read_irq(DeviceState *d);
183int pic_get_output(DeviceState *d);
1ce6be24
MA
184void hmp_info_pic(Monitor *mon, const QDict *qdict);
185void hmp_info_irq(Monitor *mon, const QDict *qdict);
87ecb68b 186
d665d696
PB
187/* ioapic.c */
188
189void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict);
6bde8fd6 190void ioapic_dump_state(Monitor *mon, const QDict *qdict);
d665d696 191
b881fbe9 192/* Global System Interrupts */
96051119 193
b881fbe9 194#define GSI_NUM_PINS IOAPIC_NUM_PINS
845773ab 195
b881fbe9 196typedef struct GSIState {
43a0db35 197 qemu_irq i8259_irq[ISA_NUM_IRQS];
b881fbe9
JK
198 qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
199} GSIState;
200
201void gsi_handler(void *opaque, int n, int level);
845773ab 202
87ecb68b 203/* vmport.c */
d67f679d
JK
204typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address);
205
48a18b3c 206static inline void vmport_init(ISABus *bus)
6872ef61 207{
48a18b3c 208 isa_create_simple(bus, "vmport");
6872ef61 209}
d67f679d
JK
210
211void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
86d86414
BS
212void vmmouse_get_data(uint32_t *data);
213void vmmouse_set_data(const uint32_t *data);
87ecb68b 214
87ecb68b
PB
215/* pckbd.c */
216
217void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
218void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
dbff76ac 219 MemoryRegion *region, ram_addr_t size,
a8170e5e 220 hwaddr mask);
956a3e6b
BS
221void i8042_isa_mouse_fake_event(void *opaque);
222void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
87ecb68b 223
87ecb68b
PB
224/* pc.c */
225extern int fd_bootchk;
226
355023f2 227bool pc_machine_is_smm_enabled(PCMachineState *pcms);
8e78eb28 228void pc_register_ferr_irq(qemu_irq irq);
845773ab
IY
229void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
230
4884b7bf 231void pc_cpus_init(PCMachineState *pcms);
c649983b 232void pc_hot_add_cpu(const int64_t id, Error **errp);
f7e4dd6c 233void pc_acpi_init(const char *default_dsdt);
3459a625 234
b9cfc918 235PcGuestInfo *pc_guest_info_init(PCMachineState *pcms);
3459a625 236
39848901
IM
237#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
238#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
239#define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
240#define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
241#define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
1466cef3
MT
242#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
243
39848901 244
83d08f26
MT
245void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
246 MemoryRegion *pci_address_space);
39848901 247
df1f79fd 248FWCfgState *xen_load_linux(PCMachineState *pcms,
b33a5bbf 249 PcGuestInfo *guest_info);
62b160c0 250FWCfgState *pc_memory_init(PCMachineState *pcms,
9521d42b 251 MemoryRegion *system_memory,
a88b362c 252 MemoryRegion *rom_memory,
3459a625
MT
253 MemoryRegion **ram_memory,
254 PcGuestInfo *guest_info);
0b0cc076 255qemu_irq pc_allocate_cpu_irq(void);
48a18b3c
HP
256DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
257void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
1611977c 258 ISADevice **rtc_state,
fd53c87c 259 bool create_fdctrl,
7a10ef51
LPF
260 bool no_vmport,
261 uint32 hpet_irqs);
48a18b3c 262void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
23d30407 263void pc_cmos_init(PCMachineState *pcms,
220a8846 264 BusState *ide0, BusState *ide1,
63ffb564 265 ISADevice *s);
9011a1a7 266void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
845773ab 267void pc_pci_device_init(PCIBus *pci_bus);
8e78eb28 268
f885f1ea 269typedef void (*cpu_set_smm_t)(int smm, void *arg);
f885f1ea 270
a39e3564
JB
271void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
272
424e4a87
RK
273ISADevice *pc_find_fdc0(void);
274
9d5e77a2 275/* acpi_piix.c */
53b67b30 276
a5c82852
AF
277I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
278 qemu_irq sci_irq, qemu_irq smi_irq,
61e66c62 279 int smm_enabled, DeviceState **piix4_pm);
87ecb68b 280void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
87ecb68b 281
16b29ae1
AL
282/* hpet.c */
283extern int no_hpet;
284
87ecb68b 285/* piix_pci.c */
0a3bacf3
JQ
286struct PCII440FXState;
287typedef struct PCII440FXState PCII440FXState;
288
7bb836e4
MT
289#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"
290#define TYPE_I440FX_PCI_DEVICE "i440FX"
291
595a4f07
TC
292#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX"
293
7bb836e4
MT
294PCIBus *i440fx_init(const char *host_type, const char *pci_type,
295 PCII440FXState **pi440fx_state, int *piix_devfn,
60573079 296 ISABus **isa_bus, qemu_irq *pic,
aee97b84
AK
297 MemoryRegion *address_space_mem,
298 MemoryRegion *address_space_io,
ae0a5466 299 ram_addr_t ram_size,
ddaaefb4 300 ram_addr_t below_4g_mem_size,
39848901 301 ram_addr_t above_4g_mem_size,
ae0a5466
AK
302 MemoryRegion *pci_memory,
303 MemoryRegion *ram_memory);
87ecb68b 304
277e9340 305PCIBus *find_i440fx(void);
823e675a 306/* piix4.c */
b1d8e52e 307extern PCIDevice *piix4_dev;
142e9787 308int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
87ecb68b
PB
309
310/* vga.c */
cb5a7aa8 311enum vga_retrace_method {
312 VGA_RETRACE_DUMB,
313 VGA_RETRACE_PRECISE
314};
315
316extern enum vga_retrace_method vga_retrace_method;
87ecb68b 317
a8170e5e
AK
318int isa_vga_mm_init(hwaddr vram_base,
319 hwaddr ctrl_base, int it_shift,
be20f9e9 320 MemoryRegion *address_space);
87ecb68b 321
87ecb68b 322/* ne2000.c */
48a18b3c 323static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
60a14ad3 324{
4a17cc4f
AF
325 DeviceState *dev;
326 ISADevice *isadev;
87ecb68b 327
60a14ad3
BS
328 qemu_check_nic_model(nd, "ne2k_isa");
329
4a17cc4f
AF
330 isadev = isa_try_create(bus, "ne2k_isa");
331 if (!isadev) {
cd1b8a8b
BS
332 return false;
333 }
4a17cc4f
AF
334 dev = DEVICE(isadev);
335 qdev_prop_set_uint32(dev, "iobase", base);
336 qdev_prop_set_uint32(dev, "irq", irq);
337 qdev_set_nic_properties(dev, nd);
338 qdev_init_nofail(dev);
cd1b8a8b 339 return true;
60a14ad3 340}
87ecb68b 341
cbc5b5f3 342/* pc_sysfw.c */
6dd2a5c9
PB
343void pc_system_firmware_init(MemoryRegion *rom_memory,
344 bool isapc_ram_fw);
cbc5b5f3 345
3ab135f3 346/* pvpanic.c */
309cd62d 347uint16_t pvpanic_port(void);
3ab135f3 348
4c5b10b7
JS
349/* e820 types */
350#define E820_RAM 1
351#define E820_RESERVED 2
352#define E820_ACPI 3
353#define E820_NVS 4
354#define E820_UNUSABLE 5
355
356int e820_add_entry(uint64_t, uint64_t, uint32_t);
7bf8ef19
GS
357int e820_get_num_entries(void);
358bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
4c5b10b7 359
240240d5
EH
360#define PC_COMPAT_2_5 \
361 HW_COMPAT_2_5
362
87e896ab 363#define PC_COMPAT_2_4 \
276a65ba
EH
364 PC_COMPAT_2_5 \
365 HW_COMPAT_2_4 \
366 {\
367 .driver = "Haswell-" TYPE_X86_CPU,\
368 .property = "abm",\
369 .value = "off",\
370 },\
371 {\
372 .driver = "Haswell-noTSX-" TYPE_X86_CPU,\
373 .property = "abm",\
374 .value = "off",\
375 },\
376 {\
377 .driver = "Broadwell-" TYPE_X86_CPU,\
378 .property = "abm",\
379 .value = "off",\
380 },\
381 {\
382 .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\
383 .property = "abm",\
384 .value = "off",\
385 },\
386 {\
387 .driver = "host" "-" TYPE_X86_CPU,\
388 .property = "host-cache-info",\
389 .value = "on",\
390 },\
391 {\
392 .driver = TYPE_X86_CPU,\
393 .property = "check",\
394 .value = "off",\
395 },\
396 {\
397 .driver = "qemu64" "-" TYPE_X86_CPU,\
398 .property = "sse4a",\
399 .value = "on",\
400 },\
401 {\
402 .driver = "qemu64" "-" TYPE_X86_CPU,\
403 .property = "abm",\
404 .value = "on",\
405 },\
406 {\
407 .driver = "qemu64" "-" TYPE_X86_CPU,\
408 .property = "popcnt",\
409 .value = "on",\
410 },\
411 {\
412 .driver = "qemu32" "-" TYPE_X86_CPU,\
413 .property = "popcnt",\
414 .value = "on",\
415 },{\
416 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
417 .property = "rdtscp",\
418 .value = "on",\
419 },{\
420 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
421 .property = "rdtscp",\
422 .value = "on",\
423 },{\
424 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
425 .property = "rdtscp",\
426 .value = "on",\
427 },{\
428 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
429 .property = "rdtscp",\
430 .value = "on",\
431 },
87e896ab 432
33b5e8c0 433
42134ac9 434#define PC_COMPAT_2_3 \
276a65ba
EH
435 PC_COMPAT_2_4 \
436 HW_COMPAT_2_3 \
437 {\
438 .driver = TYPE_X86_CPU,\
439 .property = "arat",\
440 .value = "off",\
441 },{\
442 .driver = "qemu64" "-" TYPE_X86_CPU,\
443 .property = "level",\
444 .value = stringify(4),\
445 },{\
446 .driver = "kvm64" "-" TYPE_X86_CPU,\
447 .property = "level",\
448 .value = stringify(5),\
449 },{\
450 .driver = "pentium3" "-" TYPE_X86_CPU,\
451 .property = "level",\
452 .value = stringify(2),\
453 },{\
454 .driver = "n270" "-" TYPE_X86_CPU,\
455 .property = "level",\
456 .value = stringify(5),\
457 },{\
458 .driver = "Conroe" "-" TYPE_X86_CPU,\
459 .property = "level",\
460 .value = stringify(4),\
461 },{\
462 .driver = "Penryn" "-" TYPE_X86_CPU,\
463 .property = "level",\
464 .value = stringify(4),\
465 },{\
466 .driver = "Nehalem" "-" TYPE_X86_CPU,\
467 .property = "level",\
468 .value = stringify(4),\
469 },{\
470 .driver = "n270" "-" TYPE_X86_CPU,\
471 .property = "xlevel",\
472 .value = stringify(0x8000000a),\
473 },{\
474 .driver = "Penryn" "-" TYPE_X86_CPU,\
475 .property = "xlevel",\
476 .value = stringify(0x8000000a),\
477 },{\
478 .driver = "Conroe" "-" TYPE_X86_CPU,\
479 .property = "xlevel",\
480 .value = stringify(0x8000000a),\
481 },{\
482 .driver = "Nehalem" "-" TYPE_X86_CPU,\
483 .property = "xlevel",\
484 .value = stringify(0x8000000a),\
485 },{\
486 .driver = "Westmere" "-" TYPE_X86_CPU,\
487 .property = "xlevel",\
488 .value = stringify(0x8000000a),\
489 },{\
490 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
491 .property = "xlevel",\
492 .value = stringify(0x8000000a),\
493 },{\
494 .driver = "IvyBridge" "-" TYPE_X86_CPU,\
495 .property = "xlevel",\
496 .value = stringify(0x8000000a),\
497 },{\
498 .driver = "Haswell" "-" TYPE_X86_CPU,\
499 .property = "xlevel",\
500 .value = stringify(0x8000000a),\
501 },{\
502 .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\
503 .property = "xlevel",\
504 .value = stringify(0x8000000a),\
505 },{\
506 .driver = "Broadwell" "-" TYPE_X86_CPU,\
507 .property = "xlevel",\
508 .value = stringify(0x8000000a),\
509 },{\
510 .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\
511 .property = "xlevel",\
512 .value = stringify(0x8000000a),\
513 },
42134ac9
EH
514
515#define PC_COMPAT_2_2 \
276a65ba
EH
516 PC_COMPAT_2_3 \
517 HW_COMPAT_2_2 \
518 {\
519 .driver = "kvm64" "-" TYPE_X86_CPU,\
520 .property = "vme",\
521 .value = "off",\
522 },\
523 {\
524 .driver = "kvm32" "-" TYPE_X86_CPU,\
525 .property = "vme",\
526 .value = "off",\
527 },\
528 {\
529 .driver = "Conroe" "-" TYPE_X86_CPU,\
530 .property = "vme",\
531 .value = "off",\
532 },\
533 {\
534 .driver = "Penryn" "-" TYPE_X86_CPU,\
535 .property = "vme",\
536 .value = "off",\
537 },\
538 {\
539 .driver = "Nehalem" "-" TYPE_X86_CPU,\
540 .property = "vme",\
541 .value = "off",\
542 },\
543 {\
544 .driver = "Westmere" "-" TYPE_X86_CPU,\
545 .property = "vme",\
546 .value = "off",\
547 },\
548 {\
549 .driver = "SandyBridge" "-" TYPE_X86_CPU,\
550 .property = "vme",\
551 .value = "off",\
552 },\
553 {\
554 .driver = "Haswell" "-" TYPE_X86_CPU,\
555 .property = "vme",\
556 .value = "off",\
557 },\
558 {\
559 .driver = "Broadwell" "-" TYPE_X86_CPU,\
560 .property = "vme",\
561 .value = "off",\
562 },\
563 {\
564 .driver = "Opteron_G1" "-" TYPE_X86_CPU,\
565 .property = "vme",\
566 .value = "off",\
567 },\
568 {\
569 .driver = "Opteron_G2" "-" TYPE_X86_CPU,\
570 .property = "vme",\
571 .value = "off",\
572 },\
573 {\
574 .driver = "Opteron_G3" "-" TYPE_X86_CPU,\
575 .property = "vme",\
576 .value = "off",\
577 },\
578 {\
579 .driver = "Opteron_G4" "-" TYPE_X86_CPU,\
580 .property = "vme",\
581 .value = "off",\
582 },\
583 {\
584 .driver = "Opteron_G5" "-" TYPE_X86_CPU,\
585 .property = "vme",\
586 .value = "off",\
587 },\
588 {\
589 .driver = "Haswell" "-" TYPE_X86_CPU,\
590 .property = "f16c",\
591 .value = "off",\
592 },\
593 {\
594 .driver = "Haswell" "-" TYPE_X86_CPU,\
595 .property = "rdrand",\
596 .value = "off",\
597 },\
598 {\
599 .driver = "Broadwell" "-" TYPE_X86_CPU,\
600 .property = "f16c",\
601 .value = "off",\
602 },\
603 {\
604 .driver = "Broadwell" "-" TYPE_X86_CPU,\
605 .property = "rdrand",\
606 .value = "off",\
607 },
42134ac9
EH
608
609#define PC_COMPAT_2_1 \
276a65ba
EH
610 PC_COMPAT_2_2 \
611 HW_COMPAT_2_1 \
612 {\
613 .driver = "coreduo" "-" TYPE_X86_CPU,\
614 .property = "vmx",\
615 .value = "on",\
616 },\
617 {\
618 .driver = "core2duo" "-" TYPE_X86_CPU,\
619 .property = "vmx",\
620 .value = "on",\
621 },
42134ac9 622
9df11c9f 623#define PC_COMPAT_2_0 \
276a65ba
EH
624 PC_COMPAT_2_1 \
625 {\
626 .driver = "virtio-scsi-pci",\
627 .property = "any_layout",\
628 .value = "off",\
629 },{\
630 .driver = "PIIX4_PM",\
631 .property = "memory-hotplug-support",\
632 .value = "off",\
633 },\
634 {\
635 .driver = "apic",\
636 .property = "version",\
637 .value = stringify(0x11),\
638 },\
639 {\
640 .driver = "nec-usb-xhci",\
641 .property = "superspeed-ports-first",\
642 .value = "off",\
643 },\
644 {\
645 .driver = "nec-usb-xhci",\
646 .property = "force-pcie-endcap",\
647 .value = "on",\
648 },\
649 {\
650 .driver = "pci-serial",\
651 .property = "prog_if",\
652 .value = stringify(0),\
653 },\
654 {\
655 .driver = "pci-serial-2x",\
656 .property = "prog_if",\
657 .value = stringify(0),\
658 },\
659 {\
660 .driver = "pci-serial-4x",\
661 .property = "prog_if",\
662 .value = stringify(0),\
663 },\
664 {\
665 .driver = "virtio-net-pci",\
666 .property = "guest_announce",\
667 .value = "off",\
668 },\
669 {\
670 .driver = "ICH9-LPC",\
671 .property = "memory-hotplug-support",\
672 .value = "off",\
673 },{\
674 .driver = "xio3130-downstream",\
675 .property = COMPAT_PROP_PCP,\
676 .value = "off",\
677 },{\
678 .driver = "ioh3420",\
679 .property = COMPAT_PROP_PCP,\
680 .value = "off",\
681 },
9df11c9f 682
5319dc7b 683#define PC_COMPAT_1_7 \
276a65ba
EH
684 PC_COMPAT_2_0 \
685 {\
686 .driver = TYPE_USB_DEVICE,\
687 .property = "msos-desc",\
688 .value = "no",\
689 },\
690 {\
691 .driver = "PIIX4_PM",\
692 .property = "acpi-pci-hotplug-with-bridge-support",\
693 .value = "off",\
694 },\
695 {\
696 .driver = "hpet",\
697 .property = HPET_INTCAP,\
698 .value = stringify(4),\
699 },
5319dc7b 700
e9845f09 701#define PC_COMPAT_1_6 \
276a65ba
EH
702 PC_COMPAT_1_7 \
703 {\
704 .driver = "e1000",\
705 .property = "mitigation",\
706 .value = "off",\
707 },{\
708 .driver = "qemu64-" TYPE_X86_CPU,\
709 .property = "model",\
710 .value = stringify(2),\
711 },{\
712 .driver = "qemu32-" TYPE_X86_CPU,\
713 .property = "model",\
714 .value = stringify(3),\
715 },{\
716 .driver = "i440FX-pcihost",\
717 .property = "short_root_bus",\
718 .value = stringify(1),\
719 },{\
720 .driver = "q35-pcihost",\
721 .property = "short_root_bus",\
722 .value = stringify(1),\
723 },
e9845f09 724
ffce9ebb 725#define PC_COMPAT_1_5 \
276a65ba
EH
726 PC_COMPAT_1_6 \
727 {\
728 .driver = "Conroe-" TYPE_X86_CPU,\
729 .property = "model",\
730 .value = stringify(2),\
731 },{\
732 .driver = "Conroe-" TYPE_X86_CPU,\
733 .property = "level",\
734 .value = stringify(2),\
735 },{\
736 .driver = "Penryn-" TYPE_X86_CPU,\
737 .property = "model",\
738 .value = stringify(2),\
739 },{\
740 .driver = "Penryn-" TYPE_X86_CPU,\
741 .property = "level",\
742 .value = stringify(2),\
743 },{\
744 .driver = "Nehalem-" TYPE_X86_CPU,\
745 .property = "model",\
746 .value = stringify(2),\
747 },{\
748 .driver = "Nehalem-" TYPE_X86_CPU,\
749 .property = "level",\
750 .value = stringify(2),\
751 },{\
752 .driver = "virtio-net-pci",\
753 .property = "any_layout",\
754 .value = "off",\
755 },{\
756 .driver = TYPE_X86_CPU,\
757 .property = "pmu",\
758 .value = "on",\
759 },{\
760 .driver = "i440FX-pcihost",\
761 .property = "short_root_bus",\
762 .value = stringify(0),\
763 },{\
764 .driver = "q35-pcihost",\
765 .property = "short_root_bus",\
766 .value = stringify(0),\
767 },
ffce9ebb 768
bf3caa3d 769#define PC_COMPAT_1_4 \
276a65ba
EH
770 PC_COMPAT_1_5 \
771 {\
772 .driver = "scsi-hd",\
773 .property = "discard_granularity",\
774 .value = stringify(0),\
775 },{\
776 .driver = "scsi-cd",\
777 .property = "discard_granularity",\
778 .value = stringify(0),\
779 },{\
780 .driver = "scsi-disk",\
781 .property = "discard_granularity",\
782 .value = stringify(0),\
783 },{\
784 .driver = "ide-hd",\
785 .property = "discard_granularity",\
786 .value = stringify(0),\
787 },{\
788 .driver = "ide-cd",\
789 .property = "discard_granularity",\
790 .value = stringify(0),\
791 },{\
792 .driver = "ide-drive",\
793 .property = "discard_granularity",\
794 .value = stringify(0),\
795 },{\
796 .driver = "virtio-blk-pci",\
797 .property = "discard_granularity",\
798 .value = stringify(0),\
799 },{\
800 .driver = "virtio-serial-pci",\
801 .property = "vectors",\
802 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
803 .value = stringify(0xFFFFFFFF),\
804 },{ \
805 .driver = "virtio-net-pci", \
806 .property = "ctrl_guest_offloads", \
807 .value = "off", \
808 },{\
809 .driver = "e1000",\
810 .property = "romfile",\
811 .value = "pxe-e1000.rom",\
812 },{\
813 .driver = "ne2k_pci",\
814 .property = "romfile",\
815 .value = "pxe-ne2k_pci.rom",\
816 },{\
817 .driver = "pcnet",\
818 .property = "romfile",\
819 .value = "pxe-pcnet.rom",\
820 },{\
821 .driver = "rtl8139",\
822 .property = "romfile",\
823 .value = "pxe-rtl8139.rom",\
824 },{\
825 .driver = "virtio-net-pci",\
826 .property = "romfile",\
827 .value = "pxe-virtio.rom",\
828 },{\
829 .driver = "486-" TYPE_X86_CPU,\
830 .property = "model",\
831 .value = stringify(0),\
832 },\
833 {\
834 .driver = "n270" "-" TYPE_X86_CPU,\
835 .property = "movbe",\
836 .value = "off",\
837 },\
838 {\
839 .driver = "Westmere" "-" TYPE_X86_CPU,\
840 .property = "pclmulqdq",\
841 .value = "off",\
842 },
bf3caa3d 843
25519b06 844#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
865906f7
EH
845 static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
846 { \
847 MachineClass *mc = MACHINE_CLASS(oc); \
848 optsfn(mc); \
849 mc->name = namestr; \
850 mc->init = initfn; \
851 } \
852 static const TypeInfo pc_machine_type_##suffix = { \
853 .name = namestr TYPE_MACHINE_SUFFIX, \
854 .parent = TYPE_PC_MACHINE, \
855 .class_init = pc_machine_##suffix##_class_init, \
856 }; \
61f219df
EH
857 static void pc_machine_init_##suffix(void) \
858 { \
865906f7 859 type_register(&pc_machine_type_##suffix); \
61f219df
EH
860 } \
861 machine_init(pc_machine_init_##suffix)
862
bd8107d7 863extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
87ecb68b 864#endif
This page took 0.9241 seconds and 4 git commands to generate.