[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 14/14] ppc: Yet another fix for the huge page support d
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 14/14] ppc: Yet another fix for the huge page support detection mechanism |
Date: |
Mon, 18 Jul 2016 14:38:50 +1000 |
From: Thomas Huth <address@hidden>
Commit 86b50f2e1bef ("Disable huge page support if it is not available
for main RAM") already made sure that huge page support is not announced
to the guest if the normal RAM of non-NUMA configurations is not backed
by a huge page filesystem. However, there is one more case that can go
wrong: NUMA is enabled, but the RAM of the NUMA nodes are not configured
with huge page support (and only the memory of a DIMM is configured with
it). When QEMU is started with the following command line for example,
the Linux guest currently crashes because it is trying to use huge pages
on a memory region that does not support huge pages:
qemu-system-ppc64 -enable-kvm ... -m 1G,slots=4,maxmem=32G -object \
memory-backend-file,policy=default,mem-path=/hugepages,size=1G,id=mem-mem1 \
-device pc-dimm,id=dimm-mem1,memdev=mem-mem1 -smp 2 \
-numa node,nodeid=0 -numa node,nodeid=1
To fix this issue, we've got to make sure to disable huge page support,
too, when there is a NUMA node that is not using a memory backend with
huge page support.
Fixes: 86b50f2e1befc33407bdfeb6f45f7b0d2439a740
Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/kvm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 884d564..7a8f555 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -389,12 +389,16 @@ static long getrampagesize(void)
object_child_foreach(memdev_root, find_max_supported_pagesize, &hpsize);
- if (hpsize == LONG_MAX) {
+ if (hpsize == LONG_MAX || hpsize == getpagesize()) {
return getpagesize();
}
- if (nb_numa_nodes == 0 && hpsize > getpagesize()) {
- /* No NUMA nodes and normal RAM without -mem-path ==> no huge pages! */
+ /* If NUMA is disabled or the NUMA nodes are not backed with a
+ * memory-backend, then there is at least one node using "normal"
+ * RAM. And since normal RAM has not been configured with "-mem-path"
+ * (what we've checked earlier here already), we can not use huge pages!
+ */
+ if (nb_numa_nodes == 0 || numa_info[0].node_memdev == NULL) {
static bool warned;
if (!warned) {
error_report("Huge page support disabled (n/a for main memory).");
--
2.7.4
- [Qemu-ppc] [PULL 00/14] ppc-for-2.7 queue 20160718, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 02/14] dbdma: always define DBDMA_DPRINTF and enable debug with DEBUG_DBDMA, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 01/14] spapr: fix core unplug crash, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 14/14] ppc: Yet another fix for the huge page support detection mechanism,
David Gibson <=
- [Qemu-ppc] [PULL 03/14] dbdma: add per-channel debugging enabled via DEBUG_DBDMA_CHANMASK, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 05/14] dbdma: fix load_word/store_word value endianness, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 10/14] spapr: Ensure CPU cores are added contiguously and removed in LIFO order, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 07/14] dbdma: reset io->processing flag for unassigned DBDMA channel rw accesses, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 13/14] target-ppc: fix left shift overflow in hpte_page_shift, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 06/14] dbdma: set FLUSH bit upon reception of flush command for unassigned DBDMA channels, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 08/14] ppc: Fix support for odd MSR combinations, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 04/14] dbdma: fix endian of DBDMA_CMDPTR_LO during branch, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 12/14] ppc/mmu-hash64: Remove duplicated #include statement, David Gibson, 2016/07/18
- [Qemu-ppc] [PULL 09/14] vfio/spapr: Remove stale ioctl() call, David Gibson, 2016/07/18