Blame SOURCES/0014-elflink-powerpc64-Use-slices-based-on-MMU-type.patch

0dfa60
From 5022d5f86d02882a11700825258ecdba8dee683c Mon Sep 17 00:00:00 2001
0dfa60
Message-Id: <5022d5f86d02882a11700825258ecdba8dee683c.1566225007.git.aquini@redhat.com>
0dfa60
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
0dfa60
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
0dfa60
From: Sandipan Das <sandipan@linux.ibm.com>
0dfa60
Date: Wed, 12 Jun 2019 12:34:31 +0530
0dfa60
Subject: [RHEL7 PATCH 14/31] elflink: powerpc64: Use slices based on MMU type
0dfa60
0dfa60
For powerpc64, the concept of slices is not applicable to the
0dfa60
recently introduced Radix MMU. So, slice boundaries should be
0dfa60
calculated based on the MMU type.
0dfa60
0dfa60
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
0dfa60
Signed-off-by: Eric B Munson <emunson@mgebm.net>
0dfa60
Signed-off-by: Rafael Aquini <aquini@redhat.com>
0dfa60
---
0dfa60
 elflink.c | 12 ++++++++----
0dfa60
 1 file changed, 8 insertions(+), 4 deletions(-)
0dfa60
0dfa60
diff --git a/elflink.c b/elflink.c
0dfa60
index 1150bde..a6bd44c 100644
0dfa60
--- a/elflink.c
0dfa60
+++ b/elflink.c
0dfa60
@@ -569,6 +569,10 @@ bail2:
0dfa60
  */
0dfa60
 static unsigned long hugetlb_slice_start(unsigned long addr)
0dfa60
 {
0dfa60
+	if (!arch_has_slice_support()) {
0dfa60
+		return ALIGN_DOWN(addr, gethugepagesize());
0dfa60
+	}
0dfa60
+
0dfa60
 #if defined(__powerpc64__)
0dfa60
 	if (addr < SLICE_LOW_TOP)
0dfa60
 		return ALIGN_DOWN(addr, SLICE_LOW_SIZE);
0dfa60
@@ -578,13 +582,15 @@ static unsigned long hugetlb_slice_start(unsigned long addr)
0dfa60
 		return ALIGN_DOWN(addr, SLICE_HIGH_SIZE);
0dfa60
 #elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
0dfa60
 	return ALIGN_DOWN(addr, SLICE_LOW_SIZE);
0dfa60
-#else
0dfa60
-	return ALIGN_DOWN(addr, gethugepagesize());
0dfa60
 #endif
0dfa60
 }
0dfa60
 
0dfa60
 static unsigned long hugetlb_slice_end(unsigned long addr)
0dfa60
 {
0dfa60
+	if (!arch_has_slice_support()) {
0dfa60
+		return ALIGN_UP(addr, gethugepagesize()) - 1;
0dfa60
+	}
0dfa60
+
0dfa60
 #if defined(__powerpc64__)
0dfa60
 	if (addr < SLICE_LOW_TOP)
0dfa60
 		return ALIGN_UP(addr, SLICE_LOW_SIZE) - 1;
0dfa60
@@ -592,8 +598,6 @@ static unsigned long hugetlb_slice_end(unsigned long addr)
0dfa60
 		return ALIGN_UP(addr, SLICE_HIGH_SIZE) - 1;
0dfa60
 #elif defined(__powerpc__) && !defined(PPC_NO_SEGMENTS)
0dfa60
 	return ALIGN_UP(addr, SLICE_LOW_SIZE) - 1;
0dfa60
-#else
0dfa60
-	return ALIGN_UP(addr, gethugepagesize()) - 1;
0dfa60
 #endif
0dfa60
 }
0dfa60
 
0dfa60
-- 
0dfa60
1.8.3.1
0dfa60