Blame SOURCES/0012-tests-brk-near-huge-Fix-next-chunk-computation-for-p.patch

fc9b0e
From 1329c4f5f4d201724d379d43dc5d516d1c9356dc Mon Sep 17 00:00:00 2001
fc9b0e
Message-Id: <1329c4f5f4d201724d379d43dc5d516d1c9356dc.1566225007.git.aquini@redhat.com>
fc9b0e
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
From: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Date: Thu, 15 Aug 2019 13:08:39 +0530
fc9b0e
Subject: [RHEL7 PATCH 12/31] tests: brk-near-huge: Fix next chunk computation
fc9b0e
 for powerpc64
fc9b0e
fc9b0e
For powerpc64, the use of slices applies only to Hash MMU.
fc9b0e
Hence, when determining the next chunk size, ensure that
fc9b0e
the address is aligned to the slice size for Hash MMU and
fc9b0e
the huge page size otherwise.
fc9b0e
fc9b0e
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Signed-off-by: Eric B Munson <emunson@mgebm.net>
fc9b0e
Signed-off-by: Rafael Aquini <aquini@redhat.com>
fc9b0e
---
fc9b0e
 tests/brk_near_huge.c | 3 +++
fc9b0e
 1 file changed, 3 insertions(+)
fc9b0e
fc9b0e
diff --git a/tests/brk_near_huge.c b/tests/brk_near_huge.c
fc9b0e
index f6d1e07..c9662f4 100644
fc9b0e
--- a/tests/brk_near_huge.c
fc9b0e
+++ b/tests/brk_near_huge.c
fc9b0e
@@ -40,6 +40,9 @@
fc9b0e
 #ifdef __powerpc64__
fc9b0e
 void *next_chunk(void *addr)
fc9b0e
 {
fc9b0e
+	if (!arch_has_slice_support())
fc9b0e
+		return PALIGN(addr, gethugepagesize());
fc9b0e
+
fc9b0e
 	if ((unsigned long)addr < 0x100000000UL)
fc9b0e
 		/* 256M segments below 4G */
fc9b0e
 		return PALIGN(addr, 0x10000000UL);
fc9b0e
-- 
fc9b0e
1.8.3.1
fc9b0e