Revision 04bc74ed

b/hw/s390-virtio-bus.c
166 166
                (vq * VIRTIO_VQCONFIG_LEN) +
167 167
                VIRTIO_VQCONFIG_OFFS_TOKEN;
168 168

  
169
    return ldq_phys(token_off);
169
    return ldq_be_phys(token_off);
170 170
}
171 171

  
172 172
static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev)
......
220 220
        vring = s390_virtio_next_ring(bus);
221 221
        virtio_queue_set_addr(dev->vdev, i, vring);
222 222
        virtio_queue_set_vector(dev->vdev, i, i);
223
        stq_phys(vq + VIRTIO_VQCONFIG_OFFS_ADDRESS, vring);
224
        stw_phys(vq + VIRTIO_VQCONFIG_OFFS_NUM, virtio_queue_get_num(dev->vdev, i));
223
        stq_be_phys(vq + VIRTIO_VQCONFIG_OFFS_ADDRESS, vring);
224
        stw_be_phys(vq + VIRTIO_VQCONFIG_OFFS_NUM, virtio_queue_get_num(dev->vdev, i));
225 225
    }
226 226

  
227 227
    cur_offs = dev->dev_offs;
......
229 229
    cur_offs += num_vq * VIRTIO_VQCONFIG_LEN;
230 230

  
231 231
    /* Sync feature bitmap */
232
    stl_phys(cur_offs, bswap32(dev->host_features));
232
    stl_le_phys(cur_offs, dev->host_features);
233 233

  
234 234
    dev->feat_offs = cur_offs + dev->feat_len;
235 235
    cur_offs += dev->feat_len * 2;
......
253 253

  
254 254
    /* Update guest supported feature bitmap */
255 255

  
256
    features = bswap32(ldl_phys(dev->feat_offs));
256
    features = bswap32(ldl_be_phys(dev->feat_offs));
257 257
    if (vdev->set_features) {
258 258
        vdev->set_features(vdev, features);
259 259
    }
b/hw/s390-virtio.c
193 193
    if (kernel_filename) {
194 194
        kernel_size = load_image(kernel_filename, qemu_get_ram_ptr(0));
195 195

  
196
        if (lduw_phys(KERN_IMAGE_START) != 0x0dd0) {
196
        if (lduw_be_phys(KERN_IMAGE_START) != 0x0dd0) {
197 197
            fprintf(stderr, "Specified image is not an s390 boot image\n");
198 198
            exit(1);
199 199
        }
......
232 232
        }
233 233
        initrd_size = load_image(initrd_filename, qemu_get_ram_ptr(initrd_offset));
234 234

  
235
        stq_phys(INITRD_PARM_START, initrd_offset);
236
        stq_phys(INITRD_PARM_SIZE, initrd_size);
235
        stq_be_phys(INITRD_PARM_START, initrd_offset);
236
        stq_be_phys(INITRD_PARM_SIZE, initrd_size);
237 237
    }
238 238

  
239 239
    if (kernel_cmdline) {

Also available in: Unified diff