root / hw / pc_piix.c @ 1f51470d
History | View | Annotate | Download (21.9 kB)
1 | 845773ab | Isaku Yamahata | /*
|
---|---|---|---|
2 | 845773ab | Isaku Yamahata | * QEMU PC System Emulator
|
3 | 845773ab | Isaku Yamahata | *
|
4 | 845773ab | Isaku Yamahata | * Copyright (c) 2003-2004 Fabrice Bellard
|
5 | 845773ab | Isaku Yamahata | *
|
6 | 845773ab | Isaku Yamahata | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 845773ab | Isaku Yamahata | * of this software and associated documentation files (the "Software"), to deal
|
8 | 845773ab | Isaku Yamahata | * in the Software without restriction, including without limitation the rights
|
9 | 845773ab | Isaku Yamahata | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 845773ab | Isaku Yamahata | * copies of the Software, and to permit persons to whom the Software is
|
11 | 845773ab | Isaku Yamahata | * furnished to do so, subject to the following conditions:
|
12 | 845773ab | Isaku Yamahata | *
|
13 | 845773ab | Isaku Yamahata | * The above copyright notice and this permission notice shall be included in
|
14 | 845773ab | Isaku Yamahata | * all copies or substantial portions of the Software.
|
15 | 845773ab | Isaku Yamahata | *
|
16 | 845773ab | Isaku Yamahata | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 845773ab | Isaku Yamahata | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 845773ab | Isaku Yamahata | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 845773ab | Isaku Yamahata | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 845773ab | Isaku Yamahata | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 845773ab | Isaku Yamahata | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 845773ab | Isaku Yamahata | * THE SOFTWARE.
|
23 | 845773ab | Isaku Yamahata | */
|
24 | 845773ab | Isaku Yamahata | |
25 | ae0a5466 | Avi Kivity | #include <glib.h> |
26 | ae0a5466 | Avi Kivity | |
27 | 845773ab | Isaku Yamahata | #include "hw.h" |
28 | 845773ab | Isaku Yamahata | #include "pc.h" |
29 | 845773ab | Isaku Yamahata | #include "apic.h" |
30 | 845773ab | Isaku Yamahata | #include "pci.h" |
31 | 845773ab | Isaku Yamahata | #include "usb-uhci.h" |
32 | 845773ab | Isaku Yamahata | #include "usb-ohci.h" |
33 | 845773ab | Isaku Yamahata | #include "net.h" |
34 | 845773ab | Isaku Yamahata | #include "boards.h" |
35 | 845773ab | Isaku Yamahata | #include "ide.h" |
36 | 845773ab | Isaku Yamahata | #include "kvm.h" |
37 | 3b9a6ee5 | Jan Kiszka | #include "kvm/clock.h" |
38 | 666daa68 | Markus Armbruster | #include "sysemu.h" |
39 | 96051119 | Blue Swirl | #include "sysbus.h" |
40 | 0dfa5ef9 | Isaku Yamahata | #include "arch_init.h" |
41 | 2446333c | Blue Swirl | #include "blockdev.h" |
42 | a88df0b9 | Isaku Yamahata | #include "smbus.h" |
43 | 29d3ccde | Anthony PERARD | #include "xen.h" |
44 | 4aa63af1 | Avi Kivity | #include "memory.h" |
45 | 4aa63af1 | Avi Kivity | #include "exec-memory.h" |
46 | 29d3ccde | Anthony PERARD | #ifdef CONFIG_XEN
|
47 | 29d3ccde | Anthony PERARD | # include <xen/hvm/hvm_info_table.h> |
48 | 29d3ccde | Anthony PERARD | #endif
|
49 | 845773ab | Isaku Yamahata | |
50 | 845773ab | Isaku Yamahata | #define MAX_IDE_BUS 2 |
51 | 845773ab | Isaku Yamahata | |
52 | 845773ab | Isaku Yamahata | static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; |
53 | 845773ab | Isaku Yamahata | static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; |
54 | 845773ab | Isaku Yamahata | static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; |
55 | 845773ab | Isaku Yamahata | |
56 | 10b61882 | Jan Kiszka | static void kvm_piix3_setup_irq_routing(bool pci_enabled) |
57 | 10b61882 | Jan Kiszka | { |
58 | 10b61882 | Jan Kiszka | #ifdef CONFIG_KVM
|
59 | 10b61882 | Jan Kiszka | KVMState *s = kvm_state; |
60 | 10b61882 | Jan Kiszka | int ret, i;
|
61 | 10b61882 | Jan Kiszka | |
62 | 10b61882 | Jan Kiszka | if (kvm_check_extension(s, KVM_CAP_IRQ_ROUTING)) {
|
63 | 10b61882 | Jan Kiszka | for (i = 0; i < 8; ++i) { |
64 | 10b61882 | Jan Kiszka | if (i == 2) { |
65 | 10b61882 | Jan Kiszka | continue;
|
66 | 10b61882 | Jan Kiszka | } |
67 | 10b61882 | Jan Kiszka | kvm_irqchip_add_route(s, i, KVM_IRQCHIP_PIC_MASTER, i); |
68 | 10b61882 | Jan Kiszka | } |
69 | 10b61882 | Jan Kiszka | for (i = 8; i < 16; ++i) { |
70 | 10b61882 | Jan Kiszka | kvm_irqchip_add_route(s, i, KVM_IRQCHIP_PIC_SLAVE, i - 8);
|
71 | 10b61882 | Jan Kiszka | } |
72 | a39c1d47 | Jan Kiszka | if (pci_enabled) {
|
73 | a39c1d47 | Jan Kiszka | for (i = 0; i < 24; ++i) { |
74 | a39c1d47 | Jan Kiszka | if (i == 0) { |
75 | a39c1d47 | Jan Kiszka | kvm_irqchip_add_route(s, i, KVM_IRQCHIP_IOAPIC, 2);
|
76 | a39c1d47 | Jan Kiszka | } else if (i != 2) { |
77 | a39c1d47 | Jan Kiszka | kvm_irqchip_add_route(s, i, KVM_IRQCHIP_IOAPIC, i); |
78 | a39c1d47 | Jan Kiszka | } |
79 | a39c1d47 | Jan Kiszka | } |
80 | a39c1d47 | Jan Kiszka | } |
81 | 10b61882 | Jan Kiszka | ret = kvm_irqchip_commit_routes(s); |
82 | 10b61882 | Jan Kiszka | if (ret < 0) { |
83 | 10b61882 | Jan Kiszka | hw_error("KVM IRQ routing setup failed");
|
84 | 10b61882 | Jan Kiszka | } |
85 | 10b61882 | Jan Kiszka | } |
86 | 10b61882 | Jan Kiszka | #endif /* CONFIG_KVM */ |
87 | 10b61882 | Jan Kiszka | } |
88 | 10b61882 | Jan Kiszka | |
89 | 10b61882 | Jan Kiszka | static void kvm_piix3_gsi_handler(void *opaque, int n, int level) |
90 | 10b61882 | Jan Kiszka | { |
91 | 10b61882 | Jan Kiszka | GSIState *s = opaque; |
92 | 10b61882 | Jan Kiszka | |
93 | 10b61882 | Jan Kiszka | if (n < ISA_NUM_IRQS) {
|
94 | 10b61882 | Jan Kiszka | /* Kernel will forward to both PIC and IOAPIC */
|
95 | 10b61882 | Jan Kiszka | qemu_set_irq(s->i8259_irq[n], level); |
96 | 10b61882 | Jan Kiszka | } else {
|
97 | 10b61882 | Jan Kiszka | qemu_set_irq(s->ioapic_irq[n], level); |
98 | 10b61882 | Jan Kiszka | } |
99 | 10b61882 | Jan Kiszka | } |
100 | 10b61882 | Jan Kiszka | |
101 | b881fbe9 | Jan Kiszka | static void ioapic_init(GSIState *gsi_state) |
102 | 96051119 | Blue Swirl | { |
103 | 96051119 | Blue Swirl | DeviceState *dev; |
104 | 96051119 | Blue Swirl | SysBusDevice *d; |
105 | 96051119 | Blue Swirl | unsigned int i; |
106 | 96051119 | Blue Swirl | |
107 | 3d4b2649 | Jan Kiszka | if (kvm_irqchip_in_kernel()) {
|
108 | a39c1d47 | Jan Kiszka | dev = qdev_create(NULL, "kvm-ioapic"); |
109 | a39c1d47 | Jan Kiszka | } else {
|
110 | a39c1d47 | Jan Kiszka | dev = qdev_create(NULL, "ioapic"); |
111 | a39c1d47 | Jan Kiszka | } |
112 | 96051119 | Blue Swirl | qdev_init_nofail(dev); |
113 | 96051119 | Blue Swirl | d = sysbus_from_qdev(dev); |
114 | 96051119 | Blue Swirl | sysbus_mmio_map(d, 0, 0xfec00000); |
115 | 96051119 | Blue Swirl | |
116 | 96051119 | Blue Swirl | for (i = 0; i < IOAPIC_NUM_PINS; i++) { |
117 | b881fbe9 | Jan Kiszka | gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i); |
118 | 96051119 | Blue Swirl | } |
119 | 96051119 | Blue Swirl | } |
120 | 96051119 | Blue Swirl | |
121 | 845773ab | Isaku Yamahata | /* PC hardware initialisation */
|
122 | 6bd10515 | Avi Kivity | static void pc_init1(MemoryRegion *system_memory, |
123 | aee97b84 | Avi Kivity | MemoryRegion *system_io, |
124 | 6bd10515 | Avi Kivity | ram_addr_t ram_size, |
125 | 845773ab | Isaku Yamahata | const char *boot_device, |
126 | 845773ab | Isaku Yamahata | const char *kernel_filename, |
127 | 845773ab | Isaku Yamahata | const char *kernel_cmdline, |
128 | 845773ab | Isaku Yamahata | const char *initrd_filename, |
129 | 845773ab | Isaku Yamahata | const char *cpu_model, |
130 | 0ec329da | Jan Kiszka | int pci_enabled,
|
131 | 0ec329da | Jan Kiszka | int kvmclock_enabled)
|
132 | 845773ab | Isaku Yamahata | { |
133 | 845773ab | Isaku Yamahata | int i;
|
134 | 845773ab | Isaku Yamahata | ram_addr_t below_4g_mem_size, above_4g_mem_size; |
135 | 845773ab | Isaku Yamahata | PCIBus *pci_bus; |
136 | 48a18b3c | Hervรฉ Poussineau | ISABus *isa_bus; |
137 | 845773ab | Isaku Yamahata | PCII440FXState *i440fx_state; |
138 | 845773ab | Isaku Yamahata | int piix3_devfn = -1; |
139 | 845773ab | Isaku Yamahata | qemu_irq *cpu_irq; |
140 | b881fbe9 | Jan Kiszka | qemu_irq *gsi; |
141 | 845773ab | Isaku Yamahata | qemu_irq *i8259; |
142 | 845773ab | Isaku Yamahata | qemu_irq *cmos_s3; |
143 | 845773ab | Isaku Yamahata | qemu_irq *smi_irq; |
144 | b881fbe9 | Jan Kiszka | GSIState *gsi_state; |
145 | 845773ab | Isaku Yamahata | DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; |
146 | c0897e0c | Markus Armbruster | BusState *idebus[MAX_IDE_BUS]; |
147 | 1d914fa0 | Isaku Yamahata | ISADevice *rtc_state; |
148 | 34d4260e | Kevin Wolf | ISADevice *floppy; |
149 | ae0a5466 | Avi Kivity | MemoryRegion *ram_memory; |
150 | ae0a5466 | Avi Kivity | MemoryRegion *pci_memory; |
151 | 4463aee6 | Jan Kiszka | MemoryRegion *rom_memory; |
152 | ad6d45fa | Anthony Liguori | DeviceState *dev; |
153 | 845773ab | Isaku Yamahata | |
154 | 845773ab | Isaku Yamahata | pc_cpus_init(cpu_model); |
155 | 845773ab | Isaku Yamahata | |
156 | 0ec329da | Jan Kiszka | if (kvmclock_enabled) {
|
157 | 0ec329da | Jan Kiszka | kvmclock_create(); |
158 | 0ec329da | Jan Kiszka | } |
159 | 0ec329da | Jan Kiszka | |
160 | e0e7e67b | Anthony PERARD | if (ram_size >= 0xe0000000 ) { |
161 | e0e7e67b | Anthony PERARD | above_4g_mem_size = ram_size - 0xe0000000;
|
162 | e0e7e67b | Anthony PERARD | below_4g_mem_size = 0xe0000000;
|
163 | e0e7e67b | Anthony PERARD | } else {
|
164 | e0e7e67b | Anthony PERARD | above_4g_mem_size = 0;
|
165 | e0e7e67b | Anthony PERARD | below_4g_mem_size = ram_size; |
166 | e0e7e67b | Anthony PERARD | } |
167 | e0e7e67b | Anthony PERARD | |
168 | 4463aee6 | Jan Kiszka | if (pci_enabled) {
|
169 | 4463aee6 | Jan Kiszka | pci_memory = g_new(MemoryRegion, 1);
|
170 | 4463aee6 | Jan Kiszka | memory_region_init(pci_memory, "pci", INT64_MAX);
|
171 | 4463aee6 | Jan Kiszka | rom_memory = pci_memory; |
172 | 4463aee6 | Jan Kiszka | } else {
|
173 | 4463aee6 | Jan Kiszka | pci_memory = NULL;
|
174 | 4463aee6 | Jan Kiszka | rom_memory = system_memory; |
175 | 4463aee6 | Jan Kiszka | } |
176 | ae0a5466 | Avi Kivity | |
177 | 845773ab | Isaku Yamahata | /* allocate ram and load rom/bios */
|
178 | 29d3ccde | Anthony PERARD | if (!xen_enabled()) {
|
179 | 4aa63af1 | Avi Kivity | pc_memory_init(system_memory, |
180 | 4aa63af1 | Avi Kivity | kernel_filename, kernel_cmdline, initrd_filename, |
181 | ae0a5466 | Avi Kivity | below_4g_mem_size, above_4g_mem_size, |
182 | c1d23eac | Hervรฉ Poussineau | pci_enabled ? rom_memory : system_memory, &ram_memory); |
183 | 29d3ccde | Anthony PERARD | } |
184 | 845773ab | Isaku Yamahata | |
185 | b881fbe9 | Jan Kiszka | gsi_state = g_malloc0(sizeof(*gsi_state));
|
186 | 3d4b2649 | Jan Kiszka | if (kvm_irqchip_in_kernel()) {
|
187 | 10b61882 | Jan Kiszka | kvm_piix3_setup_irq_routing(pci_enabled); |
188 | 10b61882 | Jan Kiszka | gsi = qemu_allocate_irqs(kvm_piix3_gsi_handler, gsi_state, |
189 | 10b61882 | Jan Kiszka | GSI_NUM_PINS); |
190 | 10b61882 | Jan Kiszka | } else {
|
191 | 10b61882 | Jan Kiszka | gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS); |
192 | 10b61882 | Jan Kiszka | } |
193 | 845773ab | Isaku Yamahata | |
194 | 845773ab | Isaku Yamahata | if (pci_enabled) {
|
195 | 60573079 | Hervรฉ Poussineau | pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi, |
196 | ae0a5466 | Avi Kivity | system_memory, system_io, ram_size, |
197 | ae0a5466 | Avi Kivity | below_4g_mem_size, |
198 | ae0a5466 | Avi Kivity | 0x100000000ULL - below_4g_mem_size,
|
199 | ae0a5466 | Avi Kivity | 0x100000000ULL + above_4g_mem_size,
|
200 | ae0a5466 | Avi Kivity | (sizeof(target_phys_addr_t) == 4 |
201 | ae0a5466 | Avi Kivity | ? 0
|
202 | ae0a5466 | Avi Kivity | : ((uint64_t)1 << 62)), |
203 | ae0a5466 | Avi Kivity | pci_memory, ram_memory); |
204 | 845773ab | Isaku Yamahata | } else {
|
205 | 845773ab | Isaku Yamahata | pci_bus = NULL;
|
206 | 02a89b21 | Isaku Yamahata | i440fx_state = NULL;
|
207 | 48a18b3c | Hervรฉ Poussineau | isa_bus = isa_bus_new(NULL, system_io);
|
208 | 57285cc3 | Jan Kiszka | no_hpet = 1;
|
209 | 845773ab | Isaku Yamahata | } |
210 | 48a18b3c | Hervรฉ Poussineau | isa_bus_irqs(isa_bus, gsi); |
211 | 845773ab | Isaku Yamahata | |
212 | 3d4b2649 | Jan Kiszka | if (kvm_irqchip_in_kernel()) {
|
213 | 10b61882 | Jan Kiszka | i8259 = kvm_i8259_init(isa_bus); |
214 | 10b61882 | Jan Kiszka | } else if (xen_enabled()) { |
215 | 10b61882 | Jan Kiszka | i8259 = xen_interrupt_controller_init(); |
216 | 10b61882 | Jan Kiszka | } else {
|
217 | 4bae1efe | Richard Henderson | cpu_irq = pc_allocate_cpu_irq(); |
218 | 48a18b3c | Hervรฉ Poussineau | i8259 = i8259_init(isa_bus, cpu_irq[0]);
|
219 | 4bae1efe | Richard Henderson | } |
220 | 4bae1efe | Richard Henderson | |
221 | 43a0db35 | Jan Kiszka | for (i = 0; i < ISA_NUM_IRQS; i++) { |
222 | 43a0db35 | Jan Kiszka | gsi_state->i8259_irq[i] = i8259[i]; |
223 | 43a0db35 | Jan Kiszka | } |
224 | 4bae1efe | Richard Henderson | if (pci_enabled) {
|
225 | b881fbe9 | Jan Kiszka | ioapic_init(gsi_state); |
226 | 4bae1efe | Richard Henderson | } |
227 | 4bae1efe | Richard Henderson | |
228 | b881fbe9 | Jan Kiszka | pc_register_ferr_irq(gsi[13]);
|
229 | 845773ab | Isaku Yamahata | |
230 | 48a18b3c | Hervรฉ Poussineau | dev = pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
|
231 | ad6d45fa | Anthony Liguori | if (dev) {
|
232 | 57c9fafe | Anthony Liguori | object_property_add_child(object_get_root(), "vga", OBJECT(dev), NULL); |
233 | ad6d45fa | Anthony Liguori | } |
234 | 845773ab | Isaku Yamahata | |
235 | 01195b73 | Steven Smith | if (xen_enabled()) {
|
236 | 01195b73 | Steven Smith | pci_create_simple(pci_bus, -1, "xen-platform"); |
237 | 01195b73 | Steven Smith | } |
238 | 01195b73 | Steven Smith | |
239 | 845773ab | Isaku Yamahata | /* init basic PC hardware */
|
240 | 48a18b3c | Hervรฉ Poussineau | pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled()); |
241 | 845773ab | Isaku Yamahata | |
242 | 845773ab | Isaku Yamahata | for(i = 0; i < nb_nics; i++) { |
243 | 845773ab | Isaku Yamahata | NICInfo *nd = &nd_table[i]; |
244 | 845773ab | Isaku Yamahata | |
245 | 845773ab | Isaku Yamahata | if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) |
246 | 48a18b3c | Hervรฉ Poussineau | pc_init_ne2k_isa(isa_bus, nd); |
247 | 845773ab | Isaku Yamahata | else
|
248 | 845773ab | Isaku Yamahata | pci_nic_init_nofail(nd, "e1000", NULL); |
249 | 845773ab | Isaku Yamahata | } |
250 | 845773ab | Isaku Yamahata | |
251 | 75717903 | Isaku Yamahata | ide_drive_get(hd, MAX_IDE_BUS); |
252 | 845773ab | Isaku Yamahata | if (pci_enabled) {
|
253 | c0897e0c | Markus Armbruster | PCIDevice *dev; |
254 | 679f4f8b | Stefano Stabellini | if (xen_enabled()) {
|
255 | 679f4f8b | Stefano Stabellini | dev = pci_piix3_xen_ide_init(pci_bus, hd, piix3_devfn + 1);
|
256 | 679f4f8b | Stefano Stabellini | } else {
|
257 | 679f4f8b | Stefano Stabellini | dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
|
258 | 679f4f8b | Stefano Stabellini | } |
259 | c0897e0c | Markus Armbruster | idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0"); |
260 | c0897e0c | Markus Armbruster | idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1"); |
261 | ddcada78 | Jan Kiszka | |
262 | ddcada78 | Jan Kiszka | /* FIXME there's some major spaghetti here. Somehow we create the
|
263 | ddcada78 | Jan Kiszka | * devices on the PIIX before we actually create it. We create the
|
264 | ddcada78 | Jan Kiszka | * PIIX3 deep in the recess of the i440fx creation too and then lose
|
265 | ddcada78 | Jan Kiszka | * the DeviceState.
|
266 | ddcada78 | Jan Kiszka | *
|
267 | ddcada78 | Jan Kiszka | * For now, let's "fix" this by making judicious use of paths. This
|
268 | ddcada78 | Jan Kiszka | * is not generally the right way to do this.
|
269 | ddcada78 | Jan Kiszka | */
|
270 | 57c9fafe | Anthony Liguori | object_property_add_child(object_resolve_path("/i440fx/piix3", NULL), |
271 | 57c9fafe | Anthony Liguori | "rtc", (Object *)rtc_state, NULL); |
272 | 845773ab | Isaku Yamahata | } else {
|
273 | 845773ab | Isaku Yamahata | for(i = 0; i < MAX_IDE_BUS; i++) { |
274 | c0897e0c | Markus Armbruster | ISADevice *dev; |
275 | 48a18b3c | Hervรฉ Poussineau | dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i], |
276 | 48a18b3c | Hervรฉ Poussineau | ide_irq[i], |
277 | c0897e0c | Markus Armbruster | hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]);
|
278 | c0897e0c | Markus Armbruster | idebus[i] = qdev_get_child_bus(&dev->qdev, "ide.0");
|
279 | 845773ab | Isaku Yamahata | } |
280 | 845773ab | Isaku Yamahata | } |
281 | 845773ab | Isaku Yamahata | |
282 | 4a0f031d | Hervรฉ Poussineau | audio_init(isa_bus, pci_enabled ? pci_bus : NULL);
|
283 | 845773ab | Isaku Yamahata | |
284 | c0897e0c | Markus Armbruster | pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device, |
285 | 34d4260e | Kevin Wolf | floppy, idebus[0], idebus[1], rtc_state); |
286 | 845773ab | Isaku Yamahata | |
287 | 845773ab | Isaku Yamahata | if (pci_enabled && usb_enabled) {
|
288 | 845773ab | Isaku Yamahata | usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
|
289 | 845773ab | Isaku Yamahata | } |
290 | 845773ab | Isaku Yamahata | |
291 | 845773ab | Isaku Yamahata | if (pci_enabled && acpi_enabled) {
|
292 | 845773ab | Isaku Yamahata | i2c_bus *smbus; |
293 | 845773ab | Isaku Yamahata | |
294 | c9622478 | Anthony PERARD | if (!xen_enabled()) {
|
295 | c9622478 | Anthony PERARD | cmos_s3 = qemu_allocate_irqs(pc_cmos_set_s3_resume, rtc_state, 1);
|
296 | c9622478 | Anthony PERARD | } else {
|
297 | c9622478 | Anthony PERARD | cmos_s3 = qemu_allocate_irqs(xen_cmos_set_s3_resume, rtc_state, 1);
|
298 | c9622478 | Anthony PERARD | } |
299 | 845773ab | Isaku Yamahata | smi_irq = qemu_allocate_irqs(pc_acpi_smi_interrupt, first_cpu, 1);
|
300 | 845773ab | Isaku Yamahata | /* TODO: Populate SPD eeprom data. */
|
301 | 845773ab | Isaku Yamahata | smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, |
302 | b881fbe9 | Jan Kiszka | gsi[9], *cmos_s3, *smi_irq,
|
303 | 845773ab | Isaku Yamahata | kvm_enabled()); |
304 | a88df0b9 | Isaku Yamahata | smbus_eeprom_init(smbus, 8, NULL, 0); |
305 | 845773ab | Isaku Yamahata | } |
306 | 845773ab | Isaku Yamahata | |
307 | 845773ab | Isaku Yamahata | if (pci_enabled) {
|
308 | 845773ab | Isaku Yamahata | pc_pci_device_init(pci_bus); |
309 | 845773ab | Isaku Yamahata | } |
310 | 845773ab | Isaku Yamahata | } |
311 | 845773ab | Isaku Yamahata | |
312 | 845773ab | Isaku Yamahata | static void pc_init_pci(ram_addr_t ram_size, |
313 | 845773ab | Isaku Yamahata | const char *boot_device, |
314 | 845773ab | Isaku Yamahata | const char *kernel_filename, |
315 | 845773ab | Isaku Yamahata | const char *kernel_cmdline, |
316 | 845773ab | Isaku Yamahata | const char *initrd_filename, |
317 | 845773ab | Isaku Yamahata | const char *cpu_model) |
318 | 845773ab | Isaku Yamahata | { |
319 | 6bd10515 | Avi Kivity | pc_init1(get_system_memory(), |
320 | aee97b84 | Avi Kivity | get_system_io(), |
321 | 6bd10515 | Avi Kivity | ram_size, boot_device, |
322 | 845773ab | Isaku Yamahata | kernel_filename, kernel_cmdline, |
323 | 0ec329da | Jan Kiszka | initrd_filename, cpu_model, 1, 1); |
324 | 0ec329da | Jan Kiszka | } |
325 | 0ec329da | Jan Kiszka | |
326 | 0ec329da | Jan Kiszka | static void pc_init_pci_no_kvmclock(ram_addr_t ram_size, |
327 | 0ec329da | Jan Kiszka | const char *boot_device, |
328 | 0ec329da | Jan Kiszka | const char *kernel_filename, |
329 | 0ec329da | Jan Kiszka | const char *kernel_cmdline, |
330 | 0ec329da | Jan Kiszka | const char *initrd_filename, |
331 | 0ec329da | Jan Kiszka | const char *cpu_model) |
332 | 0ec329da | Jan Kiszka | { |
333 | 6bd10515 | Avi Kivity | pc_init1(get_system_memory(), |
334 | aee97b84 | Avi Kivity | get_system_io(), |
335 | 6bd10515 | Avi Kivity | ram_size, boot_device, |
336 | 0ec329da | Jan Kiszka | kernel_filename, kernel_cmdline, |
337 | 0ec329da | Jan Kiszka | initrd_filename, cpu_model, 1, 0); |
338 | 845773ab | Isaku Yamahata | } |
339 | 845773ab | Isaku Yamahata | |
340 | 845773ab | Isaku Yamahata | static void pc_init_isa(ram_addr_t ram_size, |
341 | 845773ab | Isaku Yamahata | const char *boot_device, |
342 | 845773ab | Isaku Yamahata | const char *kernel_filename, |
343 | 845773ab | Isaku Yamahata | const char *kernel_cmdline, |
344 | 845773ab | Isaku Yamahata | const char *initrd_filename, |
345 | 845773ab | Isaku Yamahata | const char *cpu_model) |
346 | 845773ab | Isaku Yamahata | { |
347 | 845773ab | Isaku Yamahata | if (cpu_model == NULL) |
348 | 845773ab | Isaku Yamahata | cpu_model = "486";
|
349 | 6bd10515 | Avi Kivity | pc_init1(get_system_memory(), |
350 | aee97b84 | Avi Kivity | get_system_io(), |
351 | 6bd10515 | Avi Kivity | ram_size, boot_device, |
352 | 845773ab | Isaku Yamahata | kernel_filename, kernel_cmdline, |
353 | 0ec329da | Jan Kiszka | initrd_filename, cpu_model, 0, 1); |
354 | 845773ab | Isaku Yamahata | } |
355 | 845773ab | Isaku Yamahata | |
356 | 29d3ccde | Anthony PERARD | #ifdef CONFIG_XEN
|
357 | 29d3ccde | Anthony PERARD | static void pc_xen_hvm_init(ram_addr_t ram_size, |
358 | 29d3ccde | Anthony PERARD | const char *boot_device, |
359 | 29d3ccde | Anthony PERARD | const char *kernel_filename, |
360 | 29d3ccde | Anthony PERARD | const char *kernel_cmdline, |
361 | 29d3ccde | Anthony PERARD | const char *initrd_filename, |
362 | 29d3ccde | Anthony PERARD | const char *cpu_model) |
363 | 29d3ccde | Anthony PERARD | { |
364 | 29d3ccde | Anthony PERARD | if (xen_hvm_init() != 0) { |
365 | 29d3ccde | Anthony PERARD | hw_error("xen hardware virtual machine initialisation failed");
|
366 | 29d3ccde | Anthony PERARD | } |
367 | 29d3ccde | Anthony PERARD | pc_init_pci_no_kvmclock(ram_size, boot_device, |
368 | 29d3ccde | Anthony PERARD | kernel_filename, kernel_cmdline, |
369 | 29d3ccde | Anthony PERARD | initrd_filename, cpu_model); |
370 | 29d3ccde | Anthony PERARD | xen_vcpu_init(); |
371 | 29d3ccde | Anthony PERARD | } |
372 | 29d3ccde | Anthony PERARD | #endif
|
373 | 29d3ccde | Anthony PERARD | |
374 | 382b3a68 | Jordan Justen | static QEMUMachine pc_machine_v1_1 = {
|
375 | 382b3a68 | Jordan Justen | .name = "pc-1.1",
|
376 | 845773ab | Isaku Yamahata | .alias = "pc",
|
377 | 845773ab | Isaku Yamahata | .desc = "Standard PC",
|
378 | 845773ab | Isaku Yamahata | .init = pc_init_pci, |
379 | 845773ab | Isaku Yamahata | .max_cpus = 255,
|
380 | 845773ab | Isaku Yamahata | .is_default = 1,
|
381 | 845773ab | Isaku Yamahata | }; |
382 | 845773ab | Isaku Yamahata | |
383 | 382b3a68 | Jordan Justen | static QEMUMachine pc_machine_v1_0 = {
|
384 | 382b3a68 | Jordan Justen | .name = "pc-1.0",
|
385 | 382b3a68 | Jordan Justen | .desc = "Standard PC",
|
386 | 382b3a68 | Jordan Justen | .init = pc_init_pci, |
387 | 382b3a68 | Jordan Justen | .max_cpus = 255,
|
388 | 1b89fafe | Jordan Justen | .compat_props = (GlobalProperty[]) { |
389 | 1b89fafe | Jordan Justen | { |
390 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
391 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
392 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
393 | 1b89fafe | Jordan Justen | }, |
394 | 1b89fafe | Jordan Justen | { /* end of list */ }
|
395 | 1b89fafe | Jordan Justen | }, |
396 | 382b3a68 | Jordan Justen | }; |
397 | 382b3a68 | Jordan Justen | |
398 | ce01a508 | Anthony Liguori | static QEMUMachine pc_machine_v0_15 = {
|
399 | ce01a508 | Anthony Liguori | .name = "pc-0.15",
|
400 | ce01a508 | Anthony Liguori | .desc = "Standard PC",
|
401 | ce01a508 | Anthony Liguori | .init = pc_init_pci, |
402 | ce01a508 | Anthony Liguori | .max_cpus = 255,
|
403 | 1b89fafe | Jordan Justen | .compat_props = (GlobalProperty[]) { |
404 | 1b89fafe | Jordan Justen | { |
405 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
406 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
407 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
408 | 1b89fafe | Jordan Justen | }, |
409 | 1b89fafe | Jordan Justen | { /* end of list */ }
|
410 | 1b89fafe | Jordan Justen | }, |
411 | ce01a508 | Anthony Liguori | }; |
412 | ce01a508 | Anthony Liguori | |
413 | 19857e62 | Gerd Hoffmann | static QEMUMachine pc_machine_v0_14 = {
|
414 | 19857e62 | Gerd Hoffmann | .name = "pc-0.14",
|
415 | 19857e62 | Gerd Hoffmann | .desc = "Standard PC",
|
416 | 19857e62 | Gerd Hoffmann | .init = pc_init_pci, |
417 | 19857e62 | Gerd Hoffmann | .max_cpus = 255,
|
418 | 3827cdb1 | Alon Levy | .compat_props = (GlobalProperty[]) { |
419 | 3827cdb1 | Alon Levy | { |
420 | 3827cdb1 | Alon Levy | .driver = "qxl",
|
421 | 3827cdb1 | Alon Levy | .property = "revision",
|
422 | 3827cdb1 | Alon Levy | .value = stringify(2),
|
423 | 3827cdb1 | Alon Levy | },{ |
424 | 3827cdb1 | Alon Levy | .driver = "qxl-vga",
|
425 | 3827cdb1 | Alon Levy | .property = "revision",
|
426 | 3827cdb1 | Alon Levy | .value = stringify(2),
|
427 | ea830ebb | Anthony Liguori | },{ |
428 | ea830ebb | Anthony Liguori | .driver = "virtio-blk-pci",
|
429 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
430 | ea830ebb | Anthony Liguori | .value = "off",
|
431 | ea830ebb | Anthony Liguori | },{ |
432 | ea830ebb | Anthony Liguori | .driver = "virtio-serial-pci",
|
433 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
434 | ea830ebb | Anthony Liguori | .value = "off",
|
435 | ea830ebb | Anthony Liguori | },{ |
436 | ea830ebb | Anthony Liguori | .driver = "virtio-net-pci",
|
437 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
438 | ea830ebb | Anthony Liguori | .value = "off",
|
439 | ea830ebb | Anthony Liguori | },{ |
440 | ea830ebb | Anthony Liguori | .driver = "virtio-balloon-pci",
|
441 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
442 | ea830ebb | Anthony Liguori | .value = "off",
|
443 | 3827cdb1 | Alon Levy | }, |
444 | 1b89fafe | Jordan Justen | { |
445 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
446 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
447 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
448 | 1b89fafe | Jordan Justen | }, |
449 | 3827cdb1 | Alon Levy | { /* end of list */ }
|
450 | 3827cdb1 | Alon Levy | }, |
451 | 19857e62 | Gerd Hoffmann | }; |
452 | 19857e62 | Gerd Hoffmann | |
453 | b903a0f7 | Gerd Hoffmann | static QEMUMachine pc_machine_v0_13 = {
|
454 | b903a0f7 | Gerd Hoffmann | .name = "pc-0.13",
|
455 | b903a0f7 | Gerd Hoffmann | .desc = "Standard PC",
|
456 | 0ec329da | Jan Kiszka | .init = pc_init_pci_no_kvmclock, |
457 | b903a0f7 | Gerd Hoffmann | .max_cpus = 255,
|
458 | 9dbcca5a | Gerd Hoffmann | .compat_props = (GlobalProperty[]) { |
459 | 9dbcca5a | Gerd Hoffmann | { |
460 | 9dbcca5a | Gerd Hoffmann | .driver = "virtio-9p-pci",
|
461 | 9dbcca5a | Gerd Hoffmann | .property = "vectors",
|
462 | 9dbcca5a | Gerd Hoffmann | .value = stringify(0),
|
463 | 281a26b1 | Gerd Hoffmann | },{ |
464 | 281a26b1 | Gerd Hoffmann | .driver = "VGA",
|
465 | 281a26b1 | Gerd Hoffmann | .property = "rombar",
|
466 | 281a26b1 | Gerd Hoffmann | .value = stringify(0),
|
467 | 281a26b1 | Gerd Hoffmann | },{ |
468 | 281a26b1 | Gerd Hoffmann | .driver = "vmware-svga",
|
469 | 281a26b1 | Gerd Hoffmann | .property = "rombar",
|
470 | 281a26b1 | Gerd Hoffmann | .value = stringify(0),
|
471 | 362dd48c | Isaku Yamahata | },{ |
472 | 362dd48c | Isaku Yamahata | .driver = "PCI",
|
473 | 362dd48c | Isaku Yamahata | .property = "command_serr_enable",
|
474 | 362dd48c | Isaku Yamahata | .value = "off",
|
475 | b91cb442 | Michael S. Tsirkin | },{ |
476 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-blk-pci",
|
477 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
478 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
479 | b91cb442 | Michael S. Tsirkin | },{ |
480 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-serial-pci",
|
481 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
482 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
483 | b91cb442 | Michael S. Tsirkin | },{ |
484 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-net-pci",
|
485 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
486 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
487 | 25a21c94 | Gerd Hoffmann | },{ |
488 | ea830ebb | Anthony Liguori | .driver = "virtio-balloon-pci",
|
489 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
490 | ea830ebb | Anthony Liguori | .value = "off",
|
491 | ea830ebb | Anthony Liguori | },{ |
492 | 25a21c94 | Gerd Hoffmann | .driver = "AC97",
|
493 | 25a21c94 | Gerd Hoffmann | .property = "use_broken_id",
|
494 | 25a21c94 | Gerd Hoffmann | .value = stringify(1),
|
495 | 9dbcca5a | Gerd Hoffmann | }, |
496 | 1b89fafe | Jordan Justen | { |
497 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
498 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
499 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
500 | 1b89fafe | Jordan Justen | }, |
501 | 9dbcca5a | Gerd Hoffmann | { /* end of list */ }
|
502 | 9dbcca5a | Gerd Hoffmann | }, |
503 | b903a0f7 | Gerd Hoffmann | }; |
504 | b903a0f7 | Gerd Hoffmann | |
505 | 845773ab | Isaku Yamahata | static QEMUMachine pc_machine_v0_12 = {
|
506 | 845773ab | Isaku Yamahata | .name = "pc-0.12",
|
507 | 845773ab | Isaku Yamahata | .desc = "Standard PC",
|
508 | 0ec329da | Jan Kiszka | .init = pc_init_pci_no_kvmclock, |
509 | 845773ab | Isaku Yamahata | .max_cpus = 255,
|
510 | 845773ab | Isaku Yamahata | .compat_props = (GlobalProperty[]) { |
511 | 845773ab | Isaku Yamahata | { |
512 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
513 | 1e29a009 | Amit Shah | .property = "max_ports",
|
514 | 845773ab | Isaku Yamahata | .value = stringify(1),
|
515 | 845773ab | Isaku Yamahata | },{ |
516 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
517 | 845773ab | Isaku Yamahata | .property = "vectors",
|
518 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
519 | 281a26b1 | Gerd Hoffmann | },{ |
520 | 281a26b1 | Gerd Hoffmann | .driver = "VGA",
|
521 | 281a26b1 | Gerd Hoffmann | .property = "rombar",
|
522 | 281a26b1 | Gerd Hoffmann | .value = stringify(0),
|
523 | 281a26b1 | Gerd Hoffmann | },{ |
524 | 281a26b1 | Gerd Hoffmann | .driver = "vmware-svga",
|
525 | 281a26b1 | Gerd Hoffmann | .property = "rombar",
|
526 | 281a26b1 | Gerd Hoffmann | .value = stringify(0),
|
527 | b1aeb926 | Isaku Yamahata | },{ |
528 | b1aeb926 | Isaku Yamahata | .driver = "PCI",
|
529 | b1aeb926 | Isaku Yamahata | .property = "command_serr_enable",
|
530 | b1aeb926 | Isaku Yamahata | .value = "off",
|
531 | b91cb442 | Michael S. Tsirkin | },{ |
532 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-blk-pci",
|
533 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
534 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
535 | b91cb442 | Michael S. Tsirkin | },{ |
536 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-serial-pci",
|
537 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
538 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
539 | b91cb442 | Michael S. Tsirkin | },{ |
540 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-net-pci",
|
541 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
542 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
543 | 25a21c94 | Gerd Hoffmann | },{ |
544 | ea830ebb | Anthony Liguori | .driver = "virtio-balloon-pci",
|
545 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
546 | ea830ebb | Anthony Liguori | .value = "off",
|
547 | ea830ebb | Anthony Liguori | },{ |
548 | 25a21c94 | Gerd Hoffmann | .driver = "AC97",
|
549 | 25a21c94 | Gerd Hoffmann | .property = "use_broken_id",
|
550 | 25a21c94 | Gerd Hoffmann | .value = stringify(1),
|
551 | 845773ab | Isaku Yamahata | }, |
552 | 1b89fafe | Jordan Justen | { |
553 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
554 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
555 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
556 | 1b89fafe | Jordan Justen | }, |
557 | 845773ab | Isaku Yamahata | { /* end of list */ }
|
558 | 845773ab | Isaku Yamahata | } |
559 | 845773ab | Isaku Yamahata | }; |
560 | 845773ab | Isaku Yamahata | |
561 | 845773ab | Isaku Yamahata | static QEMUMachine pc_machine_v0_11 = {
|
562 | 845773ab | Isaku Yamahata | .name = "pc-0.11",
|
563 | 845773ab | Isaku Yamahata | .desc = "Standard PC, qemu 0.11",
|
564 | 0ec329da | Jan Kiszka | .init = pc_init_pci_no_kvmclock, |
565 | 845773ab | Isaku Yamahata | .max_cpus = 255,
|
566 | 845773ab | Isaku Yamahata | .compat_props = (GlobalProperty[]) { |
567 | 845773ab | Isaku Yamahata | { |
568 | 845773ab | Isaku Yamahata | .driver = "virtio-blk-pci",
|
569 | 845773ab | Isaku Yamahata | .property = "vectors",
|
570 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
571 | 845773ab | Isaku Yamahata | },{ |
572 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
573 | 1e29a009 | Amit Shah | .property = "max_ports",
|
574 | 845773ab | Isaku Yamahata | .value = stringify(1),
|
575 | 845773ab | Isaku Yamahata | },{ |
576 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
577 | 845773ab | Isaku Yamahata | .property = "vectors",
|
578 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
579 | 845773ab | Isaku Yamahata | },{ |
580 | 845773ab | Isaku Yamahata | .driver = "ide-drive",
|
581 | 845773ab | Isaku Yamahata | .property = "ver",
|
582 | 845773ab | Isaku Yamahata | .value = "0.11",
|
583 | 845773ab | Isaku Yamahata | },{ |
584 | 845773ab | Isaku Yamahata | .driver = "scsi-disk",
|
585 | 845773ab | Isaku Yamahata | .property = "ver",
|
586 | 845773ab | Isaku Yamahata | .value = "0.11",
|
587 | 845773ab | Isaku Yamahata | },{ |
588 | 845773ab | Isaku Yamahata | .driver = "PCI",
|
589 | 845773ab | Isaku Yamahata | .property = "rombar",
|
590 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
591 | b1aeb926 | Isaku Yamahata | },{ |
592 | b1aeb926 | Isaku Yamahata | .driver = "PCI",
|
593 | b1aeb926 | Isaku Yamahata | .property = "command_serr_enable",
|
594 | b1aeb926 | Isaku Yamahata | .value = "off",
|
595 | b91cb442 | Michael S. Tsirkin | },{ |
596 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-blk-pci",
|
597 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
598 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
599 | b91cb442 | Michael S. Tsirkin | },{ |
600 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-serial-pci",
|
601 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
602 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
603 | b91cb442 | Michael S. Tsirkin | },{ |
604 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-net-pci",
|
605 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
606 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
607 | 25a21c94 | Gerd Hoffmann | },{ |
608 | ea830ebb | Anthony Liguori | .driver = "virtio-balloon-pci",
|
609 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
610 | ea830ebb | Anthony Liguori | .value = "off",
|
611 | ea830ebb | Anthony Liguori | },{ |
612 | 25a21c94 | Gerd Hoffmann | .driver = "AC97",
|
613 | 25a21c94 | Gerd Hoffmann | .property = "use_broken_id",
|
614 | 25a21c94 | Gerd Hoffmann | .value = stringify(1),
|
615 | 845773ab | Isaku Yamahata | }, |
616 | 1b89fafe | Jordan Justen | { |
617 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
618 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
619 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
620 | 1b89fafe | Jordan Justen | }, |
621 | 845773ab | Isaku Yamahata | { /* end of list */ }
|
622 | 845773ab | Isaku Yamahata | } |
623 | 845773ab | Isaku Yamahata | }; |
624 | 845773ab | Isaku Yamahata | |
625 | 845773ab | Isaku Yamahata | static QEMUMachine pc_machine_v0_10 = {
|
626 | 845773ab | Isaku Yamahata | .name = "pc-0.10",
|
627 | 845773ab | Isaku Yamahata | .desc = "Standard PC, qemu 0.10",
|
628 | 0ec329da | Jan Kiszka | .init = pc_init_pci_no_kvmclock, |
629 | 845773ab | Isaku Yamahata | .max_cpus = 255,
|
630 | 845773ab | Isaku Yamahata | .compat_props = (GlobalProperty[]) { |
631 | 845773ab | Isaku Yamahata | { |
632 | 845773ab | Isaku Yamahata | .driver = "virtio-blk-pci",
|
633 | 845773ab | Isaku Yamahata | .property = "class",
|
634 | 845773ab | Isaku Yamahata | .value = stringify(PCI_CLASS_STORAGE_OTHER), |
635 | 845773ab | Isaku Yamahata | },{ |
636 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
637 | 845773ab | Isaku Yamahata | .property = "class",
|
638 | 845773ab | Isaku Yamahata | .value = stringify(PCI_CLASS_DISPLAY_OTHER), |
639 | 845773ab | Isaku Yamahata | },{ |
640 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
641 | 1e29a009 | Amit Shah | .property = "max_ports",
|
642 | 845773ab | Isaku Yamahata | .value = stringify(1),
|
643 | 845773ab | Isaku Yamahata | },{ |
644 | 845773ab | Isaku Yamahata | .driver = "virtio-serial-pci",
|
645 | 845773ab | Isaku Yamahata | .property = "vectors",
|
646 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
647 | 845773ab | Isaku Yamahata | },{ |
648 | 845773ab | Isaku Yamahata | .driver = "virtio-net-pci",
|
649 | 845773ab | Isaku Yamahata | .property = "vectors",
|
650 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
651 | 845773ab | Isaku Yamahata | },{ |
652 | 845773ab | Isaku Yamahata | .driver = "virtio-blk-pci",
|
653 | 845773ab | Isaku Yamahata | .property = "vectors",
|
654 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
655 | 845773ab | Isaku Yamahata | },{ |
656 | 845773ab | Isaku Yamahata | .driver = "ide-drive",
|
657 | 845773ab | Isaku Yamahata | .property = "ver",
|
658 | 845773ab | Isaku Yamahata | .value = "0.10",
|
659 | 845773ab | Isaku Yamahata | },{ |
660 | 845773ab | Isaku Yamahata | .driver = "scsi-disk",
|
661 | 845773ab | Isaku Yamahata | .property = "ver",
|
662 | 845773ab | Isaku Yamahata | .value = "0.10",
|
663 | 845773ab | Isaku Yamahata | },{ |
664 | 845773ab | Isaku Yamahata | .driver = "PCI",
|
665 | 845773ab | Isaku Yamahata | .property = "rombar",
|
666 | 845773ab | Isaku Yamahata | .value = stringify(0),
|
667 | b1aeb926 | Isaku Yamahata | },{ |
668 | b1aeb926 | Isaku Yamahata | .driver = "PCI",
|
669 | b1aeb926 | Isaku Yamahata | .property = "command_serr_enable",
|
670 | b1aeb926 | Isaku Yamahata | .value = "off",
|
671 | b91cb442 | Michael S. Tsirkin | },{ |
672 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-blk-pci",
|
673 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
674 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
675 | b91cb442 | Michael S. Tsirkin | },{ |
676 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-serial-pci",
|
677 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
678 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
679 | b91cb442 | Michael S. Tsirkin | },{ |
680 | b91cb442 | Michael S. Tsirkin | .driver = "virtio-net-pci",
|
681 | b91cb442 | Michael S. Tsirkin | .property = "event_idx",
|
682 | b91cb442 | Michael S. Tsirkin | .value = "off",
|
683 | 25a21c94 | Gerd Hoffmann | },{ |
684 | ea830ebb | Anthony Liguori | .driver = "virtio-balloon-pci",
|
685 | ea830ebb | Anthony Liguori | .property = "event_idx",
|
686 | ea830ebb | Anthony Liguori | .value = "off",
|
687 | ea830ebb | Anthony Liguori | },{ |
688 | 25a21c94 | Gerd Hoffmann | .driver = "AC97",
|
689 | 25a21c94 | Gerd Hoffmann | .property = "use_broken_id",
|
690 | 25a21c94 | Gerd Hoffmann | .value = stringify(1),
|
691 | 845773ab | Isaku Yamahata | }, |
692 | 1b89fafe | Jordan Justen | { |
693 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
694 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
695 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
696 | 1b89fafe | Jordan Justen | }, |
697 | 845773ab | Isaku Yamahata | { /* end of list */ }
|
698 | 845773ab | Isaku Yamahata | }, |
699 | 845773ab | Isaku Yamahata | }; |
700 | 845773ab | Isaku Yamahata | |
701 | 845773ab | Isaku Yamahata | static QEMUMachine isapc_machine = {
|
702 | 845773ab | Isaku Yamahata | .name = "isapc",
|
703 | 845773ab | Isaku Yamahata | .desc = "ISA-only PC",
|
704 | 845773ab | Isaku Yamahata | .init = pc_init_isa, |
705 | 845773ab | Isaku Yamahata | .max_cpus = 1,
|
706 | 1b89fafe | Jordan Justen | .compat_props = (GlobalProperty[]) { |
707 | 1b89fafe | Jordan Justen | { |
708 | 1b89fafe | Jordan Justen | .driver = "pc-sysfw",
|
709 | 1b89fafe | Jordan Justen | .property = "rom_only",
|
710 | 1b89fafe | Jordan Justen | .value = stringify(1),
|
711 | 1b89fafe | Jordan Justen | }, |
712 | 1b89fafe | Jordan Justen | { /* end of list */ }
|
713 | 1b89fafe | Jordan Justen | }, |
714 | 845773ab | Isaku Yamahata | }; |
715 | 845773ab | Isaku Yamahata | |
716 | 29d3ccde | Anthony PERARD | #ifdef CONFIG_XEN
|
717 | 29d3ccde | Anthony PERARD | static QEMUMachine xenfv_machine = {
|
718 | 29d3ccde | Anthony PERARD | .name = "xenfv",
|
719 | 29d3ccde | Anthony PERARD | .desc = "Xen Fully-virtualized PC",
|
720 | 29d3ccde | Anthony PERARD | .init = pc_xen_hvm_init, |
721 | 29d3ccde | Anthony PERARD | .max_cpus = HVM_MAX_VCPUS, |
722 | 29d3ccde | Anthony PERARD | .default_machine_opts = "accel=xen",
|
723 | 29d3ccde | Anthony PERARD | }; |
724 | 29d3ccde | Anthony PERARD | #endif
|
725 | 29d3ccde | Anthony PERARD | |
726 | 845773ab | Isaku Yamahata | static void pc_machine_init(void) |
727 | 845773ab | Isaku Yamahata | { |
728 | 382b3a68 | Jordan Justen | qemu_register_machine(&pc_machine_v1_1); |
729 | 19857e62 | Gerd Hoffmann | qemu_register_machine(&pc_machine_v1_0); |
730 | ce01a508 | Anthony Liguori | qemu_register_machine(&pc_machine_v0_15); |
731 | 19857e62 | Gerd Hoffmann | qemu_register_machine(&pc_machine_v0_14); |
732 | b903a0f7 | Gerd Hoffmann | qemu_register_machine(&pc_machine_v0_13); |
733 | 845773ab | Isaku Yamahata | qemu_register_machine(&pc_machine_v0_12); |
734 | 845773ab | Isaku Yamahata | qemu_register_machine(&pc_machine_v0_11); |
735 | 845773ab | Isaku Yamahata | qemu_register_machine(&pc_machine_v0_10); |
736 | 845773ab | Isaku Yamahata | qemu_register_machine(&isapc_machine); |
737 | 29d3ccde | Anthony PERARD | #ifdef CONFIG_XEN
|
738 | 29d3ccde | Anthony PERARD | qemu_register_machine(&xenfv_machine); |
739 | 29d3ccde | Anthony PERARD | #endif
|
740 | 845773ab | Isaku Yamahata | } |
741 | 845773ab | Isaku Yamahata | |
742 | 845773ab | Isaku Yamahata | machine_init(pc_machine_init); |