Re: [PATCH] powerpc/mm: fix a hardcode on memory boundary checking

2017-02-05 Thread Rui Teng
On 31/01/2017 5:11 PM, Michael Ellerman wrote: Rui Teng writes: The offset of hugepage block will not be 16G, if the expected page is more than one. Calculate the totol size instead of the hardcode value. I assume you found this by code inspection and not by triggering an actual bug? Yes

[PATCH] powerpc/mm: fix a hardcode on memory boundary checking

2017-01-12 Thread Rui Teng
The offset of hugepage block will not be 16G, if the expected page is more than one. Calculate the totol size instead of the hardcode value. Signed-off-by: Rui Teng --- arch/powerpc/mm/hash_utils_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm

[PATCH] tools/testing/selftests/powerpc: Add Anton's null_syscall benchmark to the selftests

2016-09-27 Thread Rui Teng
From: Anton Blanchard Pull in a version of Anton's null_syscall benchmark: http://ozlabs.org/~anton/junkcode/null_syscall.c Into tools/testing/selftests/powerpc/benchmarks. Suggested-by: Michael Ellerman Signed-off-by: Anton Blanchard Signed-off-by: Rui Teng --- .../testing/self

[PATCH] [v2] powerpc: Clean up tm_abort duplication in hash_utils_64.c

2016-09-01 Thread Rui Teng
The same logic appears twice and should probably be pulled out into a function. Suggested-by: Michael Ellerman Signed-off-by: Rui Teng --- Changes in V2: - Change function to static and inline - Use #else block to define an empty static inline function --- arch/powerpc/mm/hash_utils_64.c | 55

Re: [PATCH] powerpc: Clean up tm_abort duplication in hash_utils_64.c

2016-09-01 Thread Rui Teng
On 9/1/16 11:46 PM, Thiago Jung Bauermann wrote: Am Freitag, 26 August 2016, 11:50:10 schrieb Rui Teng: The same logic appears twice and should probably be pulled out into a function. Suggested-by: Michael Ellerman Signed-off-by: Rui Teng --- arch/powerpc/mm/hash_utils_64.c | 45

[PATCH] [V3] powerpc/mm: Add validation for platform reserved memory ranges

2016-09-01 Thread Rui Teng
all supported memory contexts. This helps prevent the possibility of getting return codes similar to H_RESOURCE for H_PROTECT hcalls for conflicting HPTE entries. Signed-off-by: Anshuman Khandual Signed-off-by: Rui Teng --- - Tested on both POWER8 LE and BE platforms Changes in V3: - Use u32 and u64

[PATCH] powerpc: Clean up tm_abort duplication in hash_utils_64.c

2016-08-25 Thread Rui Teng
The same logic appears twice and should probably be pulled out into a function. Suggested-by: Michael Ellerman Signed-off-by: Rui Teng --- arch/powerpc/mm/hash_utils_64.c | 45 + 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/arch

[PATCH] powerpc: Remove suspect CONFIG_PPC_BOOK3E #ifdefs in nohash/64/pgtable.h

2016-08-24 Thread Rui Teng
There are three #ifdef CONFIG_PPC_BOOK3E sections in nohash/64/pgtable.h. And there should be no configurations possible which use nohash/64/pgtable.h but don't also enable CONFIG_PPC_BOOK3E. Suggested-by: Michael Ellerman Signed-off-by: Rui Teng --- arch/powerpc/include/asm/noha

[PATCH] [PATCH] [V3] powerpc/mm: Add validation for platform reserved memory ranges

2016-08-01 Thread Rui Teng
all supported memory contexts. This helps prevent the possibility of getting return codes similar to H_RESOURCE for H_PROTECT hcalls for conflicting HPTE entries. Signed-off-by: Anshuman Khandual Signed-off-by: Rui Teng --- - Tested on both POWER8 LE and BE platforms Changes in V3: - Use u32 and u64

Re: [RFC 6/9] powerpc/hugetlb: Enable ARCH_WANT_GENERAL_HUGETLB for BOOK3S 64K

2016-03-21 Thread Rui Teng
On 3/9/16 8:10 PM, Anshuman Khandual wrote: This enables ARCH_WANT_GENERAL_HUGETLB for BOOK3S 64K in Kconfig. It also implements a new function 'pte_huge' which is required by function 'huge_pte_alloc' from generic VM. Existing BOOK3S 64K specific functions 'huge_pte_alloc' and 'huge_pte_offset'