Statistics
| Branch: | Revision:

root / hw / s390-virtio.c @ bc4caf49

History | View | Annotate | Download (9.9 kB)

1 8cb310e1 Alexander Graf
/*
2 8cb310e1 Alexander Graf
 * QEMU S390 virtio target
3 8cb310e1 Alexander Graf
 *
4 8cb310e1 Alexander Graf
 * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
5 8cb310e1 Alexander Graf
 *
6 8cb310e1 Alexander Graf
 * This library is free software; you can redistribute it and/or
7 8cb310e1 Alexander Graf
 * modify it under the terms of the GNU Lesser General Public
8 8cb310e1 Alexander Graf
 * License as published by the Free Software Foundation; either
9 8cb310e1 Alexander Graf
 * version 2 of the License, or (at your option) any later version.
10 8cb310e1 Alexander Graf
 *
11 8cb310e1 Alexander Graf
 * This library is distributed in the hope that it will be useful,
12 8cb310e1 Alexander Graf
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 8cb310e1 Alexander Graf
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 8cb310e1 Alexander Graf
 * Lesser General Public License for more details.
15 8cb310e1 Alexander Graf
 *
16 8cb310e1 Alexander Graf
 * You should have received a copy of the GNU Lesser General Public
17 8cb310e1 Alexander Graf
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 8cb310e1 Alexander Graf
 */
19 8cb310e1 Alexander Graf
20 8cb310e1 Alexander Graf
#include "hw.h"
21 8cb310e1 Alexander Graf
#include "block.h"
22 6c33286a Alexander Graf
#include "blockdev.h"
23 8cb310e1 Alexander Graf
#include "sysemu.h"
24 8cb310e1 Alexander Graf
#include "net.h"
25 8cb310e1 Alexander Graf
#include "boards.h"
26 8cb310e1 Alexander Graf
#include "monitor.h"
27 8cb310e1 Alexander Graf
#include "loader.h"
28 8cb310e1 Alexander Graf
#include "elf.h"
29 8cb310e1 Alexander Graf
#include "hw/virtio.h"
30 8cb310e1 Alexander Graf
#include "hw/sysbus.h"
31 8cb310e1 Alexander Graf
#include "kvm.h"
32 ca3dbc27 Avi Kivity
#include "exec-memory.h"
33 8cb310e1 Alexander Graf
34 8cb310e1 Alexander Graf
#include "hw/s390-virtio-bus.h"
35 8cb310e1 Alexander Graf
36 8cb310e1 Alexander Graf
//#define DEBUG_S390
37 8cb310e1 Alexander Graf
38 8cb310e1 Alexander Graf
#ifdef DEBUG_S390
39 8cb310e1 Alexander Graf
#define dprintf(fmt, ...) \
40 8cb310e1 Alexander Graf
    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
41 8cb310e1 Alexander Graf
#else
42 8cb310e1 Alexander Graf
#define dprintf(fmt, ...) \
43 8cb310e1 Alexander Graf
    do { } while (0)
44 8cb310e1 Alexander Graf
#endif
45 8cb310e1 Alexander Graf
46 8cb310e1 Alexander Graf
#define KVM_S390_VIRTIO_NOTIFY          0
47 8cb310e1 Alexander Graf
#define KVM_S390_VIRTIO_RESET           1
48 8cb310e1 Alexander Graf
#define KVM_S390_VIRTIO_SET_STATUS      2
49 8cb310e1 Alexander Graf
50 8cb310e1 Alexander Graf
#define KERN_IMAGE_START                0x010000UL
51 8cb310e1 Alexander Graf
#define KERN_PARM_AREA                  0x010480UL
52 8cb310e1 Alexander Graf
#define INITRD_START                    0x800000UL
53 8cb310e1 Alexander Graf
#define INITRD_PARM_START               0x010408UL
54 8cb310e1 Alexander Graf
#define INITRD_PARM_SIZE                0x010410UL
55 8cb310e1 Alexander Graf
#define PARMFILE_START                  0x001000UL
56 8cb310e1 Alexander Graf
57 fe270d04 Alexander Graf
#define ZIPL_START                        0x009000UL
58 fe270d04 Alexander Graf
#define ZIPL_LOAD_ADDR                        0x009000UL
59 fe270d04 Alexander Graf
#define ZIPL_FILENAME                        "s390-zipl.rom"
60 fe270d04 Alexander Graf
61 8cb310e1 Alexander Graf
#define MAX_BLK_DEVS                    10
62 8cb310e1 Alexander Graf
63 8cb310e1 Alexander Graf
static VirtIOS390Bus *s390_bus;
64 0e4213a7 Andreas Färber
static CPUS390XState **ipi_states;
65 8cb310e1 Alexander Graf
66 0e4213a7 Andreas Färber
CPUS390XState *s390_cpu_addr2state(uint16_t cpu_addr)
67 8cb310e1 Alexander Graf
{
68 8cb310e1 Alexander Graf
    if (cpu_addr >= smp_cpus) {
69 8cb310e1 Alexander Graf
        return NULL;
70 8cb310e1 Alexander Graf
    }
71 8cb310e1 Alexander Graf
72 8cb310e1 Alexander Graf
    return ipi_states[cpu_addr];
73 8cb310e1 Alexander Graf
}
74 8cb310e1 Alexander Graf
75 0e4213a7 Andreas Färber
int s390_virtio_hypercall(CPUS390XState *env, uint64_t mem, uint64_t hypercall)
76 8cb310e1 Alexander Graf
{
77 8cb310e1 Alexander Graf
    int r = 0, i;
78 8cb310e1 Alexander Graf
79 8d5192ee Alexander Graf
    dprintf("KVM hypercall: %ld\n", hypercall);
80 8d5192ee Alexander Graf
    switch (hypercall) {
81 8cb310e1 Alexander Graf
    case KVM_S390_VIRTIO_NOTIFY:
82 8cb310e1 Alexander Graf
        if (mem > ram_size) {
83 8cb310e1 Alexander Graf
            VirtIOS390Device *dev = s390_virtio_bus_find_vring(s390_bus,
84 8cb310e1 Alexander Graf
                                                               mem, &i);
85 8cb310e1 Alexander Graf
            if (dev) {
86 8cb310e1 Alexander Graf
                virtio_queue_notify(dev->vdev, i);
87 8cb310e1 Alexander Graf
            } else {
88 8cb310e1 Alexander Graf
                r = -EINVAL;
89 8cb310e1 Alexander Graf
            }
90 8cb310e1 Alexander Graf
        } else {
91 8cb310e1 Alexander Graf
            /* Early printk */
92 8cb310e1 Alexander Graf
        }
93 8cb310e1 Alexander Graf
        break;
94 8cb310e1 Alexander Graf
    case KVM_S390_VIRTIO_RESET:
95 8cb310e1 Alexander Graf
    {
96 baf0b55a Alexander Graf
        VirtIOS390Device *dev;
97 baf0b55a Alexander Graf
98 baf0b55a Alexander Graf
        dev = s390_virtio_bus_find_mem(s390_bus, mem);
99 baf0b55a Alexander Graf
        virtio_reset(dev->vdev);
100 e9d86b76 Christian Borntraeger
        stb_phys(dev->dev_offs + VIRTIO_DEV_OFFS_STATUS, 0);
101 baf0b55a Alexander Graf
        s390_virtio_device_sync(dev);
102 4170aea1 Jens Freimann
        s390_virtio_reset_idx(dev);
103 8cb310e1 Alexander Graf
        break;
104 8cb310e1 Alexander Graf
    }
105 8cb310e1 Alexander Graf
    case KVM_S390_VIRTIO_SET_STATUS:
106 8cb310e1 Alexander Graf
    {
107 8cb310e1 Alexander Graf
        VirtIOS390Device *dev;
108 8cb310e1 Alexander Graf
109 8cb310e1 Alexander Graf
        dev = s390_virtio_bus_find_mem(s390_bus, mem);
110 8cb310e1 Alexander Graf
        if (dev) {
111 8cb310e1 Alexander Graf
            s390_virtio_device_update_status(dev);
112 8cb310e1 Alexander Graf
        } else {
113 8cb310e1 Alexander Graf
            r = -EINVAL;
114 8cb310e1 Alexander Graf
        }
115 8cb310e1 Alexander Graf
        break;
116 8cb310e1 Alexander Graf
    }
117 8cb310e1 Alexander Graf
    default:
118 8cb310e1 Alexander Graf
        r = -EINVAL;
119 8cb310e1 Alexander Graf
        break;
120 8cb310e1 Alexander Graf
    }
121 8cb310e1 Alexander Graf
122 8d5192ee Alexander Graf
    return r;
123 8cb310e1 Alexander Graf
}
124 8cb310e1 Alexander Graf
125 854e42f3 Christian Borntraeger
/*
126 854e42f3 Christian Borntraeger
 * The number of running CPUs. On s390 a shutdown is the state of all CPUs
127 854e42f3 Christian Borntraeger
 * being either stopped or disabled (for interrupts) waiting. We have to
128 854e42f3 Christian Borntraeger
 * track this number to call the shutdown sequence accordingly. This
129 854e42f3 Christian Borntraeger
 * number is modified either on startup or while holding the big qemu lock.
130 854e42f3 Christian Borntraeger
 */
131 854e42f3 Christian Borntraeger
static unsigned s390_running_cpus;
132 854e42f3 Christian Borntraeger
133 0e4213a7 Andreas Färber
void s390_add_running_cpu(CPUS390XState *env)
134 854e42f3 Christian Borntraeger
{
135 854e42f3 Christian Borntraeger
    if (env->halted) {
136 854e42f3 Christian Borntraeger
        s390_running_cpus++;
137 854e42f3 Christian Borntraeger
        env->halted = 0;
138 854e42f3 Christian Borntraeger
        env->exception_index = -1;
139 854e42f3 Christian Borntraeger
    }
140 854e42f3 Christian Borntraeger
}
141 854e42f3 Christian Borntraeger
142 0e4213a7 Andreas Färber
unsigned s390_del_running_cpu(CPUS390XState *env)
143 854e42f3 Christian Borntraeger
{
144 854e42f3 Christian Borntraeger
    if (env->halted == 0) {
145 854e42f3 Christian Borntraeger
        assert(s390_running_cpus >= 1);
146 854e42f3 Christian Borntraeger
        s390_running_cpus--;
147 854e42f3 Christian Borntraeger
        env->halted = 1;
148 854e42f3 Christian Borntraeger
        env->exception_index = EXCP_HLT;
149 854e42f3 Christian Borntraeger
    }
150 854e42f3 Christian Borntraeger
    return s390_running_cpus;
151 854e42f3 Christian Borntraeger
}
152 854e42f3 Christian Borntraeger
153 8cb310e1 Alexander Graf
/* PC hardware initialisation */
154 22486aa0 Christian Borntraeger
static void s390_init(ram_addr_t my_ram_size,
155 8cb310e1 Alexander Graf
                      const char *boot_device,
156 8cb310e1 Alexander Graf
                      const char *kernel_filename,
157 8cb310e1 Alexander Graf
                      const char *kernel_cmdline,
158 8cb310e1 Alexander Graf
                      const char *initrd_filename,
159 8cb310e1 Alexander Graf
                      const char *cpu_model)
160 8cb310e1 Alexander Graf
{
161 0e4213a7 Andreas Färber
    CPUS390XState *env = NULL;
162 ca3dbc27 Avi Kivity
    MemoryRegion *sysmem = get_system_memory();
163 ca3dbc27 Avi Kivity
    MemoryRegion *ram = g_new(MemoryRegion, 1);
164 8cb310e1 Alexander Graf
    ram_addr_t kernel_size = 0;
165 8cb310e1 Alexander Graf
    ram_addr_t initrd_offset;
166 8cb310e1 Alexander Graf
    ram_addr_t initrd_size = 0;
167 22486aa0 Christian Borntraeger
    int shift = 0;
168 8d5192ee Alexander Graf
    uint8_t *storage_keys;
169 326384d5 Alexander Graf
    void *virtio_region;
170 326384d5 Alexander Graf
    target_phys_addr_t virtio_region_len;
171 326384d5 Alexander Graf
    target_phys_addr_t virtio_region_start;
172 8cb310e1 Alexander Graf
    int i;
173 8cb310e1 Alexander Graf
174 22486aa0 Christian Borntraeger
    /* s390x ram size detection needs a 16bit multiplier + an increment. So
175 22486aa0 Christian Borntraeger
       guests > 64GB can be specified in 2MB steps etc. */
176 22486aa0 Christian Borntraeger
    while ((my_ram_size >> (20 + shift)) > 65535) {
177 22486aa0 Christian Borntraeger
        shift++;
178 22486aa0 Christian Borntraeger
    }
179 22486aa0 Christian Borntraeger
    my_ram_size = my_ram_size >> (20 + shift) << (20 + shift);
180 22486aa0 Christian Borntraeger
181 22486aa0 Christian Borntraeger
    /* lets propagate the changed ram size into the global variable. */
182 22486aa0 Christian Borntraeger
    ram_size = my_ram_size;
183 e249651c Alexander Graf
184 8cb310e1 Alexander Graf
    /* get a BUS */
185 22486aa0 Christian Borntraeger
    s390_bus = s390_virtio_bus_init(&my_ram_size);
186 8cb310e1 Alexander Graf
187 8cb310e1 Alexander Graf
    /* allocate RAM */
188 c5705a77 Avi Kivity
    memory_region_init_ram(ram, "s390.ram", my_ram_size);
189 c5705a77 Avi Kivity
    vmstate_register_ram_global(ram);
190 ca3dbc27 Avi Kivity
    memory_region_add_subregion(sysmem, 0, ram);
191 8cb310e1 Alexander Graf
192 326384d5 Alexander Graf
    /* clear virtio region */
193 326384d5 Alexander Graf
    virtio_region_len = my_ram_size - ram_size;
194 326384d5 Alexander Graf
    virtio_region_start = ram_size;
195 326384d5 Alexander Graf
    virtio_region = cpu_physical_memory_map(virtio_region_start,
196 326384d5 Alexander Graf
                                            &virtio_region_len, true);
197 326384d5 Alexander Graf
    memset(virtio_region, 0, virtio_region_len);
198 326384d5 Alexander Graf
    cpu_physical_memory_unmap(virtio_region, virtio_region_len, 1,
199 326384d5 Alexander Graf
                              virtio_region_len);
200 326384d5 Alexander Graf
201 8d5192ee Alexander Graf
    /* allocate storage keys */
202 7267c094 Anthony Liguori
    storage_keys = g_malloc0(my_ram_size / TARGET_PAGE_SIZE);
203 8d5192ee Alexander Graf
204 8cb310e1 Alexander Graf
    /* init CPUs */
205 8cb310e1 Alexander Graf
    if (cpu_model == NULL) {
206 8cb310e1 Alexander Graf
        cpu_model = "host";
207 8cb310e1 Alexander Graf
    }
208 8cb310e1 Alexander Graf
209 0e4213a7 Andreas Färber
    ipi_states = g_malloc(sizeof(CPUS390XState *) * smp_cpus);
210 8cb310e1 Alexander Graf
211 8cb310e1 Alexander Graf
    for (i = 0; i < smp_cpus; i++) {
212 0e4213a7 Andreas Färber
        CPUS390XState *tmp_env;
213 8cb310e1 Alexander Graf
214 8cb310e1 Alexander Graf
        tmp_env = cpu_init(cpu_model);
215 8cb310e1 Alexander Graf
        if (!env) {
216 8cb310e1 Alexander Graf
            env = tmp_env;
217 8cb310e1 Alexander Graf
        }
218 8cb310e1 Alexander Graf
        ipi_states[i] = tmp_env;
219 8cb310e1 Alexander Graf
        tmp_env->halted = 1;
220 8cb310e1 Alexander Graf
        tmp_env->exception_index = EXCP_HLT;
221 8d5192ee Alexander Graf
        tmp_env->storage_keys = storage_keys;
222 8cb310e1 Alexander Graf
    }
223 8cb310e1 Alexander Graf
224 854e42f3 Christian Borntraeger
    /* One CPU has to run */
225 854e42f3 Christian Borntraeger
    s390_add_running_cpu(env);
226 8cb310e1 Alexander Graf
227 8cb310e1 Alexander Graf
    if (kernel_filename) {
228 8cb310e1 Alexander Graf
229 1edb4934 Christian Borntraeger
        kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, NULL,
230 1edb4934 Christian Borntraeger
                               NULL, 1, ELF_MACHINE, 0);
231 1edb4934 Christian Borntraeger
        if (kernel_size == -1UL) {
232 1edb4934 Christian Borntraeger
            kernel_size = load_image_targphys(kernel_filename, 0, ram_size);
233 8cb310e1 Alexander Graf
        }
234 118a8977 Christian Borntraeger
        if (kernel_size == -1UL) {
235 118a8977 Christian Borntraeger
            fprintf(stderr, "qemu: could not load kernel '%s'\n",
236 118a8977 Christian Borntraeger
                    kernel_filename);
237 118a8977 Christian Borntraeger
            exit(1);
238 118a8977 Christian Borntraeger
        }
239 1edb4934 Christian Borntraeger
        /*
240 1edb4934 Christian Borntraeger
         * we can not rely on the ELF entry point, since up to 3.2 this
241 1edb4934 Christian Borntraeger
         * value was 0x800 (the SALIPL loader) and it wont work. For
242 1edb4934 Christian Borntraeger
         * all (Linux) cases 0x10000 (KERN_IMAGE_START) should be fine.
243 1edb4934 Christian Borntraeger
         */
244 8cb310e1 Alexander Graf
        env->psw.addr = KERN_IMAGE_START;
245 0435d393 Michael S. Tsirkin
        env->psw.mask = 0x0000000180000000ULL;
246 fe270d04 Alexander Graf
    } else {
247 fe270d04 Alexander Graf
        ram_addr_t bios_size = 0;
248 fe270d04 Alexander Graf
        char *bios_filename;
249 fe270d04 Alexander Graf
250 fe270d04 Alexander Graf
        /* Load zipl bootloader */
251 fe270d04 Alexander Graf
        if (bios_name == NULL) {
252 fe270d04 Alexander Graf
            bios_name = ZIPL_FILENAME;
253 fe270d04 Alexander Graf
        }
254 fe270d04 Alexander Graf
255 fe270d04 Alexander Graf
        bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
256 1edb4934 Christian Borntraeger
        bios_size = load_image_targphys(bios_filename, ZIPL_LOAD_ADDR, 4096);
257 7267c094 Anthony Liguori
        g_free(bios_filename);
258 fe270d04 Alexander Graf
259 fe270d04 Alexander Graf
        if ((long)bios_size < 0) {
260 fe270d04 Alexander Graf
            hw_error("could not load bootloader '%s'\n", bios_name);
261 fe270d04 Alexander Graf
        }
262 fe270d04 Alexander Graf
263 fe270d04 Alexander Graf
        if (bios_size > 4096) {
264 fe270d04 Alexander Graf
            hw_error("stage1 bootloader is > 4k\n");
265 fe270d04 Alexander Graf
        }
266 fe270d04 Alexander Graf
267 fe270d04 Alexander Graf
        env->psw.addr = ZIPL_START;
268 fe270d04 Alexander Graf
        env->psw.mask = 0x0000000180000000ULL;
269 8cb310e1 Alexander Graf
    }
270 8cb310e1 Alexander Graf
271 8cb310e1 Alexander Graf
    if (initrd_filename) {
272 8cb310e1 Alexander Graf
        initrd_offset = INITRD_START;
273 8cb310e1 Alexander Graf
        while (kernel_size + 0x100000 > initrd_offset) {
274 8cb310e1 Alexander Graf
            initrd_offset += 0x100000;
275 8cb310e1 Alexander Graf
        }
276 1edb4934 Christian Borntraeger
        initrd_size = load_image_targphys(initrd_filename, initrd_offset,
277 1edb4934 Christian Borntraeger
                                          ram_size - initrd_offset);
278 118a8977 Christian Borntraeger
        if (initrd_size == -1UL) {
279 118a8977 Christian Borntraeger
            fprintf(stderr, "qemu: could not load initrd '%s'\n",
280 118a8977 Christian Borntraeger
                    initrd_filename);
281 118a8977 Christian Borntraeger
            exit(1);
282 118a8977 Christian Borntraeger
        }
283 118a8977 Christian Borntraeger
284 1edb4934 Christian Borntraeger
        /* we have to overwrite values in the kernel image, which are "rom" */
285 1edb4934 Christian Borntraeger
        memcpy(rom_ptr(INITRD_PARM_START), &initrd_offset, 8);
286 1edb4934 Christian Borntraeger
        memcpy(rom_ptr(INITRD_PARM_SIZE), &initrd_size, 8);
287 8cb310e1 Alexander Graf
    }
288 8cb310e1 Alexander Graf
289 cc3c7384 Christian Borntraeger
    if (rom_ptr(KERN_PARM_AREA)) {
290 1edb4934 Christian Borntraeger
        /* we have to overwrite values in the kernel image, which are "rom" */
291 1edb4934 Christian Borntraeger
        memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline,
292 1edb4934 Christian Borntraeger
               strlen(kernel_cmdline) + 1);
293 8cb310e1 Alexander Graf
    }
294 8cb310e1 Alexander Graf
295 8cb310e1 Alexander Graf
    /* Create VirtIO network adapters */
296 8cb310e1 Alexander Graf
    for(i = 0; i < nb_nics; i++) {
297 8cb310e1 Alexander Graf
        NICInfo *nd = &nd_table[i];
298 8cb310e1 Alexander Graf
        DeviceState *dev;
299 8cb310e1 Alexander Graf
300 8cb310e1 Alexander Graf
        if (!nd->model) {
301 7267c094 Anthony Liguori
            nd->model = g_strdup("virtio");
302 8cb310e1 Alexander Graf
        }
303 8cb310e1 Alexander Graf
304 8cb310e1 Alexander Graf
        if (strcmp(nd->model, "virtio")) {
305 8cb310e1 Alexander Graf
            fprintf(stderr, "S390 only supports VirtIO nics\n");
306 8cb310e1 Alexander Graf
            exit(1);
307 8cb310e1 Alexander Graf
        }
308 8cb310e1 Alexander Graf
309 8cb310e1 Alexander Graf
        dev = qdev_create((BusState *)s390_bus, "virtio-net-s390");
310 8cb310e1 Alexander Graf
        qdev_set_nic_properties(dev, nd);
311 8cb310e1 Alexander Graf
        qdev_init_nofail(dev);
312 8cb310e1 Alexander Graf
    }
313 8cb310e1 Alexander Graf
314 8cb310e1 Alexander Graf
    /* Create VirtIO disk drives */
315 8cb310e1 Alexander Graf
    for(i = 0; i < MAX_BLK_DEVS; i++) {
316 8cb310e1 Alexander Graf
        DriveInfo *dinfo;
317 8cb310e1 Alexander Graf
        DeviceState *dev;
318 8cb310e1 Alexander Graf
319 8cb310e1 Alexander Graf
        dinfo = drive_get(IF_IDE, 0, i);
320 8cb310e1 Alexander Graf
        if (!dinfo) {
321 8cb310e1 Alexander Graf
            continue;
322 8cb310e1 Alexander Graf
        }
323 8cb310e1 Alexander Graf
324 8cb310e1 Alexander Graf
        dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390");
325 18846dee Markus Armbruster
        qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
326 8cb310e1 Alexander Graf
        qdev_init_nofail(dev);
327 8cb310e1 Alexander Graf
    }
328 8cb310e1 Alexander Graf
}
329 8cb310e1 Alexander Graf
330 8cb310e1 Alexander Graf
static QEMUMachine s390_machine = {
331 8cb310e1 Alexander Graf
    .name = "s390-virtio",
332 8cb310e1 Alexander Graf
    .alias = "s390",
333 8cb310e1 Alexander Graf
    .desc = "VirtIO based S390 machine",
334 8cb310e1 Alexander Graf
    .init = s390_init,
335 ad0bbc56 Einar Lueck
    .no_cdrom = 1,
336 ad0bbc56 Einar Lueck
    .no_floppy = 1,
337 986c5f78 Gerd Hoffmann
    .no_serial = 1,
338 986c5f78 Gerd Hoffmann
    .no_parallel = 1,
339 ad0bbc56 Einar Lueck
    .no_sdcard = 1,
340 cf708987 Michael S. Tsirkin
    .use_virtcon = 1,
341 8cb310e1 Alexander Graf
    .max_cpus = 255,
342 8cb310e1 Alexander Graf
    .is_default = 1,
343 8cb310e1 Alexander Graf
};
344 8cb310e1 Alexander Graf
345 8cb310e1 Alexander Graf
static void s390_machine_init(void)
346 8cb310e1 Alexander Graf
{
347 8cb310e1 Alexander Graf
    qemu_register_machine(&s390_machine);
348 8cb310e1 Alexander Graf
}
349 8cb310e1 Alexander Graf
350 8cb310e1 Alexander Graf
machine_init(s390_machine_init);