[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/49] kvm-all: Align to qemu_real_host_page_size in
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 14/49] kvm-all: Align to qemu_real_host_page_size in kvm_set_phys_mem |
Date: |
Fri, 16 Oct 2015 10:49:36 +0200 |
From: Alexey Kardashevskiy <address@hidden>
As the comment in kvm_set_phys_mem() says, KVM works in page size chunks.
However it uses hardcoded TARGET_PAGE_SIZE which is 4K on most platforms
while actual host may use different page size, for example, PPC64 hosts
use 64K system pages.
This replaces static TARGET_PAGE_SIZE with run-time calculated
qemu_real_host_page_size.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
kvm-all.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 0be4615..6f04fbb 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -642,15 +642,15 @@ static void kvm_set_phys_mem(KVMMemoryListener *kml,
/* kvm works in page size chunks, but the function may be called
with sub-page size and unaligned start address. Pad the start
address to next and truncate size to previous page boundary. */
- delta = (TARGET_PAGE_SIZE - (start_addr & ~TARGET_PAGE_MASK));
- delta &= ~TARGET_PAGE_MASK;
+ delta = qemu_real_host_page_size - (start_addr &
~qemu_real_host_page_mask);
+ delta &= ~qemu_real_host_page_mask;
if (delta > size) {
return;
}
start_addr += delta;
size -= delta;
- size &= TARGET_PAGE_MASK;
- if (!size || (start_addr & ~TARGET_PAGE_MASK)) {
+ size &= qemu_real_host_page_mask;
+ if (!size || (start_addr & ~qemu_real_host_page_mask)) {
return;
}
--
2.5.0
- [Qemu-devel] [PULL 06/49] cpu-exec-common.c: Clarify comment about cpu_reload_memory_map()'s RCU operations, (continued)
- [Qemu-devel] [PULL 06/49] cpu-exec-common.c: Clarify comment about cpu_reload_memory_map()'s RCU operations, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 04/49] configure: Require Python 2.6, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 05/49] exec.c: Don't call cpu_reload_memory_map() from cpu_exec_init(), Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 07/49] exec.c: Collect AddressSpace related fields into a CPUAddressSpace struct, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 09/49] linux-headers: update from kvm/next, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 08/49] checkpatch: allow open braces on typedef lines, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 10/49] target-i386/kvm: Hyper-V HV_X64_MSR_RESET support, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 11/49] target-i386/kvm: set Hyper-V features cpuid bit HV_X64_MSR_VP_INDEX_AVAILABLE, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 13/49] exec: remove non-TCG stuff from exec-all.h header., Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 12/49] target-i386/kvm: Hyper-V HV_X64_MSR_VP_RUNTIME support, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 14/49] kvm-all: Align to qemu_real_host_page_size in kvm_set_phys_mem,
Paolo Bonzini <=
- [Qemu-devel] [PULL 15/49] checkpatch: port fix from kernel "## is not a valid modifier", Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 16/49] MAINTAINERS: add two devices to the e500 section, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 18/49] MAINTAINERS: Add more pxa2xx files and boards, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 19/49] MAINTAINERS: Add maintainer for ARM PrimeCell and integrated devices, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 21/49] qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 20/49] MAINTAINERS: Add more devices to realview board, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 26/49] qemu-char: convert file backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 25/49] qemu-char: add create to register_char_driver, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 23/49] qemu-char: cleanup qmp_chardev_add, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 24/49] qemu-char: cleanup HAVE_CHARDEV_*, Paolo Bonzini, 2015/10/16