blob: 1b35168e9633d26f42df220ef1e2500d471a02b4 [file] [log] [blame]
pbrook87ecb682007-11-17 17:14:51 +00001#ifndef HW_PC_H
2#define HW_PC_H
aliguori376253e2009-03-05 23:01:23 +00003
4#include "qemu-common.h"
Paolo Bonzini022c62c2012-12-17 18:19:49 +01005#include "exec/memory.h"
Paolo Bonzini9521d422014-06-10 19:15:17 +08006#include "hw/boards.h"
Paolo Bonzini0d09e412013-02-05 17:06:20 +01007#include "hw/isa/isa.h"
8#include "hw/block/fdc.h"
Paolo Bonzini1422e322012-10-24 08:43:34 +02009#include "net/net.h"
Paolo Bonzini0d09e412013-02-05 17:06:20 +010010#include "hw/i386/ioapic.h"
aliguori376253e2009-03-05 23:01:23 +000011
Michael S. Tsirkin3459a622013-05-30 12:57:26 +030012#include "qemu/range.h"
Michael S. Tsirkinb20c9bd2013-07-24 18:56:09 +030013#include "qemu/bitmap.h"
14#include "sysemu/sysemu.h"
15#include "hw/pci/pci.h"
Igor Mammedovd5747ca2014-06-02 15:24:57 +020016#include "hw/boards.h"
Michael S. Tsirkin68a27b22014-10-14 19:40:06 +030017#include "hw/compat.h"
Michael S. Tsirkin3459a622013-05-30 12:57:26 +030018
Liu Ping Fan7a10ef52013-12-08 17:38:17 +080019#define HPET_INTCAP "hpet-intcap"
20
Igor Mammedov619d11e2014-06-02 15:25:08 +020021/**
22 * PCMachineState:
23 * @hotplug_memory_base: address in guest RAM address space where hotplug memory
24 * address space begins.
25 * @hotplug_memory: hotplug memory addess space container
Igor Mammedov781bbd62014-06-02 15:25:24 +020026 * @acpi_dev: link to ACPI PM device that performs ACPI hotplug handling
Igor Mammedov91aa70a2014-10-31 16:38:39 +000027 * @enforce_aligned_dimm: check that DIMM's address/size is aligned by
28 * backend's alignment value if provided
Igor Mammedov619d11e2014-06-02 15:25:08 +020029 */
Igor Mammedovd5747ca2014-06-02 15:24:57 +020030struct PCMachineState {
31 /*< private >*/
32 MachineState parent_obj;
Igor Mammedov619d11e2014-06-02 15:25:08 +020033
34 /* <public> */
35 ram_addr_t hotplug_memory_base;
36 MemoryRegion hotplug_memory;
Igor Mammedov781bbd62014-06-02 15:25:24 +020037
38 HotplugHandler *acpi_dev;
Gu Zheng2d996152014-10-22 11:24:29 +080039 ISADevice *rtc;
Don Slutzc87b1522014-06-19 21:40:25 -040040
41 uint64_t max_ram_below_4g;
Don Slutzd1048be2014-11-21 11:18:52 -050042 OnOffAuto vmport;
Igor Mammedov91aa70a2014-10-31 16:38:39 +000043 bool enforce_aligned_dimm;
Igor Mammedovd5747ca2014-06-02 15:24:57 +020044};
45
Igor Mammedov781bbd62014-06-02 15:25:24 +020046#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
Igor Mammedovbf1e8932014-06-02 15:25:27 +020047#define PC_MACHINE_MEMHP_REGION_SIZE "hotplug-memory-region-size"
Don Slutzc87b1522014-06-19 21:40:25 -040048#define PC_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
Dr. David Alan Gilbert9b23cfb2014-10-03 17:33:37 -040049#define PC_MACHINE_VMPORT "vmport"
Igor Mammedov91aa70a2014-10-31 16:38:39 +000050#define PC_MACHINE_ENFORCE_ALIGNED_DIMM "enforce-aligned-dimm"
Igor Mammedov781bbd62014-06-02 15:25:24 +020051
Igor Mammedov95bee272014-06-02 15:25:12 +020052/**
53 * PCMachineClass:
54 * @get_hotplug_handler: pointer to parent class callback @get_hotplug_handler
55 */
Igor Mammedovd5747ca2014-06-02 15:24:57 +020056struct PCMachineClass {
57 /*< private >*/
58 MachineClass parent_class;
Igor Mammedov95bee272014-06-02 15:25:12 +020059
60 /*< public >*/
61 HotplugHandler *(*get_hotplug_handler)(MachineState *machine,
62 DeviceState *dev);
Igor Mammedovd5747ca2014-06-02 15:24:57 +020063};
64
65typedef struct PCMachineState PCMachineState;
66typedef struct PCMachineClass PCMachineClass;
67
68#define TYPE_PC_MACHINE "generic-pc-machine"
69#define PC_MACHINE(obj) \
70 OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
71#define PC_MACHINE_GET_CLASS(obj) \
72 OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
73#define PC_MACHINE_CLASS(klass) \
74 OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
75
76void qemu_register_pc_machine(QEMUMachine *m);
77
pbrook87ecb682007-11-17 17:14:51 +000078/* PC-style peripherals (also used by other machines). */
79
Michael S. Tsirkin3459a622013-05-30 12:57:26 +030080typedef struct PcPciInfo {
81 Range w32;
82 Range w64;
83} PcPciInfo;
84
Michael S. Tsirkinf854ecc2013-09-16 18:09:11 +030085#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
86#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
87#define ACPI_PM_PROP_S4_VAL "s4_val"
88#define ACPI_PM_PROP_SCI_INT "sci_int"
89#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
90#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
91#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
92#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
93#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
94
Michael S. Tsirkin3459a622013-05-30 12:57:26 +030095struct PcGuestInfo {
Paolo Bonzini6dd2a5c2013-08-09 12:35:02 -050096 bool isapc_ram_fw;
Eduardo Habkostf30ee8a2014-01-09 17:12:42 -020097 hwaddr ram_size, ram_size_below_4g;
Michael S. Tsirkinb20c9bd2013-07-24 18:56:09 +030098 unsigned apic_id_limit;
99 bool apic_xrupt_override;
100 uint64_t numa_nodes;
101 uint64_t *node_mem;
102 uint64_t *node_cpu;
Michael S. Tsirkin3459a622013-05-30 12:57:26 +0300103 FWCfgState *fw_cfg;
Paolo Bonzini07fb6172014-07-28 17:34:15 +0200104 int legacy_acpi_table_size;
Michael S. Tsirkin72c194f2013-07-24 18:56:14 +0300105 bool has_acpi_build;
Igor Mammedovde268e12014-06-02 15:25:10 +0200106 bool has_reserved_memory;
Michael S. Tsirkin384fb322015-02-17 10:04:40 +0100107 bool rsdp_in_ram;
Michael S. Tsirkin3459a622013-05-30 12:57:26 +0300108};
109
pbrook87ecb682007-11-17 17:14:51 +0000110/* parallel.c */
111
Markus Armbruster07dc7882015-02-04 18:33:07 +0100112void parallel_hds_isa_init(ISABus *bus, int n);
Blue Swirldefdb202011-02-05 14:51:57 +0000113
Avi Kivity63858cd2011-10-06 16:44:26 +0200114bool parallel_mm_init(MemoryRegion *address_space,
Avi Kivitya8170e52012-10-23 12:30:10 +0200115 hwaddr base, int it_shift, qemu_irq irq,
Blue Swirldefdb202011-02-05 14:51:57 +0000116 CharDriverState *chr);
pbrook87ecb682007-11-17 17:14:51 +0000117
118/* i8259.c */
119
Jan Kiszka9aa78c42012-01-10 16:31:16 +0100120extern DeviceState *isa_pic;
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100121qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
Jan Kiszka10b61882011-10-16 15:30:27 +0200122qemu_irq *kvm_i8259_init(ISABus *bus);
Jan Kiszka9aa78c42012-01-10 16:31:16 +0100123int pic_read_irq(DeviceState *d);
124int pic_get_output(DeviceState *d);
Markus Armbruster1ce6be22015-02-06 14:18:24 +0100125void hmp_info_pic(Monitor *mon, const QDict *qdict);
126void hmp_info_irq(Monitor *mon, const QDict *qdict);
pbrook87ecb682007-11-17 17:14:51 +0000127
Jan Kiszkab881fbe2011-10-07 09:19:35 +0200128/* Global System Interrupts */
Blue Swirl96051112010-06-19 07:41:43 +0000129
Jan Kiszkab881fbe2011-10-07 09:19:35 +0200130#define GSI_NUM_PINS IOAPIC_NUM_PINS
Isaku Yamahata845773a2010-05-14 16:29:15 +0900131
Jan Kiszkab881fbe2011-10-07 09:19:35 +0200132typedef struct GSIState {
Jan Kiszka43a0db32011-10-07 09:19:36 +0200133 qemu_irq i8259_irq[ISA_NUM_IRQS];
Jan Kiszkab881fbe2011-10-07 09:19:35 +0200134 qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
135} GSIState;
136
137void gsi_handler(void *opaque, int n, int level);
Isaku Yamahata845773a2010-05-14 16:29:15 +0900138
pbrook87ecb682007-11-17 17:14:51 +0000139/* vmport.c */
Jan Kiszkad67f6792013-06-22 08:07:06 +0200140typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address);
141
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100142static inline void vmport_init(ISABus *bus)
Blue Swirl6872ef62011-02-05 14:34:41 +0000143{
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100144 isa_create_simple(bus, "vmport");
Blue Swirl6872ef62011-02-05 14:34:41 +0000145}
Jan Kiszkad67f6792013-06-22 08:07:06 +0200146
147void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
Blue Swirl86d86412011-02-05 14:34:52 +0000148void vmmouse_get_data(uint32_t *data);
149void vmmouse_set_data(const uint32_t *data);
pbrook87ecb682007-11-17 17:14:51 +0000150
pbrook87ecb682007-11-17 17:14:51 +0000151/* pckbd.c */
152
153void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
154void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
Richard Hendersondbff76a2011-08-10 15:28:17 -0700155 MemoryRegion *region, ram_addr_t size,
Avi Kivitya8170e52012-10-23 12:30:10 +0200156 hwaddr mask);
Blue Swirl956a3e62010-05-22 07:59:01 +0000157void i8042_isa_mouse_fake_event(void *opaque);
158void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
pbrook87ecb682007-11-17 17:14:51 +0000159
pbrook87ecb682007-11-17 17:14:51 +0000160/* pc.c */
161extern int fd_bootchk;
162
Isaku Yamahata8e78eb22010-05-14 16:29:09 +0900163void pc_register_ferr_irq(qemu_irq irq);
Isaku Yamahata845773a2010-05-14 16:29:15 +0900164void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
165
Igor Mammedov62fc4032013-04-29 18:54:13 +0200166void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge);
Igor Mammedovc6499832013-04-30 18:00:53 +0200167void pc_hot_add_cpu(const int64_t id, Error **errp);
Gerd Hoffmannf7e4dd62012-12-03 10:47:27 +0100168void pc_acpi_init(const char *default_dsdt);
Michael S. Tsirkin3459a622013-05-30 12:57:26 +0300169
170PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
171 ram_addr_t above_4g_mem_size);
172
Michael S. Tsirkin927766c2014-08-20 21:58:12 +0200173void pc_set_legacy_acpi_data_size(void);
174
Igor Mammedov39848902013-07-29 16:47:57 +0200175#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
176#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
177#define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
178#define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
179#define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
Michael S. Tsirkin1466cef2013-08-27 08:37:26 +0300180#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
181
Igor Mammedov39848902013-07-29 16:47:57 +0200182
Michael S. Tsirkin83d08f22013-10-29 13:57:34 +0100183void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
184 MemoryRegion *pci_address_space);
Igor Mammedov39848902013-07-29 16:47:57 +0200185
Chunyan Liub33a5bb2014-07-07 14:34:35 +0800186FWCfgState *xen_load_linux(const char *kernel_filename,
187 const char *kernel_cmdline,
188 const char *initrd_filename,
189 ram_addr_t below_4g_mem_size,
190 PcGuestInfo *guest_info);
Paolo Bonzini9521d422014-06-10 19:15:17 +0800191FWCfgState *pc_memory_init(MachineState *machine,
192 MemoryRegion *system_memory,
Laszlo Erseka88b3622013-04-16 02:24:08 +0200193 ram_addr_t below_4g_mem_size,
194 ram_addr_t above_4g_mem_size,
195 MemoryRegion *rom_memory,
Michael S. Tsirkin3459a622013-05-30 12:57:26 +0300196 MemoryRegion **ram_memory,
197 PcGuestInfo *guest_info);
Isaku Yamahata845773a2010-05-14 16:29:15 +0900198qemu_irq *pc_allocate_cpu_irq(void);
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100199DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
200void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
Anthony PERARD16119772011-05-03 17:06:54 +0100201 ISADevice **rtc_state,
Kevin Wolf34d42602011-10-20 16:37:26 +0200202 ISADevice **floppy,
Liu Ping Fan7a10ef52013-12-08 17:38:17 +0800203 bool no_vmport,
204 uint32 hpet_irqs);
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100205void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
Isaku Yamahata845773a2010-05-14 16:29:15 +0900206void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
Gu Zheng2d996152014-10-22 11:24:29 +0800207 const char *boot_device, MachineState *machine,
Kevin Wolf34d42602011-10-20 16:37:26 +0200208 ISADevice *floppy, BusState *ide0, BusState *ide1,
Blue Swirl63ffb562011-02-05 16:32:23 +0000209 ISADevice *s);
Isaku Yamahata9011a1a2012-11-14 15:54:01 -0500210void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
Isaku Yamahata845773a2010-05-14 16:29:15 +0900211void pc_pci_device_init(PCIBus *pci_bus);
Isaku Yamahata8e78eb22010-05-14 16:29:09 +0900212
Isaku Yamahataf885f1e2010-05-14 16:29:04 +0900213typedef void (*cpu_set_smm_t)(int smm, void *arg);
214void cpu_smm_register(cpu_set_smm_t callback, void *arg);
215
Jason Barona39e3562012-11-14 15:54:01 -0500216void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
217
Isaku Yamahata9d5e77a2009-06-18 19:57:00 +0900218/* acpi_piix.c */
Blue Swirl53b67b32010-03-29 19:23:52 +0000219
Andreas Färbera5c82852013-08-03 00:18:51 +0200220I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
221 qemu_irq sci_irq, qemu_irq smi_irq,
Igor Mammedov781bbd62014-06-02 15:25:24 +0200222 int kvm_enabled, FWCfgState *fw_cfg,
223 DeviceState **piix4_pm);
pbrook87ecb682007-11-17 17:14:51 +0000224void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
pbrook87ecb682007-11-17 17:14:51 +0000225
aliguori16b29ae2008-12-17 23:28:44 +0000226/* hpet.c */
227extern int no_hpet;
228
pbrook87ecb682007-11-17 17:14:51 +0000229/* piix_pci.c */
Juan Quintela0a3bacf2009-08-28 15:28:15 +0200230struct PCII440FXState;
231typedef struct PCII440FXState PCII440FXState;
232
Avi Kivity1e391012011-07-26 14:26:19 +0300233PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn,
Hervé Poussineau60573072011-12-15 22:09:54 +0100234 ISABus **isa_bus, qemu_irq *pic,
Avi Kivityaee97b82011-08-08 16:09:04 +0300235 MemoryRegion *address_space_mem,
236 MemoryRegion *address_space_io,
Avi Kivityae0a5462011-08-15 17:17:38 +0300237 ram_addr_t ram_size,
Gerd Hoffmannddaaefb2013-12-21 03:02:50 +0100238 ram_addr_t below_4g_mem_size,
Igor Mammedov39848902013-07-29 16:47:57 +0200239 ram_addr_t above_4g_mem_size,
Avi Kivityae0a5462011-08-15 17:17:38 +0300240 MemoryRegion *pci_memory,
241 MemoryRegion *ram_memory);
pbrook87ecb682007-11-17 17:14:51 +0000242
Michael S. Tsirkin277e9342013-07-24 18:56:11 +0300243PCIBus *find_i440fx(void);
Juan Quintela823e6752009-08-28 15:28:13 +0200244/* piix4.c */
blueswir1b1d8e522008-10-26 13:43:07 +0000245extern PCIDevice *piix4_dev;
Hervé Poussineau142e9782011-12-15 22:09:58 +0100246int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
pbrook87ecb682007-11-17 17:14:51 +0000247
248/* vga.c */
malccb5a7aa2008-09-28 00:42:12 +0000249enum vga_retrace_method {
250 VGA_RETRACE_DUMB,
251 VGA_RETRACE_PRECISE
252};
253
254extern enum vga_retrace_method vga_retrace_method;
pbrook87ecb682007-11-17 17:14:51 +0000255
Avi Kivitya8170e52012-10-23 12:30:10 +0200256int isa_vga_mm_init(hwaddr vram_base,
257 hwaddr ctrl_base, int it_shift,
Avi Kivitybe20f9e2011-08-15 17:17:37 +0300258 MemoryRegion *address_space);
pbrook87ecb682007-11-17 17:14:51 +0000259
pbrook87ecb682007-11-17 17:14:51 +0000260/* ne2000.c */
Hervé Poussineau48a18b32011-12-15 22:09:51 +0100261static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
Blue Swirl60a14ad2011-02-05 15:39:57 +0000262{
Andreas Färber4a17cc42013-06-07 13:49:13 +0200263 DeviceState *dev;
264 ISADevice *isadev;
pbrook87ecb682007-11-17 17:14:51 +0000265
Blue Swirl60a14ad2011-02-05 15:39:57 +0000266 qemu_check_nic_model(nd, "ne2k_isa");
267
Andreas Färber4a17cc42013-06-07 13:49:13 +0200268 isadev = isa_try_create(bus, "ne2k_isa");
269 if (!isadev) {
Blue Swirlcd1b8a82011-02-05 15:44:45 +0000270 return false;
271 }
Andreas Färber4a17cc42013-06-07 13:49:13 +0200272 dev = DEVICE(isadev);
273 qdev_prop_set_uint32(dev, "iobase", base);
274 qdev_prop_set_uint32(dev, "irq", irq);
275 qdev_set_nic_properties(dev, nd);
276 qdev_init_nofail(dev);
Blue Swirlcd1b8a82011-02-05 15:44:45 +0000277 return true;
Blue Swirl60a14ad2011-02-05 15:39:57 +0000278}
pbrook87ecb682007-11-17 17:14:51 +0000279
Jordan Justencbc5b5f2012-02-21 23:18:51 -0800280/* pc_sysfw.c */
Paolo Bonzini6dd2a5c2013-08-09 12:35:02 -0500281void pc_system_firmware_init(MemoryRegion *rom_memory,
282 bool isapc_ram_fw);
Jordan Justencbc5b5f2012-02-21 23:18:51 -0800283
Hu Tao3ab135f2013-04-26 11:24:46 +0800284/* pvpanic.c */
Michael S. Tsirkin309cd622013-07-24 18:56:12 +0300285uint16_t pvpanic_port(void);
Hu Tao3ab135f2013-04-26 11:24:46 +0800286
Jes Sorensen4c5b10b2010-02-15 18:33:46 +0100287/* e820 types */
288#define E820_RAM 1
289#define E820_RESERVED 2
290#define E820_ACPI 3
291#define E820_NVS 4
292#define E820_UNUSABLE 5
293
294int e820_add_entry(uint64_t, uint64_t, uint32_t);
Gabriel L. Somlo7bf8ef12014-04-23 09:42:36 -0400295int e820_get_num_entries(void);
296bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
Jes Sorensen4c5b10b2010-02-15 18:33:46 +0100297
Gabriel L. Somlo9df11c92014-05-05 10:52:50 -0400298#define PC_COMPAT_2_0 \
Michael S. Tsirkin68a27b22014-10-14 19:40:06 +0300299 HW_COMPAT_2_1, \
Gabriel L. Somlo9df11c92014-05-05 10:52:50 -0400300 {\
Paolo Bonzini3eff1f42014-06-10 16:40:31 +0200301 .driver = "virtio-scsi-pci",\
302 .property = "any_layout",\
303 .value = "off",\
304 },{\
Igor Mammedov34774322014-06-02 15:25:20 +0200305 .driver = "PIIX4_PM",\
306 .property = "memory-hotplug-support",\
307 .value = "off",\
308 },\
309 {\
Gabriel L. Somloaa932002014-05-05 10:52:51 -0400310 .driver = "apic",\
311 .property = "version",\
312 .value = stringify(0x11),\
Igor Mammedov34774322014-06-02 15:25:20 +0200313 },\
314 {\
Gerd Hoffmann7bafd882014-05-15 12:42:16 +0200315 .driver = "nec-usb-xhci",\
316 .property = "superspeed-ports-first",\
317 .value = "off",\
BALATON Zoltan13cc2c32014-02-27 02:05:05 +0100318 },\
319 {\
Dr. David Alan Gilberte6043e92014-09-09 11:19:43 +0100320 .driver = "nec-usb-xhci",\
321 .property = "force-pcie-endcap",\
322 .value = "on",\
323 },\
324 {\
BALATON Zoltan13cc2c32014-02-27 02:05:05 +0100325 .driver = "pci-serial",\
326 .property = "prog_if",\
327 .value = stringify(0),\
328 },\
329 {\
330 .driver = "pci-serial-2x",\
Eduardo Habkostfa118d12014-06-24 19:57:55 -0300331 .property = "prog_if",\
BALATON Zoltan13cc2c32014-02-27 02:05:05 +0100332 .value = stringify(0),\
333 },\
334 {\
335 .driver = "pci-serial-4x",\
336 .property = "prog_if",\
337 .value = stringify(0),\
Jason Wangf57fcf72014-05-20 14:01:44 +0800338 },\
339 {\
340 .driver = "virtio-net-pci",\
341 .property = "guest_announce",\
342 .value = "off",\
Eduardo Habkostb8f5cfd2014-06-24 23:04:44 -0300343 },\
344 {\
345 .driver = "ICH9-LPC",\
346 .property = "memory-hotplug-support",\
347 .value = "off",\
348 },{\
349 .driver = "xio3130-downstream",\
350 .property = COMPAT_PROP_PCP,\
351 .value = "off",\
352 },{\
353 .driver = "ioh3420",\
354 .property = COMPAT_PROP_PCP,\
355 .value = "off",\
Gabriel L. Somlo9df11c92014-05-05 10:52:50 -0400356 }
357
Gerd Hoffmann5319dc72013-11-20 07:32:31 +0100358#define PC_COMPAT_1_7 \
Gabriel L. Somlo9df11c92014-05-05 10:52:50 -0400359 PC_COMPAT_2_0, \
Gerd Hoffmann5319dc72013-11-20 07:32:31 +0100360 {\
361 .driver = TYPE_USB_DEVICE,\
362 .property = "msos-desc",\
363 .value = "no",\
Michael S. Tsirkin9e047b92013-10-14 18:01:20 +0300364 },\
365 {\
366 .driver = "PIIX4_PM",\
367 .property = "acpi-pci-hotplug-with-bridge-support",\
368 .value = "off",\
Eduardo Habkostb8f5cfd2014-06-24 23:04:44 -0300369 },\
370 {\
371 .driver = "hpet",\
372 .property = HPET_INTCAP,\
373 .value = stringify(4),\
Gerd Hoffmann5319dc72013-11-20 07:32:31 +0100374 }
375
Vincenzo Maffionee9845f02013-08-02 18:30:52 +0200376#define PC_COMPAT_1_6 \
Gerd Hoffmann5319dc72013-11-20 07:32:31 +0100377 PC_COMPAT_1_7, \
Vincenzo Maffionee9845f02013-08-02 18:30:52 +0200378 {\
379 .driver = "e1000",\
380 .property = "mitigation",\
381 .value = "off",\
Eduardo Habkostf8e6a112013-09-10 17:48:59 -0300382 },{\
383 .driver = "qemu64-" TYPE_X86_CPU,\
384 .property = "model",\
385 .value = stringify(2),\
386 },{\
387 .driver = "qemu32-" TYPE_X86_CPU,\
388 .property = "model",\
389 .value = stringify(3),\
Cole Robinson04c7d8b2013-11-05 18:46:27 -0500390 },{\
391 .driver = "i440FX-pcihost",\
392 .property = "short_root_bus",\
393 .value = stringify(1),\
394 },{\
395 .driver = "q35-pcihost",\
396 .property = "short_root_bus",\
397 .value = stringify(1),\
Vincenzo Maffionee9845f02013-08-02 18:30:52 +0200398 }
399
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300400#define PC_COMPAT_1_5 \
Vincenzo Maffionee9845f02013-08-02 18:30:52 +0200401 PC_COMPAT_1_6, \
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300402 {\
403 .driver = "Conroe-" TYPE_X86_CPU,\
404 .property = "model",\
405 .value = stringify(2),\
406 },{\
Eduardo Habkost6b113222013-05-27 17:23:55 -0300407 .driver = "Conroe-" TYPE_X86_CPU,\
408 .property = "level",\
409 .value = stringify(2),\
410 },{\
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300411 .driver = "Penryn-" TYPE_X86_CPU,\
412 .property = "model",\
413 .value = stringify(2),\
414 },{\
Eduardo Habkost6b113222013-05-27 17:23:55 -0300415 .driver = "Penryn-" TYPE_X86_CPU,\
416 .property = "level",\
417 .value = stringify(2),\
418 },{\
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300419 .driver = "Nehalem-" TYPE_X86_CPU,\
420 .property = "model",\
421 .value = stringify(2),\
Eduardo Habkost6b113222013-05-27 17:23:55 -0300422 },{\
423 .driver = "Nehalem-" TYPE_X86_CPU,\
424 .property = "level",\
425 .value = stringify(2),\
Michael S. Tsirkin488f0692013-07-11 16:06:46 +0300426 },{\
427 .driver = "virtio-net-pci",\
428 .property = "any_layout",\
429 .value = "off",\
Eduardo Habkost9337e3b2013-07-26 17:09:36 -0300430 },{\
431 .driver = TYPE_X86_CPU,\
432 .property = "pmu",\
433 .value = "on",\
Cole Robinson04c7d8b2013-11-05 18:46:27 -0500434 },{\
435 .driver = "i440FX-pcihost",\
436 .property = "short_root_bus",\
437 .value = stringify(0),\
438 },{\
439 .driver = "q35-pcihost",\
440 .property = "short_root_bus",\
441 .value = stringify(0),\
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300442 }
443
Paolo Bonzinibf3caa32013-02-08 14:06:15 +0100444#define PC_COMPAT_1_4 \
Eduardo Habkostffce9eb2013-05-27 17:23:54 -0300445 PC_COMPAT_1_5, \
Paolo Bonzinibf3caa32013-02-08 14:06:15 +0100446 {\
447 .driver = "scsi-hd",\
448 .property = "discard_granularity",\
449 .value = stringify(0),\
450 },{\
451 .driver = "scsi-cd",\
452 .property = "discard_granularity",\
453 .value = stringify(0),\
454 },{\
455 .driver = "scsi-disk",\
456 .property = "discard_granularity",\
457 .value = stringify(0),\
458 },{\
459 .driver = "ide-hd",\
460 .property = "discard_granularity",\
461 .value = stringify(0),\
462 },{\
463 .driver = "ide-cd",\
464 .property = "discard_granularity",\
465 .value = stringify(0),\
466 },{\
467 .driver = "ide-drive",\
468 .property = "discard_granularity",\
469 .value = stringify(0),\
Gerd Hoffmannc45e5b52013-02-26 17:46:11 +0100470 },{\
Paolo Bonzinibf3caa32013-02-08 14:06:15 +0100471 .driver = "virtio-blk-pci",\
472 .property = "discard_granularity",\
473 .value = stringify(0),\
Gal Hammer554f1992013-02-27 15:15:31 +0200474 },{\
475 .driver = "virtio-serial-pci",\
476 .property = "vectors",\
477 /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
478 .value = stringify(0xFFFFFFFF),\
Dmitry Fleytman644c9852013-05-20 11:18:14 +0300479 },{ \
480 .driver = "virtio-net-pci", \
481 .property = "ctrl_guest_offloads", \
482 .value = "off", \
Gerd Hoffmannc45e5b52013-02-26 17:46:11 +0100483 },{\
484 .driver = "e1000",\
485 .property = "romfile",\
486 .value = "pxe-e1000.rom",\
487 },{\
488 .driver = "ne2k_pci",\
489 .property = "romfile",\
490 .value = "pxe-ne2k_pci.rom",\
491 },{\
492 .driver = "pcnet",\
493 .property = "romfile",\
494 .value = "pxe-pcnet.rom",\
495 },{\
496 .driver = "rtl8139",\
497 .property = "romfile",\
498 .value = "pxe-rtl8139.rom",\
499 },{\
500 .driver = "virtio-net-pci",\
501 .property = "romfile",\
502 .value = "pxe-virtio.rom",\
Markus Armbruster9953f882013-04-12 17:25:03 +0200503 },{\
Andreas Färberb2a856d2013-05-01 17:30:51 +0200504 .driver = "486-" TYPE_X86_CPU,\
505 .property = "model",\
506 .value = stringify(0),\
Gerd Hoffmannc45e5b52013-02-26 17:46:11 +0100507 }
Paolo Bonzinibf3caa32013-02-08 14:06:15 +0100508
Michael S. Tsirkina0dba642013-08-27 09:48:06 +0300509#define PC_COMMON_MACHINE_OPTIONS \
510 .default_boot_order = "cad"
511
512#define PC_DEFAULT_MACHINE_OPTIONS \
513 PC_COMMON_MACHINE_OPTIONS, \
514 .hot_add_cpu = pc_hot_add_cpu, \
515 .max_cpus = 255
516
pbrook87ecb682007-11-17 17:14:51 +0000517#endif