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

From: maobibo <maobibo@loongson.cn>

On some MIPS system, page size is 16K, and qxl vga device can
be used for VM in kvm mode. Qxl pci rom size is set 8K fixed,
smaller than 16K page size on host system, it fails to be
added into memslots in kvm mode where memory_size and GPA
are required to align with page size.

This patch fixes this issue.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
 hw/display/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 2ba7563..6e1f8ff 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -321,7 +321,7 @@ static ram_addr_t qxl_rom_size(void)
 #define QXL_ROM_SZ 8192
 
     QEMU_BUILD_BUG_ON(QXL_REQUIRED_SZ > QXL_ROM_SZ);
-    return QXL_ROM_SZ;
+    return QEMU_ALIGN_UP(QXL_REQUIRED_SZ, qemu_real_host_page_size);
 }
 
 static void init_qxl_rom(PCIQXLDevice *d)
-- 
1.8.3.1



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

* Re: [PATCH v2] hw/display/qxl: Set pci rom address aligned with page size
  2021-05-18 12:20 [PATCH v2] hw/display/qxl: Set pci rom address aligned with page size Bibo Mao
@ 2021-05-21  3:30 ` maobibo
  0 siblings, 0 replies; 2+ messages in thread
From: maobibo @ 2021-05-21  3:30 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

ping.

or there is other suggestion so that qxl can be used on system
with 16K pagesize.


regards
bibo, mao

在 2021年05月18日 20:20, Bibo Mao 写道:
> From: maobibo <maobibo@loongson.cn>
> 
> On some MIPS system, page size is 16K, and qxl vga device can
> be used for VM in kvm mode. Qxl pci rom size is set 8K fixed,
> smaller than 16K page size on host system, it fails to be
> added into memslots in kvm mode where memory_size and GPA
> are required to align with page size.
> 
> This patch fixes this issue.
> 
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
>  hw/display/qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 2ba7563..6e1f8ff 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -321,7 +321,7 @@ static ram_addr_t qxl_rom_size(void)
>  #define QXL_ROM_SZ 8192
>  
>      QEMU_BUILD_BUG_ON(QXL_REQUIRED_SZ > QXL_ROM_SZ);
> -    return QXL_ROM_SZ;
> +    return QEMU_ALIGN_UP(QXL_REQUIRED_SZ, qemu_real_host_page_size);
>  }
>  
>  static void init_qxl_rom(PCIQXLDevice *d)
> 



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

end of thread, other threads:[~2021-05-21  3:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 12:20 [PATCH v2] hw/display/qxl: Set pci rom address aligned with page size Bibo Mao
2021-05-21  3:30 ` 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).