diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-03-09 11:00:09 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-03-16 12:40:47 +0100 |
commit | f872c76296b991fde4db5fb87a1cfbd8d4c22c88 (patch) | |
tree | aef7f565484e336b94800982ecf3497947168806 /hw/display/vga-pci.c | |
parent | 61c265f0660ee476985808c8aa7915617c44fd53 (diff) | |
download | qemu-f872c76296b991fde4db5fb87a1cfbd8d4c22c88.zip qemu-f872c76296b991fde4db5fb87a1cfbd8d4c22c88.tar.gz qemu-f872c76296b991fde4db5fb87a1cfbd8d4c22c88.tar.bz2 |
stdvga+bochs-display: add dummy mmio handler
The bochs-display mmio bar has some sub-regions with the actual hardware
registers. What happens when the guest access something outside those
regions depends on the archirecture. On x86 those reads succeed (and
return 0xff I think). On risc-v qemu aborts.
This patch adds handlers for the parent region, to make the wanted
behavior explicit and to make things consistent across architectures.
v2:
- use existing unassigned_io_ops.
- also cover stdvga.
Cc: Alistair Francis <alistair23@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200309100009.17624-1-kraxel@redhat.com
Diffstat (limited to 'hw/display/vga-pci.c')
-rw-r--r-- | hw/display/vga-pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index b346324..6b9db86 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -249,8 +249,8 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp) /* mmio bar for vga register access */ if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_MMIO)) { - memory_region_init(&d->mmio, NULL, "vga.mmio", - PCI_VGA_MMIO_SIZE); + memory_region_init_io(&d->mmio, OBJECT(dev), &unassigned_io_ops, NULL, + "vga.mmio", PCI_VGA_MMIO_SIZE); if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { qext = true; @@ -285,8 +285,8 @@ static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp) s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s); /* mmio bar */ - memory_region_init(&d->mmio, OBJECT(dev), "vga.mmio", - PCI_VGA_MMIO_SIZE); + memory_region_init_io(&d->mmio, OBJECT(dev), &unassigned_io_ops, NULL, + "vga.mmio", PCI_VGA_MMIO_SIZE); if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { qext = true; |