Blame SOURCES/libhugetlbfs-2.20-defined-task-size-value-to-be-512T-if-it-is-more-than-64Tb.patch

39b936
commit 02df38e93e25e07f4d54edae94fb4ec90b7a2824
39b936
Author: Santhosh G <santhog4@linux.vnet.ibm.com>
39b936
Date:   Thu Jul 27 13:10:37 2017 +0530
39b936
39b936
    Defined task size value to be 512T if it is more that 64Tb.
39b936
    
39b936
    The Test case needs to loop till 512Tb to get the TASK_SIZE value.
39b936
    This patch defines the value to be 512T if the test tries to loop
39b936
    above 64T.
39b936
    
39b936
    Signed-off-by: Santhosh G <santhog4@linux.vnet.ibm.com>
39b936
    Signed-off-by: Eric B Munson <emunson@mgebm.net>
39b936
39b936
diff --git a/tests/task-size-overrun.c b/tests/task-size-overrun.c
39b936
index 0ab76c7..dc9ce0e 100644
39b936
--- a/tests/task-size-overrun.c
39b936
+++ b/tests/task-size-overrun.c
39b936
@@ -82,6 +82,10 @@ static unsigned long find_task_size(void)
39b936
 		}
39b936
 		munmap(p, getpagesize());
39b936
 		addr += getpagesize();
39b936
+#if defined(__powerpc64__)
39b936
+		if (addr > (1UL << 46) && addr < (1UL << 49))
39b936
+			addr = 1UL << 49;
39b936
+#endif
39b936
 #if defined(__s390x__)
39b936
 		if (addr > (1UL << 42) && addr < (1UL << 53))
39b936
 			addr = 1UL << 53;