qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/display/qxl: Set pci rom address aligned with page size
@ 2021-05-15  8:06 Bibo Mao
  2021-05-17  7:19 ` Gerd Hoffmann
  0 siblings, 1 reply; 7+ messages in thread
From: Bibo Mao @ 2021-05-15  8:06 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel, maobibo

From: maobibo <maobibo@loongson.cn>

pci memory bar size should be aligned with page size, else it will
not be effective memslot when running in kvm mode.

This patch set qxl pci rom size aligned with page size of host
machine.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 hw/display/qxl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 2ba7563..c84f45e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -317,11 +317,11 @@ static uint32_t qxl_crc32(const uint8_t *p, unsigned len)
 
 static ram_addr_t qxl_rom_size(void)
 {
-#define QXL_REQUIRED_SZ (sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes))
-#define QXL_ROM_SZ 8192
+    uint32_t rom_size;
 
-    QEMU_BUILD_BUG_ON(QXL_REQUIRED_SZ > QXL_ROM_SZ);
-    return QXL_ROM_SZ;
+    rom_size = sizeof(QXLRom) + sizeof(QXLModes) + sizeof(qxl_modes);
+    rom_size = QEMU_ALIGN_UP(rom_size, qemu_real_host_page_size);
+    return rom_size;
 }
 
 static void init_qxl_rom(PCIQXLDevice *d)
-- 
1.8.3.1



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

end of thread, other threads:[~2021-05-18  8:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-15  8:06 [PATCH] hw/display/qxl: Set pci rom address aligned with page size Bibo Mao
2021-05-17  7:19 ` Gerd Hoffmann
2021-05-18  1:06   ` maobibo
2021-05-18  7:03     ` Gerd Hoffmann
2021-05-18  7:14       ` maobibo
2021-05-18  7:37         ` Gerd Hoffmann
2021-05-18  8:32           ` maobibo

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).