xref: /qemu/hw/i386/pc_q35.c (revision 4bcbe0b63661b1df8e78d58270574d818b387d2c)
1df2d8b3eSIsaku Yamahata /*
2df2d8b3eSIsaku Yamahata  * Q35 chipset based pc system emulator
3df2d8b3eSIsaku Yamahata  *
4df2d8b3eSIsaku Yamahata  * Copyright (c) 2003-2004 Fabrice Bellard
5df2d8b3eSIsaku Yamahata  * Copyright (c) 2009, 2010
6df2d8b3eSIsaku Yamahata  *               Isaku Yamahata <yamahata at valinux co jp>
7df2d8b3eSIsaku Yamahata  *               VA Linux Systems Japan K.K.
8df2d8b3eSIsaku Yamahata  * Copyright (C) 2012 Jason Baron <jbaron@redhat.com>
9df2d8b3eSIsaku Yamahata  *
10df2d8b3eSIsaku Yamahata  * This is based on pc.c, but heavily modified.
11df2d8b3eSIsaku Yamahata  *
12df2d8b3eSIsaku Yamahata  * Permission is hereby granted, free of charge, to any person obtaining a copy
13df2d8b3eSIsaku Yamahata  * of this software and associated documentation files (the "Software"), to deal
14df2d8b3eSIsaku Yamahata  * in the Software without restriction, including without limitation the rights
15df2d8b3eSIsaku Yamahata  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16df2d8b3eSIsaku Yamahata  * copies of the Software, and to permit persons to whom the Software is
17df2d8b3eSIsaku Yamahata  * furnished to do so, subject to the following conditions:
18df2d8b3eSIsaku Yamahata  *
19df2d8b3eSIsaku Yamahata  * The above copyright notice and this permission notice shall be included in
20df2d8b3eSIsaku Yamahata  * all copies or substantial portions of the Software.
21df2d8b3eSIsaku Yamahata  *
22df2d8b3eSIsaku Yamahata  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23df2d8b3eSIsaku Yamahata  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24df2d8b3eSIsaku Yamahata  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25df2d8b3eSIsaku Yamahata  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26df2d8b3eSIsaku Yamahata  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27df2d8b3eSIsaku Yamahata  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28df2d8b3eSIsaku Yamahata  * THE SOFTWARE.
29df2d8b3eSIsaku Yamahata  */
30b6a0aa05SPeter Maydell #include "qemu/osdep.h"
3183c9f4caSPaolo Bonzini #include "hw/hw.h"
3204920fc0SMichael S. Tsirkin #include "hw/loader.h"
339c17d615SPaolo Bonzini #include "sysemu/arch_init.h"
340d09e41aSPaolo Bonzini #include "hw/i2c/smbus.h"
3583c9f4caSPaolo Bonzini #include "hw/boards.h"
360d09e41aSPaolo Bonzini #include "hw/timer/mc146818rtc.h"
370d09e41aSPaolo Bonzini #include "hw/xen/xen.h"
389c17d615SPaolo Bonzini #include "sysemu/kvm.h"
3983c9f4caSPaolo Bonzini #include "hw/kvm/clock.h"
400d09e41aSPaolo Bonzini #include "hw/pci-host/q35.h"
41022c62cbSPaolo Bonzini #include "exec/address-spaces.h"
42b094f2e0SRita Sinha #include "hw/i386/pc.h"
430d09e41aSPaolo Bonzini #include "hw/i386/ich9.h"
4460d8f328SWei Huang #include "hw/smbios/smbios.h"
45df2d8b3eSIsaku Yamahata #include "hw/ide/pci.h"
46df2d8b3eSIsaku Yamahata #include "hw/ide/ahci.h"
47df2d8b3eSIsaku Yamahata #include "hw/usb.h"
48c87b1520SDon Slutz #include "qemu/error-report.h"
4937fb569cSDr. David Alan Gilbert #include "migration/migration.h"
50df2d8b3eSIsaku Yamahata 
51df2d8b3eSIsaku Yamahata /* ICH9 AHCI has 6 ports */
52df2d8b3eSIsaku Yamahata #define MAX_SATA_PORTS     6
53df2d8b3eSIsaku Yamahata 
54df2d8b3eSIsaku Yamahata /* PC hardware initialisation */
553ef96221SMarcel Apfelbaum static void pc_q35_init(MachineState *machine)
56df2d8b3eSIsaku Yamahata {
57ec68007aSEduardo Habkost     PCMachineState *pcms = PC_MACHINE(machine);
587102fa70SEduardo Habkost     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
59df2d8b3eSIsaku Yamahata     Q35PCIHost *q35_host;
60ce88812fSHu Tao     PCIHostState *phb;
61df2d8b3eSIsaku Yamahata     PCIBus *host_bus;
62df2d8b3eSIsaku Yamahata     PCIDevice *lpc;
63df2d8b3eSIsaku Yamahata     BusState *idebus[MAX_SATA_PORTS];
64df2d8b3eSIsaku Yamahata     ISADevice *rtc_state;
655fe79386SXiao Guangrong     MemoryRegion *system_io = get_system_io();
66df2d8b3eSIsaku Yamahata     MemoryRegion *pci_memory;
67df2d8b3eSIsaku Yamahata     MemoryRegion *rom_memory;
68df2d8b3eSIsaku Yamahata     MemoryRegion *ram_memory;
69df2d8b3eSIsaku Yamahata     GSIState *gsi_state;
70df2d8b3eSIsaku Yamahata     ISABus *isa_bus;
71df2d8b3eSIsaku Yamahata     qemu_irq *gsi;
72df2d8b3eSIsaku Yamahata     qemu_irq *i8259;
73df2d8b3eSIsaku Yamahata     int i;
74df2d8b3eSIsaku Yamahata     ICH9LPCState *ich9_lpc;
75df2d8b3eSIsaku Yamahata     PCIDevice *ahci;
76c87b1520SDon Slutz     ram_addr_t lowmem;
77d93162e1SJohn Snow     DriveInfo *hd[MAX_SATA_PORTS];
786cd2234cSLaszlo Ersek     MachineClass *mc = MACHINE_GET_CLASS(machine);
79f0513d2cSIgor Mammedov 
804e17997dSMichael S. Tsirkin     /* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory
814e17997dSMichael S. Tsirkin      * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping
824e17997dSMichael S. Tsirkin      * also known as MMCFG).
834e17997dSMichael S. Tsirkin      * If it doesn't, we need to split it in chunks below and above 4G.
844e17997dSMichael S. Tsirkin      * In any case, try to make sure that guest addresses aligned at
854e17997dSMichael S. Tsirkin      * 1G boundaries get mapped to host addresses aligned at 1G boundaries.
864e17997dSMichael S. Tsirkin      */
873ef96221SMarcel Apfelbaum     if (machine->ram_size >= 0xb0000000) {
88533e8bbbSEduardo Habkost         lowmem = 0x80000000;
89c87b1520SDon Slutz     } else {
90c87b1520SDon Slutz         lowmem = 0xb0000000;
91c87b1520SDon Slutz     }
92c87b1520SDon Slutz 
93a9dd38dbSStefan Weil     /* Handle the machine opt max-ram-below-4g.  It is basically doing
94c87b1520SDon Slutz      * min(qemu limit, user limit).
95c87b1520SDon Slutz      */
96ec68007aSEduardo Habkost     if (lowmem > pcms->max_ram_below_4g) {
97ec68007aSEduardo Habkost         lowmem = pcms->max_ram_below_4g;
98c87b1520SDon Slutz         if (machine->ram_size - lowmem > lowmem &&
99c87b1520SDon Slutz             lowmem & ((1ULL << 30) - 1)) {
100c87b1520SDon Slutz             error_report("Warning: Large machine and max_ram_below_4g(%"PRIu64
101c87b1520SDon Slutz                          ") not a multiple of 1G; possible bad performance.",
102ec68007aSEduardo Habkost                          pcms->max_ram_below_4g);
103c87b1520SDon Slutz         }
104c87b1520SDon Slutz     }
105c87b1520SDon Slutz 
106c87b1520SDon Slutz     if (machine->ram_size >= lowmem) {
107c0aa4e1eSEduardo Habkost         pcms->above_4g_mem_size = machine->ram_size - lowmem;
108c0aa4e1eSEduardo Habkost         pcms->below_4g_mem_size = lowmem;
109df2d8b3eSIsaku Yamahata     } else {
110c0aa4e1eSEduardo Habkost         pcms->above_4g_mem_size = 0;
111c0aa4e1eSEduardo Habkost         pcms->below_4g_mem_size = machine->ram_size;
112df2d8b3eSIsaku Yamahata     }
113df2d8b3eSIsaku Yamahata 
114dced4d2fSMarkus Armbruster     if (xen_enabled()) {
115dced4d2fSMarkus Armbruster         xen_hvm_init(pcms, &ram_memory);
1163c2a9669SDon Slutz     }
1173c2a9669SDon Slutz 
1184884b7bfSZhu Guihua     pc_cpus_init(pcms);
1193c2a9669SDon Slutz 
1203c2a9669SDon Slutz     kvmclock_create();
1213c2a9669SDon Slutz 
122df2d8b3eSIsaku Yamahata     /* pci enabled */
1237102fa70SEduardo Habkost     if (pcmc->pci_enabled) {
124df2d8b3eSIsaku Yamahata         pci_memory = g_new(MemoryRegion, 1);
125286690e3SPaolo Bonzini         memory_region_init(pci_memory, NULL, "pci", UINT64_MAX);
126df2d8b3eSIsaku Yamahata         rom_memory = pci_memory;
127df2d8b3eSIsaku Yamahata     } else {
128df2d8b3eSIsaku Yamahata         pci_memory = NULL;
129df2d8b3eSIsaku Yamahata         rom_memory = get_system_memory();
130df2d8b3eSIsaku Yamahata     }
131df2d8b3eSIsaku Yamahata 
1325db3f0deSEduardo Habkost     pc_guest_info_init(pcms);
13307fb6176SPaolo Bonzini 
1347102fa70SEduardo Habkost     if (pcmc->smbios_defaults) {
135b29ad07eSMarkus Armbruster         /* These values are guest ABI, do not change */
136e6667f71SGabriel L. Somlo         smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
1377102fa70SEduardo Habkost                             mc->name, pcmc->smbios_legacy_mode,
1387102fa70SEduardo Habkost                             pcmc->smbios_uuid_encoded,
13986299120SWei Huang                             SMBIOS_ENTRY_POINT_21);
140b29ad07eSMarkus Armbruster     }
141b29ad07eSMarkus Armbruster 
142df2d8b3eSIsaku Yamahata     /* allocate ram and load rom/bios */
143df2d8b3eSIsaku Yamahata     if (!xen_enabled()) {
14462b160c0SEduardo Habkost         pc_memory_init(pcms, get_system_memory(),
1455934e216SEduardo Habkost                        rom_memory, &ram_memory);
146df2d8b3eSIsaku Yamahata     }
147df2d8b3eSIsaku Yamahata 
148df2d8b3eSIsaku Yamahata     /* irq lines */
149df2d8b3eSIsaku Yamahata     gsi_state = g_malloc0(sizeof(*gsi_state));
150b094f2e0SRita Sinha     if (kvm_ioapic_in_kernel()) {
1517102fa70SEduardo Habkost         kvm_pc_setup_irq_routing(pcmc->pci_enabled);
152df2d8b3eSIsaku Yamahata         gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
153df2d8b3eSIsaku Yamahata                                  GSI_NUM_PINS);
154df2d8b3eSIsaku Yamahata     } else {
155df2d8b3eSIsaku Yamahata         gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
156df2d8b3eSIsaku Yamahata     }
157df2d8b3eSIsaku Yamahata 
158df2d8b3eSIsaku Yamahata     /* create pci host bus */
159df2d8b3eSIsaku Yamahata     q35_host = Q35_HOST_DEVICE(qdev_create(NULL, TYPE_Q35_HOST_DEVICE));
160df2d8b3eSIsaku Yamahata 
161c52dc697SIgor Mammedov     object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host), NULL);
162df2d8b3eSIsaku Yamahata     q35_host->mch.ram_memory = ram_memory;
163df2d8b3eSIsaku Yamahata     q35_host->mch.pci_address_space = pci_memory;
164df2d8b3eSIsaku Yamahata     q35_host->mch.system_memory = get_system_memory();
1655fe79386SXiao Guangrong     q35_host->mch.address_space_io = system_io;
166c0aa4e1eSEduardo Habkost     q35_host->mch.below_4g_mem_size = pcms->below_4g_mem_size;
167c0aa4e1eSEduardo Habkost     q35_host->mch.above_4g_mem_size = pcms->above_4g_mem_size;
168df2d8b3eSIsaku Yamahata     /* pci */
169df2d8b3eSIsaku Yamahata     qdev_init_nofail(DEVICE(q35_host));
170ce88812fSHu Tao     phb = PCI_HOST_BRIDGE(q35_host);
171ce88812fSHu Tao     host_bus = phb->bus;
17281ed6482SMarcel Apfelbaum     pcms->bus = phb->bus;
173df2d8b3eSIsaku Yamahata     /* create ISA bus */
174df2d8b3eSIsaku Yamahata     lpc = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_DEV,
175df2d8b3eSIsaku Yamahata                                           ICH9_LPC_FUNC), true,
176df2d8b3eSIsaku Yamahata                                           TYPE_ICH9_LPC_DEVICE);
177781bbd6bSIgor Mammedov 
178781bbd6bSIgor Mammedov     object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP,
179781bbd6bSIgor Mammedov                              TYPE_HOTPLUG_HANDLER,
180ec68007aSEduardo Habkost                              (Object **)&pcms->acpi_dev,
181781bbd6bSIgor Mammedov                              object_property_allow_set_link,
182781bbd6bSIgor Mammedov                              OBJ_PROP_LINK_UNREF_ON_RELEASE, &error_abort);
183781bbd6bSIgor Mammedov     object_property_set_link(OBJECT(machine), OBJECT(lpc),
184781bbd6bSIgor Mammedov                              PC_MACHINE_ACPI_DEVICE_PROP, &error_abort);
185781bbd6bSIgor Mammedov 
186df2d8b3eSIsaku Yamahata     ich9_lpc = ICH9_LPC_DEVICE(lpc);
187df2d8b3eSIsaku Yamahata     ich9_lpc->pic = gsi;
188df2d8b3eSIsaku Yamahata     ich9_lpc->ioapic = gsi_state->ioapic_irq;
189df2d8b3eSIsaku Yamahata     pci_bus_irqs(host_bus, ich9_lpc_set_irq, ich9_lpc_map_irq, ich9_lpc,
190df2d8b3eSIsaku Yamahata                  ICH9_LPC_NB_PIRQS);
19191c3f2f0SJason Baron     pci_bus_set_route_irq_fn(host_bus, ich9_route_intx_pin_to_irq);
192df2d8b3eSIsaku Yamahata     isa_bus = ich9_lpc->isa_bus;
193df2d8b3eSIsaku Yamahata 
194df2d8b3eSIsaku Yamahata     /*end early*/
195df2d8b3eSIsaku Yamahata     isa_bus_irqs(isa_bus, gsi);
196df2d8b3eSIsaku Yamahata 
197b094f2e0SRita Sinha     if (kvm_pic_in_kernel()) {
198df2d8b3eSIsaku Yamahata         i8259 = kvm_i8259_init(isa_bus);
199df2d8b3eSIsaku Yamahata     } else if (xen_enabled()) {
200df2d8b3eSIsaku Yamahata         i8259 = xen_interrupt_controller_init();
201df2d8b3eSIsaku Yamahata     } else {
2020b0cc076SShannon Zhao         i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
203df2d8b3eSIsaku Yamahata     }
204df2d8b3eSIsaku Yamahata 
205df2d8b3eSIsaku Yamahata     for (i = 0; i < ISA_NUM_IRQS; i++) {
206df2d8b3eSIsaku Yamahata         gsi_state->i8259_irq[i] = i8259[i];
207df2d8b3eSIsaku Yamahata     }
2087102fa70SEduardo Habkost     if (pcmc->pci_enabled) {
209552b48f4SJohn Snow         ioapic_init_gsi(gsi_state, "q35");
210df2d8b3eSIsaku Yamahata     }
211df2d8b3eSIsaku Yamahata 
212df2d8b3eSIsaku Yamahata     pc_register_ferr_irq(gsi[13]);
213df2d8b3eSIsaku Yamahata 
2147fb1cf16SEric Blake     assert(pcms->vmport != ON_OFF_AUTO__MAX);
215ec68007aSEduardo Habkost     if (pcms->vmport == ON_OFF_AUTO_AUTO) {
216ec68007aSEduardo Habkost         pcms->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
217d1048befSDon Slutz     }
218d1048befSDon Slutz 
219df2d8b3eSIsaku Yamahata     /* init basic PC hardware */
220220a8846SLaszlo Ersek     pc_basic_device_init(isa_bus, gsi, &rtc_state, !mc->no_floppy,
221ec68007aSEduardo Habkost                          (pcms->vmport != ON_OFF_AUTO_ON), 0xff0104);
222df2d8b3eSIsaku Yamahata 
223df2d8b3eSIsaku Yamahata     /* connect pm stuff to lpc */
22418d6abaeSEduardo Habkost     ich9_lpc_pm_init(lpc, pc_machine_is_smm_enabled(pcms));
225df2d8b3eSIsaku Yamahata 
226df2d8b3eSIsaku Yamahata     /* ahci and SATA device, for q35 1 ahci controller is built-in */
227df2d8b3eSIsaku Yamahata     ahci = pci_create_simple_multifunction(host_bus,
228df2d8b3eSIsaku Yamahata                                            PCI_DEVFN(ICH9_SATA1_DEV,
229df2d8b3eSIsaku Yamahata                                                      ICH9_SATA1_FUNC),
230df2d8b3eSIsaku Yamahata                                            true, "ich9-ahci");
231df2d8b3eSIsaku Yamahata     idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
232df2d8b3eSIsaku Yamahata     idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
23301a2050fSPeter Maydell     g_assert(MAX_SATA_PORTS == ICH_AHCI(ahci)->ahci.ports);
234d93162e1SJohn Snow     ide_drive_get(hd, ICH_AHCI(ahci)->ahci.ports);
235d93162e1SJohn Snow     ahci_ide_create_devs(ahci, hd);
236df2d8b3eSIsaku Yamahata 
237*4bcbe0b6SEduardo Habkost     if (machine_usb(machine)) {
238df2d8b3eSIsaku Yamahata         /* Should we create 6 UHCI according to ich9 spec? */
239df2d8b3eSIsaku Yamahata         ehci_create_ich9_with_companions(host_bus, 0x1d);
240df2d8b3eSIsaku Yamahata     }
241df2d8b3eSIsaku Yamahata 
242df2d8b3eSIsaku Yamahata     /* TODO: Populate SPD eeprom data.  */
243df2d8b3eSIsaku Yamahata     smbus_eeprom_init(ich9_smb_init(host_bus,
244df2d8b3eSIsaku Yamahata                                     PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC),
245df2d8b3eSIsaku Yamahata                                     0xb100),
246df2d8b3eSIsaku Yamahata                       8, NULL, 0);
247df2d8b3eSIsaku Yamahata 
24888076854SEduardo Habkost     pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
249df2d8b3eSIsaku Yamahata 
250df2d8b3eSIsaku Yamahata     /* the rest devices to which pci devfn is automatically assigned */
251df2d8b3eSIsaku Yamahata     pc_vga_init(isa_bus, host_bus);
252df2d8b3eSIsaku Yamahata     pc_nic_init(isa_bus, host_bus);
2537102fa70SEduardo Habkost     if (pcmc->pci_enabled) {
254df2d8b3eSIsaku Yamahata         pc_pci_device_init(host_bus);
255df2d8b3eSIsaku Yamahata     }
2565fe79386SXiao Guangrong 
2575fe79386SXiao Guangrong     if (pcms->acpi_nvdimm_state.is_enabled) {
2585fe79386SXiao Guangrong         nvdimm_init_acpi_state(&pcms->acpi_nvdimm_state, system_io,
2595fe79386SXiao Guangrong                                pcms->fw_cfg, OBJECT(pcms));
2605fe79386SXiao Guangrong     }
261df2d8b3eSIsaku Yamahata }
262df2d8b3eSIsaku Yamahata 
26399fbeafeSEduardo Habkost #define DEFINE_Q35_MACHINE(suffix, name, compatfn, optionfn) \
26499fbeafeSEduardo Habkost     static void pc_init_##suffix(MachineState *machine) \
26599fbeafeSEduardo Habkost     { \
26699fbeafeSEduardo Habkost         void (*compat)(MachineState *m) = (compatfn); \
26799fbeafeSEduardo Habkost         if (compat) { \
26899fbeafeSEduardo Habkost             compat(machine); \
26999fbeafeSEduardo Habkost         } \
27099fbeafeSEduardo Habkost         pc_q35_init(machine); \
27199fbeafeSEduardo Habkost     } \
27299fbeafeSEduardo Habkost     DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
2735cb50e0aSJason Wang 
2749953f882SMarkus Armbruster 
275865906f7SEduardo Habkost static void pc_q35_machine_options(MachineClass *m)
276fddd179aSEduardo Habkost {
277fddd179aSEduardo Habkost     m->family = "pc_q35";
278fddd179aSEduardo Habkost     m->desc = "Standard PC (Q35 + ICH9, 2009)";
279fddd179aSEduardo Habkost     m->hot_add_cpu = pc_hot_add_cpu;
280fddd179aSEduardo Habkost     m->units_per_default_bus = 1;
2810b7783a7SEduardo Habkost     m->default_machine_opts = "firmware=bios-256k.bin";
2820b7783a7SEduardo Habkost     m->default_display = "std";
2830b7783a7SEduardo Habkost     m->no_floppy = 1;
284fddd179aSEduardo Habkost }
285a0dba644SMichael S. Tsirkin 
286240240d5SEduardo Habkost static void pc_q35_2_6_machine_options(MachineClass *m)
28787e896abSEduardo Habkost {
28887e896abSEduardo Habkost     pc_q35_machine_options(m);
28987e896abSEduardo Habkost     m->alias = "q35";
29087e896abSEduardo Habkost }
29187e896abSEduardo Habkost 
292240240d5SEduardo Habkost DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL,
293240240d5SEduardo Habkost                    pc_q35_2_6_machine_options);
294240240d5SEduardo Habkost 
295240240d5SEduardo Habkost static void pc_q35_2_5_machine_options(MachineClass *m)
296240240d5SEduardo Habkost {
29736f96c4bSHaozhong Zhang     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
298240240d5SEduardo Habkost     pc_q35_2_6_machine_options(m);
299240240d5SEduardo Habkost     m->alias = NULL;
30036f96c4bSHaozhong Zhang     pcmc->save_tsc_khz = false;
301bab47d9aSGerd Hoffmann     m->legacy_fw_cfg_order = 1;
302240240d5SEduardo Habkost     SET_MACHINE_COMPAT(m, PC_COMPAT_2_5);
303240240d5SEduardo Habkost }
304240240d5SEduardo Habkost 
30587e896abSEduardo Habkost DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL,
30687e896abSEduardo Habkost                    pc_q35_2_5_machine_options);
30787e896abSEduardo Habkost 
308865906f7SEduardo Habkost static void pc_q35_2_4_machine_options(MachineClass *m)
309fddd179aSEduardo Habkost {
3102f8b5008SIgor Mammedov     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
31187e896abSEduardo Habkost     pc_q35_2_5_machine_options(m);
312de796d93SEduardo Habkost     m->hw_version = "2.4.0";
3132f8b5008SIgor Mammedov     pcmc->broken_reserved_end = true;
31487e896abSEduardo Habkost     SET_MACHINE_COMPAT(m, PC_COMPAT_2_4);
315fddd179aSEduardo Habkost }
316aeca6e8dSGerd Hoffmann 
31799fbeafeSEduardo Habkost DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
31825519b06SEduardo Habkost                    pc_q35_2_4_machine_options);
319