[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits() |
Date: |
Mon, 13 Nov 2023 16:21:08 +0100 |
Instead of the target-specific TARGET_PAGE_BITS definition,
use qemu_target_page_bits() which is target agnostic.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/xen/xen-hvm-common.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 03f9417e7e..35b3b5407d 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
#include "qapi/error.h"
+#include "exec/target_page.h"
#include "trace.h"
#include "hw/pci/pci_host.h"
@@ -13,6 +14,7 @@ MemoryRegion ram_memory;
void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
Error **errp)
{
+ unsigned target_page_bits = qemu_target_page_bits();
unsigned long nr_pfn;
xen_pfn_t *pfn_list;
int i;
@@ -31,11 +33,11 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
MemoryRegion *mr,
trace_xen_ram_alloc(ram_addr, size);
- nr_pfn = size >> TARGET_PAGE_BITS;
+ nr_pfn = size >> target_page_bits;
pfn_list = g_new(xen_pfn_t, nr_pfn);
for (i = 0; i < nr_pfn; i++) {
- pfn_list[i] = (ram_addr >> TARGET_PAGE_BITS) + i;
+ pfn_list[i] = (ram_addr >> target_page_bits) + i;
}
if (xc_domain_populate_physmap_exact(xen_xc, xen_domid, nr_pfn, 0, 0,
pfn_list)) {
--
2.41.0
- [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix, (continued)
- [PATCH-for-9.0 02/10] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix, Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 03/10] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h', Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 04/10] hw/xen: Factor xen_arch_align_ioreq_data() out of handle_ioreq(), Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 05/10] hw/xen: Use target-agnostic qemu_target_page_bits(),
Philippe Mathieu-Daudé <=
- [PATCH-for-9.0 06/10] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources, Philippe Mathieu-Daudé, 2023/11/13
- [PATCH-for-9.0 07/10] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE, Philippe Mathieu-Daudé, 2023/11/13