qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] hw/display/vmware_vga: Trivial cleanups
@ 2020-05-25 11:23 Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [PATCH 1/3] MAINTAINERS: Cover vmware_vga related files in VMware section Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-25 11:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dmitry Fleytman, qemu-trivial, Michael Tokarev,
	Philippe Mathieu-Daudé,
	Laurent Vivier, Gerd Hoffmann

Use qemu_log_mask(LOG_GUEST_ERROR),
let the device be parent of a MemoryRegion.

Philippe Mathieu-Daudé (3):
  MAINTAINERS: Cover vmware_vga related files in VMware section
  hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR)
  hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion

 hw/display/vmware_vga.c | 18 ++++++++++++------
 MAINTAINERS             |  3 +++
 2 files changed, 15 insertions(+), 6 deletions(-)

-- 
2.21.3



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] MAINTAINERS: Cover vmware_vga related files in VMware section
  2020-05-25 11:23 [PATCH 0/3] hw/display/vmware_vga: Trivial cleanups Philippe Mathieu-Daudé
@ 2020-05-25 11:23 ` Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [PATCH 2/3] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR) Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [RFC PATCH 3/3] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-25 11:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dmitry Fleytman, qemu-trivial, Michael Tokarev,
	Philippe Mathieu-Daudé,
	Laurent Vivier, Gerd Hoffmann

Add the VMware VGA display and its ROM files to the VMware section.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 MAINTAINERS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3690f313c3..2da00ce798 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1776,9 +1776,12 @@ F: hw/net/net_tx_pkt*
 Vmware
 M: Dmitry Fleytman <dmitry.fleytman@gmail.com>
 S: Maintained
+F: hw/display/vmware_vga.c
 F: hw/net/vmxnet*
 F: hw/scsi/vmw_pvscsi*
 F: tests/qtest/vmxnet3-test.c
+F: pc-bios/vgabios-vmware.bin
+F: roms/config.vga-vmware
 
 Rocker
 M: Jiri Pirko <jiri@resnulli.us>
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR)
  2020-05-25 11:23 [PATCH 0/3] hw/display/vmware_vga: Trivial cleanups Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [PATCH 1/3] MAINTAINERS: Cover vmware_vga related files in VMware section Philippe Mathieu-Daudé
@ 2020-05-25 11:23 ` Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [RFC PATCH 3/3] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-25 11:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dmitry Fleytman, qemu-trivial, Michael Tokarev,
	Philippe Mathieu-Daudé,
	Laurent Vivier, Gerd Hoffmann

Avoid flooding stdio by converting printf() calls to
qemu_log_mask(GUEST_ERROR), which are disabled by default.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/display/vmware_vga.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 58ea82e3e5..5c0fc49d9d 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -26,6 +26,7 @@
 #include "qemu/module.h"
 #include "qemu/units.h"
 #include "qapi/error.h"
+#include "qemu/log.h"
 #include "hw/loader.h"
 #include "trace.h"
 #include "ui/vnc.h"
@@ -953,7 +954,8 @@ static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
             ret = s->scratch[s->index - SVGA_SCRATCH_BASE];
             break;
         }
-        printf("%s: Bad register %02x\n", __func__, s->index);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad register %02x\n", __func__, s->index);
         ret = 0;
         break;
     }
@@ -1002,7 +1004,8 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
             s->new_width = value;
             s->invalidated = 1;
         } else {
-            printf("%s: Bad width: %i\n", __func__, value);
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: Bad width: %i\n", __func__, value);
         }
         break;
 
@@ -1011,13 +1014,15 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
             s->new_height = value;
             s->invalidated = 1;
         } else {
-            printf("%s: Bad height: %i\n", __func__, value);
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: Bad height: %i\n", __func__, value);
         }
         break;
 
     case SVGA_REG_BITS_PER_PIXEL:
         if (value != 32) {
-            printf("%s: Bad bits per pixel: %i bits\n", __func__, value);
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: Bad bits per pixel: %i bits\n", __func__, value);
             s->config = 0;
             s->invalidated = 1;
         }
@@ -1082,7 +1087,8 @@ static void vmsvga_value_write(void *opaque, uint32_t address, uint32_t value)
             s->scratch[s->index - SVGA_SCRATCH_BASE] = value;
             break;
         }
-        printf("%s: Bad register %02x\n", __func__, s->index);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad register %02x\n", __func__, s->index);
     }
 }
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [RFC PATCH 3/3] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion
  2020-05-25 11:23 [PATCH 0/3] hw/display/vmware_vga: Trivial cleanups Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [PATCH 1/3] MAINTAINERS: Cover vmware_vga related files in VMware section Philippe Mathieu-Daudé
  2020-05-25 11:23 ` [PATCH 2/3] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR) Philippe Mathieu-Daudé
@ 2020-05-25 11:23 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-25 11:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dmitry Fleytman, qemu-trivial, Michael Tokarev,
	Philippe Mathieu-Daudé,
	Laurent Vivier, Gerd Hoffmann

To avoid the orphan I/O memory region being added in the /unattached
QOM container, register the PCI device as its owner.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
RFC: This might break migration
---
 hw/display/vmware_vga.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 5c0fc49d9d..2579f6b218 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -1306,7 +1306,7 @@ static void pci_vmsvga_realize(PCIDevice *dev, Error **errp)
     dev->config[PCI_LATENCY_TIMER] = 0x40;
     dev->config[PCI_INTERRUPT_LINE] = 0xff;          /* End */
 
-    memory_region_init_io(&s->io_bar, NULL, &vmsvga_io_ops, &s->chip,
+    memory_region_init_io(&s->io_bar, OBJECT(dev), &vmsvga_io_ops, &s->chip,
                           "vmsvga-io", 0x10);
     memory_region_set_flush_coalesced(&s->io_bar);
     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_bar);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-25 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 11:23 [PATCH 0/3] hw/display/vmware_vga: Trivial cleanups Philippe Mathieu-Daudé
2020-05-25 11:23 ` [PATCH 1/3] MAINTAINERS: Cover vmware_vga related files in VMware section Philippe Mathieu-Daudé
2020-05-25 11:23 ` [PATCH 2/3] hw/display/vmware_vga: Replace printf() calls by qemu_log_mask(ERROR) Philippe Mathieu-Daudé
2020-05-25 11:23 ` [RFC PATCH 3/3] hw/display/vmware_vga: Let the PCI device own its I/O MemoryRegion Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).