xref: /openbmc/qemu/hw/i386/pc_piix.c (revision 80270a19)
1 /*
2  * QEMU PC System Emulator
3  *
4  * Copyright (c) 2003-2004 Fabrice Bellard
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #include <glib.h>
26 
27 #include "hw/hw.h"
28 #include "hw/i386/pc.h"
29 #include "hw/i386/apic.h"
30 #include "hw/pci/pci.h"
31 #include "hw/pci/pci_ids.h"
32 #include "hw/usb.h"
33 #include "net/net.h"
34 #include "hw/boards.h"
35 #include "hw/ide.h"
36 #include "sysemu/kvm.h"
37 #include "hw/kvm/clock.h"
38 #include "sysemu/sysemu.h"
39 #include "hw/sysbus.h"
40 #include "hw/cpu/icc_bus.h"
41 #include "sysemu/arch_init.h"
42 #include "sysemu/blockdev.h"
43 #include "hw/i2c/smbus.h"
44 #include "hw/xen/xen.h"
45 #include "exec/memory.h"
46 #include "exec/address-spaces.h"
47 #include "hw/acpi/acpi.h"
48 #include "cpu.h"
49 #ifdef CONFIG_XEN
50 #  include <xen/hvm/hvm_info_table.h>
51 #endif
52 
53 #define MAX_IDE_BUS 2
54 
55 static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
56 static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
57 static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
58 
59 static bool has_pvpanic = true;
60 
61 /* PC hardware initialisation */
62 static void pc_init1(MemoryRegion *system_memory,
63                      MemoryRegion *system_io,
64                      ram_addr_t ram_size,
65                      const char *boot_device,
66                      const char *kernel_filename,
67                      const char *kernel_cmdline,
68                      const char *initrd_filename,
69                      const char *cpu_model,
70                      int pci_enabled,
71                      int kvmclock_enabled)
72 {
73     int i;
74     ram_addr_t below_4g_mem_size, above_4g_mem_size;
75     PCIBus *pci_bus;
76     ISABus *isa_bus;
77     PCII440FXState *i440fx_state;
78     int piix3_devfn = -1;
79     qemu_irq *cpu_irq;
80     qemu_irq *gsi;
81     qemu_irq *i8259;
82     qemu_irq *smi_irq;
83     GSIState *gsi_state;
84     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
85     BusState *idebus[MAX_IDE_BUS];
86     ISADevice *rtc_state;
87     ISADevice *floppy;
88     MemoryRegion *ram_memory;
89     MemoryRegion *pci_memory;
90     MemoryRegion *rom_memory;
91     DeviceState *icc_bridge;
92     void *fw_cfg = NULL;
93 
94     icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE);
95     object_property_add_child(qdev_get_machine(), "icc-bridge",
96                               OBJECT(icc_bridge), NULL);
97 
98     pc_cpus_init(cpu_model, icc_bridge);
99     pc_acpi_init("acpi-dsdt.aml");
100 
101     if (kvmclock_enabled) {
102         kvmclock_create();
103     }
104 
105     if (ram_size >= 0xe0000000 ) {
106         above_4g_mem_size = ram_size - 0xe0000000;
107         below_4g_mem_size = 0xe0000000;
108     } else {
109         above_4g_mem_size = 0;
110         below_4g_mem_size = ram_size;
111     }
112 
113     if (pci_enabled) {
114         pci_memory = g_new(MemoryRegion, 1);
115         memory_region_init(pci_memory, "pci", INT64_MAX);
116         rom_memory = pci_memory;
117     } else {
118         pci_memory = NULL;
119         rom_memory = system_memory;
120     }
121 
122     /* allocate ram and load rom/bios */
123     if (!xen_enabled()) {
124         fw_cfg = pc_memory_init(system_memory,
125                        kernel_filename, kernel_cmdline, initrd_filename,
126                        below_4g_mem_size, above_4g_mem_size,
127                        rom_memory, &ram_memory);
128     }
129 
130     gsi_state = g_malloc0(sizeof(*gsi_state));
131     if (kvm_irqchip_in_kernel()) {
132         kvm_pc_setup_irq_routing(pci_enabled);
133         gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
134                                  GSI_NUM_PINS);
135     } else {
136         gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
137     }
138 
139     if (pci_enabled) {
140         pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi,
141                               system_memory, system_io, ram_size,
142                               below_4g_mem_size,
143                               0x100000000ULL - below_4g_mem_size,
144                               0x100000000ULL + above_4g_mem_size,
145                               (sizeof(hwaddr) == 4
146                                ? 0
147                                : ((uint64_t)1 << 62)),
148                               pci_memory, ram_memory);
149     } else {
150         pci_bus = NULL;
151         i440fx_state = NULL;
152         isa_bus = isa_bus_new(NULL, system_io);
153         no_hpet = 1;
154     }
155     isa_bus_irqs(isa_bus, gsi);
156 
157     if (kvm_irqchip_in_kernel()) {
158         i8259 = kvm_i8259_init(isa_bus);
159     } else if (xen_enabled()) {
160         i8259 = xen_interrupt_controller_init();
161     } else {
162         cpu_irq = pc_allocate_cpu_irq();
163         i8259 = i8259_init(isa_bus, cpu_irq[0]);
164     }
165 
166     for (i = 0; i < ISA_NUM_IRQS; i++) {
167         gsi_state->i8259_irq[i] = i8259[i];
168     }
169     if (pci_enabled) {
170         ioapic_init_gsi(gsi_state, "i440fx");
171     }
172     qdev_init_nofail(icc_bridge);
173 
174     pc_register_ferr_irq(gsi[13]);
175 
176     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
177     if (xen_enabled()) {
178         pci_create_simple(pci_bus, -1, "xen-platform");
179     }
180 
181     /* init basic PC hardware */
182     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
183 
184     pc_nic_init(isa_bus, pci_bus);
185 
186     ide_drive_get(hd, MAX_IDE_BUS);
187     if (pci_enabled) {
188         PCIDevice *dev;
189         if (xen_enabled()) {
190             dev = pci_piix3_xen_ide_init(pci_bus, hd, piix3_devfn + 1);
191         } else {
192             dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
193         }
194         idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
195         idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
196     } else {
197         for(i = 0; i < MAX_IDE_BUS; i++) {
198             ISADevice *dev;
199             dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
200                                ide_irq[i],
201                                hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]);
202             idebus[i] = qdev_get_child_bus(&dev->qdev, "ide.0");
203         }
204     }
205 
206     pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
207                  floppy, idebus[0], idebus[1], rtc_state);
208 
209     if (pci_enabled && usb_enabled(false)) {
210         pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci");
211     }
212 
213     if (pci_enabled && acpi_enabled) {
214         i2c_bus *smbus;
215 
216         smi_irq = qemu_allocate_irqs(pc_acpi_smi_interrupt,
217                                      x86_env_get_cpu(first_cpu), 1);
218         /* TODO: Populate SPD eeprom data.  */
219         smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100,
220                               gsi[9], *smi_irq,
221                               kvm_enabled(), fw_cfg);
222         smbus_eeprom_init(smbus, 8, NULL, 0);
223     }
224 
225     if (pci_enabled) {
226         pc_pci_device_init(pci_bus);
227     }
228 
229     if (has_pvpanic) {
230         pvpanic_init(isa_bus);
231     }
232 }
233 
234 static void pc_init_pci(QEMUMachineInitArgs *args)
235 {
236     ram_addr_t ram_size = args->ram_size;
237     const char *cpu_model = args->cpu_model;
238     const char *kernel_filename = args->kernel_filename;
239     const char *kernel_cmdline = args->kernel_cmdline;
240     const char *initrd_filename = args->initrd_filename;
241     const char *boot_device = args->boot_device;
242     pc_init1(get_system_memory(),
243              get_system_io(),
244              ram_size, boot_device,
245              kernel_filename, kernel_cmdline,
246              initrd_filename, cpu_model, 1, 1);
247 }
248 
249 static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
250 {
251     pc_sysfw_flash_vs_rom_bug_compatible = true;
252     has_pvpanic = false;
253     pc_init_pci(args);
254 }
255 
256 static void pc_init_pci_1_3(QEMUMachineInitArgs *args)
257 {
258     enable_compat_apic_id_mode();
259     pc_sysfw_flash_vs_rom_bug_compatible = true;
260     has_pvpanic = false;
261     pc_init_pci(args);
262 }
263 
264 /* PC machine init function for pc-1.1 to pc-1.2 */
265 static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
266 {
267     disable_kvm_pv_eoi();
268     enable_compat_apic_id_mode();
269     pc_sysfw_flash_vs_rom_bug_compatible = true;
270     has_pvpanic = false;
271     pc_init_pci(args);
272 }
273 
274 /* PC machine init function for pc-0.14 to pc-1.0 */
275 static void pc_init_pci_1_0(QEMUMachineInitArgs *args)
276 {
277     disable_kvm_pv_eoi();
278     enable_compat_apic_id_mode();
279     has_pvpanic = false;
280     pc_init_pci(args);
281 }
282 
283 /* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */
284 static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
285 {
286     ram_addr_t ram_size = args->ram_size;
287     const char *cpu_model = args->cpu_model;
288     const char *kernel_filename = args->kernel_filename;
289     const char *kernel_cmdline = args->kernel_cmdline;
290     const char *initrd_filename = args->initrd_filename;
291     const char *boot_device = args->boot_device;
292     has_pvpanic = false;
293     disable_kvm_pv_eoi();
294     enable_compat_apic_id_mode();
295     pc_init1(get_system_memory(),
296              get_system_io(),
297              ram_size, boot_device,
298              kernel_filename, kernel_cmdline,
299              initrd_filename, cpu_model, 1, 0);
300 }
301 
302 static void pc_init_isa(QEMUMachineInitArgs *args)
303 {
304     ram_addr_t ram_size = args->ram_size;
305     const char *cpu_model = args->cpu_model;
306     const char *kernel_filename = args->kernel_filename;
307     const char *kernel_cmdline = args->kernel_cmdline;
308     const char *initrd_filename = args->initrd_filename;
309     const char *boot_device = args->boot_device;
310     has_pvpanic = false;
311     if (cpu_model == NULL)
312         cpu_model = "486";
313     disable_kvm_pv_eoi();
314     enable_compat_apic_id_mode();
315     pc_init1(get_system_memory(),
316              get_system_io(),
317              ram_size, boot_device,
318              kernel_filename, kernel_cmdline,
319              initrd_filename, cpu_model, 0, 1);
320 }
321 
322 #ifdef CONFIG_XEN
323 static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
324 {
325     if (xen_hvm_init() != 0) {
326         hw_error("xen hardware virtual machine initialisation failed");
327     }
328     pc_init_pci_no_kvmclock(args);
329     xen_vcpu_init();
330 }
331 #endif
332 
333 static QEMUMachine pc_i440fx_machine_v1_5 = {
334     .name = "pc-i440fx-1.5",
335     .alias = "pc",
336     .desc = "Standard PC (i440FX + PIIX, 1996)",
337     .init = pc_init_pci,
338     .hot_add_cpu = pc_hot_add_cpu,
339     .max_cpus = 255,
340     .is_default = 1,
341     DEFAULT_MACHINE_OPTIONS,
342 };
343 
344 static QEMUMachine pc_i440fx_machine_v1_4 = {
345     .name = "pc-i440fx-1.4",
346     .desc = "Standard PC (i440FX + PIIX, 1996)",
347     .init = pc_init_pci_1_4,
348     .max_cpus = 255,
349     .compat_props = (GlobalProperty[]) {
350         PC_COMPAT_1_4,
351         { /* end of list */ }
352     },
353     DEFAULT_MACHINE_OPTIONS,
354 };
355 
356 #define PC_COMPAT_1_3 \
357 	PC_COMPAT_1_4, \
358         {\
359             .driver   = "usb-tablet",\
360             .property = "usb_version",\
361             .value    = stringify(1),\
362         },{\
363             .driver   = "virtio-net-pci",\
364             .property = "ctrl_mac_addr",\
365             .value    = "off",      \
366         },{ \
367             .driver   = "virtio-net-pci", \
368             .property = "mq", \
369             .value    = "off", \
370         }, {\
371             .driver   = "e1000",\
372             .property = "autonegotiation",\
373             .value    = "off",\
374         }
375 
376 static QEMUMachine pc_machine_v1_3 = {
377     .name = "pc-1.3",
378     .desc = "Standard PC",
379     .init = pc_init_pci_1_3,
380     .max_cpus = 255,
381     .compat_props = (GlobalProperty[]) {
382         PC_COMPAT_1_3,
383         { /* end of list */ }
384     },
385     DEFAULT_MACHINE_OPTIONS,
386 };
387 
388 #define PC_COMPAT_1_2 \
389         PC_COMPAT_1_3,\
390         {\
391             .driver   = "nec-usb-xhci",\
392             .property = "msi",\
393             .value    = "off",\
394         },{\
395             .driver   = "nec-usb-xhci",\
396             .property = "msix",\
397             .value    = "off",\
398         },{\
399             .driver   = "ivshmem",\
400             .property = "use64",\
401             .value    = "0",\
402         },{\
403             .driver   = "qxl",\
404             .property = "revision",\
405             .value    = stringify(3),\
406         },{\
407             .driver   = "qxl-vga",\
408             .property = "revision",\
409             .value    = stringify(3),\
410         },{\
411             .driver   = "VGA",\
412             .property = "mmio",\
413             .value    = "off",\
414         }
415 
416 static QEMUMachine pc_machine_v1_2 = {
417     .name = "pc-1.2",
418     .desc = "Standard PC",
419     .init = pc_init_pci_1_2,
420     .max_cpus = 255,
421     .compat_props = (GlobalProperty[]) {
422         PC_COMPAT_1_2,
423         { /* end of list */ }
424     },
425     DEFAULT_MACHINE_OPTIONS,
426 };
427 
428 #define PC_COMPAT_1_1 \
429         PC_COMPAT_1_2,\
430         {\
431             .driver   = "virtio-scsi-pci",\
432             .property = "hotplug",\
433             .value    = "off",\
434         },{\
435             .driver   = "virtio-scsi-pci",\
436             .property = "param_change",\
437             .value    = "off",\
438         },{\
439             .driver   = "VGA",\
440             .property = "vgamem_mb",\
441             .value    = stringify(8),\
442         },{\
443             .driver   = "vmware-svga",\
444             .property = "vgamem_mb",\
445             .value    = stringify(8),\
446         },{\
447             .driver   = "qxl-vga",\
448             .property = "vgamem_mb",\
449             .value    = stringify(8),\
450         },{\
451             .driver   = "qxl",\
452             .property = "vgamem_mb",\
453             .value    = stringify(8),\
454         },{\
455             .driver   = "virtio-blk-pci",\
456             .property = "config-wce",\
457             .value    = "off",\
458         }
459 
460 static QEMUMachine pc_machine_v1_1 = {
461     .name = "pc-1.1",
462     .desc = "Standard PC",
463     .init = pc_init_pci_1_2,
464     .max_cpus = 255,
465     .compat_props = (GlobalProperty[]) {
466         PC_COMPAT_1_1,
467         { /* end of list */ }
468     },
469     DEFAULT_MACHINE_OPTIONS,
470 };
471 
472 #define PC_COMPAT_1_0 \
473         PC_COMPAT_1_1,\
474         {\
475             .driver   = "pc-sysfw",\
476             .property = "rom_only",\
477             .value    = stringify(1),\
478         }, {\
479             .driver   = TYPE_ISA_FDC,\
480             .property = "check_media_rate",\
481             .value    = "off",\
482         }, {\
483             .driver   = "virtio-balloon-pci",\
484             .property = "class",\
485             .value    = stringify(PCI_CLASS_MEMORY_RAM),\
486         },{\
487             .driver   = "apic",\
488             .property = "vapic",\
489             .value    = "off",\
490         },{\
491             .driver   = TYPE_USB_DEVICE,\
492             .property = "full-path",\
493             .value    = "no",\
494         }
495 
496 static QEMUMachine pc_machine_v1_0 = {
497     .name = "pc-1.0",
498     .desc = "Standard PC",
499     .init = pc_init_pci_1_0,
500     .max_cpus = 255,
501     .compat_props = (GlobalProperty[]) {
502         PC_COMPAT_1_0,
503         { /* end of list */ }
504     },
505     .hw_version = "1.0",
506     DEFAULT_MACHINE_OPTIONS,
507 };
508 
509 #define PC_COMPAT_0_15 \
510         PC_COMPAT_1_0
511 
512 static QEMUMachine pc_machine_v0_15 = {
513     .name = "pc-0.15",
514     .desc = "Standard PC",
515     .init = pc_init_pci_1_0,
516     .max_cpus = 255,
517     .compat_props = (GlobalProperty[]) {
518         PC_COMPAT_0_15,
519         { /* end of list */ }
520     },
521     .hw_version = "0.15",
522     DEFAULT_MACHINE_OPTIONS,
523 };
524 
525 #define PC_COMPAT_0_14 \
526         PC_COMPAT_0_15,\
527         {\
528             .driver   = "virtio-blk-pci",\
529             .property = "event_idx",\
530             .value    = "off",\
531         },{\
532             .driver   = "virtio-serial-pci",\
533             .property = "event_idx",\
534             .value    = "off",\
535         },{\
536             .driver   = "virtio-net-pci",\
537             .property = "event_idx",\
538             .value    = "off",\
539         },{\
540             .driver   = "virtio-balloon-pci",\
541             .property = "event_idx",\
542             .value    = "off",\
543         }
544 
545 static QEMUMachine pc_machine_v0_14 = {
546     .name = "pc-0.14",
547     .desc = "Standard PC",
548     .init = pc_init_pci_1_0,
549     .max_cpus = 255,
550     .compat_props = (GlobalProperty[]) {
551         PC_COMPAT_0_14,
552         {
553             .driver   = "qxl",
554             .property = "revision",
555             .value    = stringify(2),
556         },{
557             .driver   = "qxl-vga",
558             .property = "revision",
559             .value    = stringify(2),
560         },
561         { /* end of list */ }
562     },
563     .hw_version = "0.14",
564     DEFAULT_MACHINE_OPTIONS,
565 };
566 
567 #define PC_COMPAT_0_13 \
568         PC_COMPAT_0_14,\
569         {\
570             .driver   = TYPE_PCI_DEVICE,\
571             .property = "command_serr_enable",\
572             .value    = "off",\
573         },{\
574             .driver   = "AC97",\
575             .property = "use_broken_id",\
576             .value    = stringify(1),\
577         }
578 
579 static QEMUMachine pc_machine_v0_13 = {
580     .name = "pc-0.13",
581     .desc = "Standard PC",
582     .init = pc_init_pci_no_kvmclock,
583     .max_cpus = 255,
584     .compat_props = (GlobalProperty[]) {
585         PC_COMPAT_0_13,
586         {
587             .driver   = "virtio-9p-pci",
588             .property = "vectors",
589             .value    = stringify(0),
590         },{
591             .driver   = "VGA",
592             .property = "rombar",
593             .value    = stringify(0),
594         },{
595             .driver   = "vmware-svga",
596             .property = "rombar",
597             .value    = stringify(0),
598         },
599         { /* end of list */ }
600     },
601     .hw_version = "0.13",
602     DEFAULT_MACHINE_OPTIONS,
603 };
604 
605 #define PC_COMPAT_0_12 \
606         PC_COMPAT_0_13,\
607         {\
608             .driver   = "virtio-serial-pci",\
609             .property = "max_ports",\
610             .value    = stringify(1),\
611         },{\
612             .driver   = "virtio-serial-pci",\
613             .property = "vectors",\
614             .value    = stringify(0),\
615         }
616 
617 static QEMUMachine pc_machine_v0_12 = {
618     .name = "pc-0.12",
619     .desc = "Standard PC",
620     .init = pc_init_pci_no_kvmclock,
621     .max_cpus = 255,
622     .compat_props = (GlobalProperty[]) {
623         PC_COMPAT_0_12,
624         {
625             .driver   = "VGA",
626             .property = "rombar",
627             .value    = stringify(0),
628         },{
629             .driver   = "vmware-svga",
630             .property = "rombar",
631             .value    = stringify(0),
632         },
633         { /* end of list */ }
634     },
635     .hw_version = "0.12",
636     DEFAULT_MACHINE_OPTIONS,
637 };
638 
639 #define PC_COMPAT_0_11 \
640         PC_COMPAT_0_12,\
641         {\
642             .driver   = "virtio-blk-pci",\
643             .property = "vectors",\
644             .value    = stringify(0),\
645         },{\
646             .driver   = TYPE_PCI_DEVICE,\
647             .property = "rombar",\
648             .value    = stringify(0),\
649         }
650 
651 static QEMUMachine pc_machine_v0_11 = {
652     .name = "pc-0.11",
653     .desc = "Standard PC, qemu 0.11",
654     .init = pc_init_pci_no_kvmclock,
655     .max_cpus = 255,
656     .compat_props = (GlobalProperty[]) {
657         PC_COMPAT_0_11,
658         {
659             .driver   = "ide-drive",
660             .property = "ver",
661             .value    = "0.11",
662         },{
663             .driver   = "scsi-disk",
664             .property = "ver",
665             .value    = "0.11",
666         },
667         { /* end of list */ }
668     },
669     .hw_version = "0.11",
670     DEFAULT_MACHINE_OPTIONS,
671 };
672 
673 static QEMUMachine pc_machine_v0_10 = {
674     .name = "pc-0.10",
675     .desc = "Standard PC, qemu 0.10",
676     .init = pc_init_pci_no_kvmclock,
677     .max_cpus = 255,
678     .compat_props = (GlobalProperty[]) {
679         PC_COMPAT_0_11,
680         {
681             .driver   = "virtio-blk-pci",
682             .property = "class",
683             .value    = stringify(PCI_CLASS_STORAGE_OTHER),
684         },{
685             .driver   = "virtio-serial-pci",
686             .property = "class",
687             .value    = stringify(PCI_CLASS_DISPLAY_OTHER),
688         },{
689             .driver   = "virtio-net-pci",
690             .property = "vectors",
691             .value    = stringify(0),
692         },{
693             .driver   = "ide-drive",
694             .property = "ver",
695             .value    = "0.10",
696         },{
697             .driver   = "scsi-disk",
698             .property = "ver",
699             .value    = "0.10",
700         },
701         { /* end of list */ }
702     },
703     .hw_version = "0.10",
704     DEFAULT_MACHINE_OPTIONS,
705 };
706 
707 static QEMUMachine isapc_machine = {
708     .name = "isapc",
709     .desc = "ISA-only PC",
710     .init = pc_init_isa,
711     .max_cpus = 1,
712     .compat_props = (GlobalProperty[]) {
713         {
714             .driver   = "pc-sysfw",
715             .property = "rom_only",
716             .value    = stringify(1),
717         },
718         { /* end of list */ }
719     },
720     DEFAULT_MACHINE_OPTIONS,
721 };
722 
723 #ifdef CONFIG_XEN
724 static QEMUMachine xenfv_machine = {
725     .name = "xenfv",
726     .desc = "Xen Fully-virtualized PC",
727     .init = pc_xen_hvm_init,
728     .max_cpus = HVM_MAX_VCPUS,
729     .default_machine_opts = "accel=xen",
730     DEFAULT_MACHINE_OPTIONS,
731 };
732 #endif
733 
734 static void pc_machine_init(void)
735 {
736     qemu_register_machine(&pc_i440fx_machine_v1_5);
737     qemu_register_machine(&pc_i440fx_machine_v1_4);
738     qemu_register_machine(&pc_machine_v1_3);
739     qemu_register_machine(&pc_machine_v1_2);
740     qemu_register_machine(&pc_machine_v1_1);
741     qemu_register_machine(&pc_machine_v1_0);
742     qemu_register_machine(&pc_machine_v0_15);
743     qemu_register_machine(&pc_machine_v0_14);
744     qemu_register_machine(&pc_machine_v0_13);
745     qemu_register_machine(&pc_machine_v0_12);
746     qemu_register_machine(&pc_machine_v0_11);
747     qemu_register_machine(&pc_machine_v0_10);
748     qemu_register_machine(&isapc_machine);
749 #ifdef CONFIG_XEN
750     qemu_register_machine(&xenfv_machine);
751 #endif
752 }
753 
754 machine_init(pc_machine_init);
755