Skip to contentSkip to conversation

mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags-ignore-madv_hugepage-on-s390-to-prevent-sigsegv-in-qemu.patch removed from -mm tree

folded-merged [email protected] 1 participant 1 message Apr 7, 2014

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [folded-merged] mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags-ignore-madv_hugepage-on-s390-to-prevent-sigsegv-in-qemu.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 07 Apr 2014 14:58:08 -0700

The patch titled
Subject: mm, s390: ignore MADV_HUGEPAGE on s390 to prevent SIGSEGV in qemu
has been removed from the -mm tree. Its filename was
mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags-ignore-madv_hugepage-on-s390-to-prevent-sigsegv-in-qemu.patch

This patch was dropped because it was folded into mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch

------------------------------------------------------
From: Alex Thorlton <[email protected]>
Subject: mm, s390: ignore MADV_HUGEPAGE on s390 to prevent SIGSEGV in qemu

As Christian pointed out, the recent 'Revert "thp: make MADV_HUGEPAGE check for mm->def_flags"' breaks qemu, it does QEMU_MADV_HUGEPAGE for all kvm pages but this doesn't work after s390_enable_sie/thp_split_mm.

Paolo suggested that instead of failing on the call to madvise, we simply ignore the call (return 0).

Cc Gerald Schaefer <[email protected]>
Cc Martin Schwidefsky <[email protected]>
Cc Heiko Carstens <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Alexander Viro <[email protected]>
Cc David Rientjes <[email protected]>

---

 mm/huge_memory.c |    9 +++++++++
 1 file changed, 9 insertions(+)
mm/huge_memory.c renamed from mm/huge_memory.c~mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags-ignore-madv_hugepage-on-s390-to-prevent-sigsegv-in-qemu +9 -0
diff -puN mm/huge_memory.c~mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags-ignore-madv_hugepage-on-s390-to-prevent-sigsegv-in-qemu mm/huge_memory.c
@@ -1893,6 +1893,15 @@ int hugepage_madvise(struct vm_area_stru
 {
 	switch (advice) {
 	case MADV_HUGEPAGE:
+#ifdef CONFIG_S390
+		/*
+		 * qemu blindly sets MADV_HUGEPAGE on all allocations, but s390
+		 * can't handle this properly after s390_enable_sie, so we simply
+		 * ignore the madvise to prevent qemu from causing a SIGSEGV.
+		 */
+		if (mm_has_pgste(vma->vm_mm))
+			return 0;
+#endif
 		/*
 		 * Be somewhat over-protective like KSM for now!
 		 */

_

Patches currently in -mm which might be from [email protected] are

mm-revert-thp-make-madv_hugepage-check-for-mm-def_flags.patch mm-thp-add-vm_init_def_mask-and-prctl_thp_disable.patch exec-kill-the-unnecessary-mm-def_flags-setting-in-load_elf_binary.patch