Skip to contentSkip to conversation

Vga 20200316 patches

GIT PULL Applied Gerd Hoffmann 2 participants 3 messages Mar 16, 2020

lore
Share & tools
lore
#0 lore raw

The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53:

Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 10:33:04 +0000)

are available in the Git repository at:

git://git.kraxel.org/qemu tags/vga-20200316-pull-request

for you to fetch changes up to f872c76296b991fde4db5fb87a1cfbd8d4c22c88:

stdvga+bochs-display: add dummy mmio handler (2020-03-16 12:40:47 +0100)

----------------------------------------------------------------
vga: stdvga/bochs mmio fix.

----------------------------------------------------------------

Gerd Hoffmann (1):
stdvga+bochs-display: add dummy mmio handler

 hw/display/bochs-display.c | 4 ++--
 hw/display/vga-pci.c       | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.18.2
#1 lore raw

[PULL 1/1] 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 <[email protected]>

Message-id: [email protected]

---
 hw/display/bochs-display.c | 4 ++--
 hw/display/vga-pci.c       | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
hw/display/bochs-display.c +2 -2
index 62085f9fc063..70eb619ef424 100644
@@ -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);
 
hw/display/vga-pci.c +4 -4
index b34632467399..6b9db86e363c 100644
@@ -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;
Signature · 1 line
2.18.2
#2 lore raw
In reply to Gerd Hoffmann
Quoted 9 lines · Gerd Hoffmann

The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53:

Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 10:33:04 +0000)

are available in the Git repository at:

git://git.kraxel.org/qemu tags/vga-20200316-pull-request

Quoted 9 lines

for you to fetch changes up to f872c76296b991fde4db5fb87a1cfbd8d4c22c88:

stdvga+bochs-display: add dummy mmio handler (2020-03-16 12:40:47 +0100)

----------------------------------------------------------------
vga: stdvga/bochs mmio fix.

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM