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