From f872c76296b991fde4db5fb87a1cfbd8d4c22c88 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 9 Mar 2020 11:00:09 +0100 Subject: 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 Signed-off-by: Gerd Hoffmann Message-id: 20200309100009.17624-1-kraxel@redhat.com --- hw/display/bochs-display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/display/bochs-display.c') diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c index 62085f9fc0..70eb619ef4 100644 --- a/hw/display/bochs-display.c +++ b/hw/display/bochs-display.c @@ -284,8 +284,8 @@ static void bochs_display_realize(PCIDevice *dev, Error **errp) memory_region_init_io(&s->qext, obj, &bochs_display_qext_ops, s, "qemu extended regs", PCI_VGA_QEXT_SIZE); - memory_region_init(&s->mmio, obj, "bochs-display-mmio", - PCI_VGA_MMIO_SIZE); + memory_region_init_io(&s->mmio, obj, &unassigned_io_ops, NULL, + "bochs-display-mmio", PCI_VGA_MMIO_SIZE); memory_region_add_subregion(&s->mmio, PCI_VGA_BOCHS_OFFSET, &s->vbe); memory_region_add_subregion(&s->mmio, PCI_VGA_QEXT_OFFSET, &s->qext); -- cgit v1.2.3-55-g7522