[PATCH v5 01/23] powerpc: Add new macro to handle NESTED_IFCLR

2020-08-26 Thread Aneesh Kumar K.V
This will be used by the following patches Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/feature-fixups.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h index b0af97add751..122c22161268

[PATCH v5 00/23] Kernel userspace access/execution prevention with hash translation

2020-08-26 Thread Aneesh Kumar K.V
from v2: * Rebase to the latest kernel. * Fixed a bug with disabling KUEP/KUAP on kernel command line * Added a patch to make kup key dynamic. Changes from V1: * Rebased on latest kernel Aneesh Kumar K.V (23): powerpc: Add new macro to handle NESTED_IFCLR KVM: PPC: BOOK3S: PR: Ignore UAMOR SPR

Re: [PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-08-21 Thread Aneesh Kumar K.V
Sure. I am hoping kernel test robot will pick this up. I did an x86 and about 19 different ppc config build with the series. The git tree above was pushed with that. Considering you authored the change i am wondering if you could help with checking other architecture (may be atleast arm vari

Re: [PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-08-21 Thread Aneesh Kumar K.V
On 8/21/20 1:31 PM, Anshuman Khandual wrote: On 08/21/2020 12:23 PM, Aneesh Kumar K.V wrote: On 8/21/20 9:03 AM, Anshuman Khandual wrote: On 08/19/2020 07:15 PM, Aneesh Kumar K.V wrote: "Aneesh Kumar K.V" writes: This patch series includes fixes for debug_vm_pgtable test co

Re: [PATCH v2 10/13] mm/debug_vm_pgtable/locks: Take correct page table lock

2020-08-21 Thread Aneesh Kumar K.V
On 8/21/20 1:33 PM, Anshuman Khandual wrote: On 08/19/2020 06:31 PM, Aneesh Kumar K.V wrote: Make sure we call pte accessors with correct lock held. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 34 -- 1 file changed, 20 insertions(+), 14

Re: [PATCH v2 07/13] mm/debug_vm_pgtable/set_pte/pmd/pud: Don't use set_*_at to update an existing pte entry

2020-08-21 Thread Aneesh Kumar K.V
On 8/20/20 8:02 PM, Christophe Leroy wrote: Le 19/08/2020 à 15:01, Aneesh Kumar K.V a écrit : set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be

Re: [PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-08-20 Thread Aneesh Kumar K.V
On 8/21/20 9:03 AM, Anshuman Khandual wrote: On 08/19/2020 07:15 PM, Aneesh Kumar K.V wrote: "Aneesh Kumar K.V" writes: This patch series includes fixes for debug_vm_pgtable test code so that they follow page table updates rules correctly. The first two patches introduce cha

Re: [PATCH v2 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support.

2020-08-19 Thread Aneesh Kumar K.V
kernel test robot writes: > Hi "Aneesh, > > I love your patch! Yet something to improve: > > [auto build test ERROR on hnaz-linux-mm/master] > [also build test ERROR on powerpc/next linus/master v5.9-rc1 next-20200819] > [cannot apply to mmotm/master] > [If your patch is applied to the wrong git

Re: [PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-08-19 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > This patch series includes fixes for debug_vm_pgtable test code so that > they follow page table updates rules correctly. The first two patches > introduce > changes w.r.t ppc64. The patches are included in this series for > completeness

[PATCH v2 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support.

2020-08-19 Thread Aneesh Kumar K.V
ppc64 supports huge vmap only with radix translation. Hence use arch helper to determine the huge vmap support. Signed-off-by: Aneesh Kumar K.V --- include/linux/io.h| 12 mm/debug_vm_pgtable.c | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include

[PATCH v2 13/13] mm/debug_vm_pgtable: populate a pte entry before fetching it

2020-08-19 Thread Aneesh Kumar K.V
pte_clear_tests operate on an existing pte entry. Make sure that is not a none pte entry. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 09ce9974c187

[PATCH v2 05/13] mm/debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING

2020-08-19 Thread Aneesh Kumar K.V
enable the test only when CONFIG_NUMA_BALANCING is enabled and use protnone protflags. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index cf3c4792b4a2

[PATCH v2 09/13] mm/debug_vm_pgtable/locks: Move non page table modifying test together

2020-08-19 Thread Aneesh Kumar K.V
This will help in adding proper locks in a later patch Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 52 --- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 6dcac2b40fef

[PATCH v2 06/13] mm/debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd/pud_at

2020-08-19 Thread Aneesh Kumar K.V
kernel expects entries to be marked huge before we use set_pmd_at()/set_pud_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index ffa10ede6842

[PATCH v2 07/13] mm/debug_vm_pgtable/set_pte/pmd/pud: Don't use set_*_at to update an existing pte entry

2020-08-19 Thread Aneesh Kumar K.V
set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --

[PATCH v2 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-19 Thread Aneesh Kumar K.V
ppc64. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 63576fe767a2..09ce9974c187 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -798,6 +798,7

[PATCH v2 11/13] mm/debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries

2020-08-19 Thread Aneesh Kumar K.V
pmd_clear() should not be used to clear pmd level pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 8f7a8ccb5a54..63576fe767a2 100644 --- a/mm

[PATCH v2 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-19 Thread Aneesh Kumar K.V
ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 086309fb9b6f

[PATCH v2 10/13] mm/debug_vm_pgtable/locks: Take correct page table lock

2020-08-19 Thread Aneesh Kumar K.V
Make sure we call pte accessors with correct lock held. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 69fe3cd8126c

[PATCH v2 02/13] powerpc/mm: Move setting pte specific flags to pfn_pte

2020-08-19 Thread Aneesh Kumar K.V
() without setting _PAGE_PTE bit. We will remove that after a few releases. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 15 +-- arch/powerpc/include/asm/nohash/pgtable.h| 5 - arch/powerpc/mm/book3s64/pgtable.c | 2 +- arch

[PATCH v2 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-08-19 Thread Aneesh Kumar K.V
Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 9c7e2c9cfc76

[PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-08-19 Thread Aneesh Kumar K.V
disabled on ppc64 because that needs larger change to satisfy page table update rules. Changes from V1: * Address review feedback * drop test specific pfn_pte and pfn_pmd. * Update ppc64 page table helper to add _PAGE_PTE Aneesh Kumar K.V (13): powerpc/mm: Add DEBUG_VM WARN for pmd_clear powerpc

[PATCH v2 01/13] powerpc/mm: Add DEBUG_VM WARN for pmd_clear

2020-08-19 Thread Aneesh Kumar K.V
With the hash page table, the kernel should not use pmd_clear for clearing huge pte entries. Add a DEBUG_VM WARN to catch the wrong usage. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch

Re: [PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-19 Thread Aneesh Kumar K.V
Anshuman Khandual writes: > On 08/12/2020 07:22 PM, Aneesh Kumar K.V wrote: >> On 8/12/20 7:04 PM, Anshuman Khandual wrote: >>> >>> >>> On 08/12/2020 06:46 PM, Aneesh Kumar K.V wrote: >>>> On 8/12/20 6:33 PM, Anshuman Khandual wrote: >>&g

Re: [PATCH v2 1/3] powerpc/numa: Introduce logical numa id

2020-08-18 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2020-08-17 17:04:24]: > >> On 8/17/20 4:29 PM, Srikar Dronamraju wrote: >> > * Aneesh Kumar K.V [2020-08-17 16:02:36]: >> > >> > > We use ibm,associativity and ibm,associativity-lookup-arrays to derive

Re: [PATCH] powerpc/book3s64/radix: Fix boot failure with large amount of guest memory

2020-08-17 Thread Aneesh Kumar K.V
On 8/17/20 9:13 PM, Hari Bathini wrote: On 13/08/20 9:50 pm, Aneesh Kumar K.V wrote: If the hypervisor doesn't support hugepages, the kernel ends up allocating a large number of page table pages. The early page table allocation was wrongly setting the max memblock limit to ppc64_rma

Re: [PATCH v2 2/4] powerpc/mem: Store the dt_root_size/addr cell values for later usage

2020-08-17 Thread Aneesh Kumar K.V
On 8/17/20 9:00 PM, Hari Bathini wrote: On 06/08/20 9:53 pm, Aneesh Kumar K.V wrote: dt_root_addr_cells and dt_root_size_cells are __initdata variables. So make a copy of the same which can be used post init. This avoids doing the same thing at multiple places. So, thanks for the patch

Re: [PATCH v2 1/3] powerpc/numa: Introduce logical numa id

2020-08-17 Thread Aneesh Kumar K.V
On 8/17/20 4:29 PM, Srikar Dronamraju wrote: * Aneesh Kumar K.V [2020-08-17 16:02:36]: We use ibm,associativity and ibm,associativity-lookup-arrays to derive the numa node numbers. These device tree properties are firmware indicated grouping of resources based on their hierarchy in the

[PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled

2020-08-17 Thread Aneesh Kumar K.V
/hash_utils.c:1119:21: error: ‘default_uamor’ undeclared (first use in this function) 1119 | mtspr(SPRN_UAMOR, default_uamor); | ^ Fixes: 6553fb799f60 ("powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)") Signed-off-by: Aneesh

[PATCH v2 3/3] powerpc/numa: Move POWER4 restriction to the helper

2020-08-17 Thread Aneesh Kumar K.V
Even though the comment says POWER4 usage, I guess it applies to all platforms since there is no PVR check there. This patch moves the check to the helper. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a

[PATCH v2 2/3] powerpc/powernv/cpufreq: Don't assume chip id is same as Linux node id

2020-08-17 Thread Aneesh Kumar K.V
pping between firmware group id and Linux node id. Reviewed-by: Gautham R. Shenoy Signed-off-by: Aneesh Kumar K.V --- drivers/cpufreq/powernv-cpufreq.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpuf

[PATCH v2 1/3] powerpc/numa: Introduce logical numa id

2020-08-17 Thread Aneesh Kumar K.V
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 node 0 size: 50912 MB node 0 free: 49724 MB node distances: node 0 0: 10 Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 5 ++ arch/powerpc/mm/numa.c | 74 - 2 files

[PATCH] powerpc/book3s64/radix: Fix boot failure with large amount of guest memory

2020-08-13 Thread Aneesh Kumar K.V
ly_init_devtree() if the kernel is going to use radix translation. This forces some of the memblock allocations we do before mmu_early_init_devtree() to be within the RMA limit. Fixes: 2bfd65e45e87 ("powerpc/mm/radix: Add radix callbacks for early init routines") Reported-by: Shirisha

Re: [PATCH] powerpc/papr_scm: Limit the readability of 'perf_stats' sysfs attribute

2020-08-13 Thread Aneesh Kumar K.V
rmance statistics. Fixes: 2d02bf835e573 ('powerpc/papr_scm: Fetch nvdimm performance stats from PHYP') Reported-by: Aneesh Kumar K.V Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/platforms

Re: [PATCH 13/16] debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries

2020-08-13 Thread Aneesh Kumar K.V
On 8/13/20 10:57 AM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: pmd_clear() should not be used to clear pmd level pte entries. Could you please elaborate on this. The proposed change set does not match the description here. pmd_clear is implemented such that

Re: [PATCH 10/16] debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-08-12 Thread Aneesh Kumar K.V
On 8/13/20 10:55 AM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++-- 1 file changed, 6 insertions(+), 2

Re: [PATCH 16/16] debug_vm_pgtable/ppc64: Add a variant of pfn_pte/pmd

2020-08-12 Thread Aneesh Kumar K.V
On 8/13/20 11:00 AM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: The tests do expect _PAGE_PTE bit set by different page table accessors. This is not true for the kernel. Within the kernel, _PAGE_PTE bits are usually set by set_pte_at(). To make the below tests

Re: [PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 7:04 PM, Anshuman Khandual wrote: On 08/12/2020 06:46 PM, Aneesh Kumar K.V wrote: On 8/12/20 6:33 PM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: The seems to be missing quite a lot of details w.r.t allocating the correct pgtable_t page

Re: [PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 6:33 PM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: The seems to be missing quite a lot of details w.r.t allocating the correct pgtable_t page (huge_pte_alloc()), holding the right lock (huge_pte_lock()) etc. The vma used is also not a hugetlb VMA

Re: [PATCH 03/16] debug_vm_pgtable/set_pte: Don't use set_pte_at to update an existing pte entry

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 2:42 PM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be us

Re: [PATCH 01/16] powerpc/mm: Add DEBUG_VM WARN for pmd_clear

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 1:16 PM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: With the hash page table, the kernel should not use pmd_clear for clearing huge pte entries. Add a DEBUG_VM WARN to catch the wrong usage. Signed-off-by: Aneesh Kumar K.V This particular change is

Re: [PATCH 02/16] debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 1:42 PM, Anshuman Khandual wrote: On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 5 - 1 file changed, 4 insertions

Re: [PATCH 02/16] debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-12 Thread Aneesh Kumar K.V
On 8/12/20 12:10 PM, Christophe Leroy wrote: Le 12/08/2020 à 08:33, Aneesh Kumar K.V a écrit : ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V ---   mm/debug_vm_pgtable.c | 5 -   1 file changed, 4 insertions

[PATCH 16/16] debug_vm_pgtable/ppc64: Add a variant of pfn_pte/pmd

2020-08-12 Thread Aneesh Kumar K.V
, prot); WARN_ON(!pte_devmap(pte_mkdevmap(pte))); WARN_ON(!pte_savedwrite(pte_mk_savedwrite(pte_clear_savedwrite(pte; Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 65 +++ 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/mm

[PATCH 15/16] debug_vm_pgtable/savedwrite: Use savedwrite test with protnone ptes

2020-08-12 Thread Aneesh Kumar K.V
. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 3e112d0ba1b2..eea62d5e503b 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -1006,8 +1006,8 @@ static

[PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-08-11 Thread Aneesh Kumar K.V
ppc64. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 529892b9be2f..3e112d0ba1b2 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -800,6 +800,7

[PATCH 13/16] debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries

2020-08-11 Thread Aneesh Kumar K.V
pmd_clear() should not be used to clear pmd level pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 061c19bba7f0..529892b9be2f 100644 --- a/mm

[PATCH 12/16] debug_vm_pgtable/locks: Take correct page table lock

2020-08-11 Thread Aneesh Kumar K.V
Make sure we call pte accessors with correct lock held. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 90e9c2d3a092

[PATCH 11/16] debug_vm_pgtable/locks: Move non page table modifying test together

2020-08-11 Thread Aneesh Kumar K.V
This will help in adding proper locks in a later patch Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 53 +++ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 48475d288df1

[PATCH 10/16] debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-08-11 Thread Aneesh Kumar K.V
Architectures like ppc64 use deposited page table while updating the huge pte entries. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 644d28861ce9

[PATCH 09/16] debug_vm_pgtable/set_pud: Don't use set_pud_at to update an existing pud entry

2020-08-11 Thread Aneesh Kumar K.V
set_pud_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pud_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --

[PATCH 08/16] debug_vm_pgtable/set_pmd: Don't use set_pmd_at to update an existing pmd entry

2020-08-11 Thread Aneesh Kumar K.V
set_pmd_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pmd_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --

[PATCH 07/16] debug_vm_pgtable/THP: Mark the pte entry huge before using set_pud_at

2020-08-11 Thread Aneesh Kumar K.V
kernel expect entries to be marked huge before we use set_pud_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index b6aca2526e01..cd609a212dd4 100644

[PATCH 06/16] debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd_at

2020-08-11 Thread Aneesh Kumar K.V
kernel expect entries to be marked huge before we use set_pmd_at(). Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index de8a62d0a931..b6aca2526e01 100644 --- a

[PATCH 05/16] debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING

2020-08-11 Thread Aneesh Kumar K.V
enable the test only when CONFIG_NUMA_BALANCING is enabled. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 679bb3d289a3..de8a62d0a931 100644 --- a/mm/debug_vm_pgtable.c +++ b

[PATCH 04/16] debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support.

2020-08-11 Thread Aneesh Kumar K.V
ppc64 supports huge vmap only with radix translation. Hence use arch helper to determine the huge vmap support. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index

[PATCH 03/16] debug_vm_pgtable/set_pte: Don't use set_pte_at to update an existing pte entry

2020-08-11 Thread Aneesh Kumar K.V
set_pte_at() should not be used to set a pte entry at locations that already holds a valid pte entry. Architectures like ppc64 don't do TLB invalidate in set_pte_at() and hence expect it to be used to set locations that are not a valid PTE. Signed-off-by: Aneesh Kumar K.V --

[PATCH 02/16] debug_vm_pgtable/ppc64: Avoid setting top bits in radom value

2020-08-11 Thread Aneesh Kumar K.V
ppc64 use bit 62 to indicate a pte entry (_PAGE_PTE). Avoid setting that bit in random value. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index 086309fb9b6f

[PATCH 01/16] powerpc/mm: Add DEBUG_VM WARN for pmd_clear

2020-08-11 Thread Aneesh Kumar K.V
With the hash page table, the kernel should not use pmd_clear for clearing huge pte entries. Add a DEBUG_VM WARN to catch the wrong usage. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch

[PATCH] powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)

2020-08-10 Thread Aneesh Kumar K.V
On p6 and before we should avoid updating UAMOR SPRN. This resulted in boot failure on Nemo board. Fixes: 269e829f48a0 ("powerpc/book3s64/pkey: Disable pkey on POWER6 and before") Reported-by: Christian Zigotzky Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/hash_ut

Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-10 Thread Aneesh Kumar K.V
On 8/10/20 2:15 PM, Christian Zigotzky wrote: Hello Aneesh, I tested the new kernel today and unfortunately it doesn't run very well. I have only one core (1 physical processor; 1 core; 2 threads) instead of two cores (1 physical processor; 2 cores; 2 threads) so the system is slower. Boot

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-09 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > On 8/8/20 2:15 AM, Nathan Lynch wrote: >> "Aneesh Kumar K.V" writes: >>> On 8/7/20 9:54 AM, Nathan Lynch wrote: >>>> "Aneesh Kumar K.V" writes: >>>>> diff --git a/arch/powerpc/mm/nu

Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-09 Thread Aneesh Kumar K.V
On 8/9/20 8:04 PM, Aneesh Kumar K.V wrote: On 8/9/20 7:42 PM, Christian Zigotzky wrote: Hello, The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the latest Git kernel anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch" [2]. I bi

Re: [PASEMI] Nemo board doesn't boot anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch"

2020-08-09 Thread Aneesh Kumar K.V
On 8/9/20 7:42 PM, Christian Zigotzky wrote: Hello, The Nemo board (A-EON AmigaOne X1000) [1] doesn't start with the latest Git kernel anymore after the commit "powerpc/book3s64/pkeys: Simplify pkey disable branch" [2]. I bisected today [3]. Result: powerpc/book3s64/pkeys: Simplify pkey dis

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-09 Thread Aneesh Kumar K.V
On 8/8/20 2:15 AM, Nathan Lynch wrote: "Aneesh Kumar K.V" writes: On 8/7/20 9:54 AM, Nathan Lynch wrote: "Aneesh Kumar K.V" writes: diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index e437a9ac4956..6c659aada55b 100644 --- a/arch/powerpc/mm/numa.c +++ b/ar

Re: [EXTERNAL] Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.9-1 tag

2020-08-08 Thread Aneesh Kumar K.V
On 8/8/20 12:44 AM, Al Viro wrote: On Fri, Aug 07, 2020 at 10:46:13AM -0700, Linus Torvalds wrote: On Fri, Aug 7, 2020 at 6:14 AM Michael Ellerman wrote: Just one minor conflict, in a comment in drivers/misc/ocxl/config.c. Well, this morning I merged the ptrace ->regset_get() updates from A

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-06 Thread Aneesh Kumar K.V
On 8/7/20 9:54 AM, Nathan Lynch wrote: "Aneesh Kumar K.V" writes: diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index e437a9ac4956..6c659aada55b 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -221,25 +221,51 @@ static void initialize_distance_lo

[PATCH v2 4/4] powerpc/book3s64/radix: Make radix_mem_block_size 64bit

2020-08-06 Thread Aneesh Kumar K.V
Similar to commit 89c140bbaeee ("pseries: Fix 64 bit logical memory block panic") make sure different variables tracking lmb_size are updated to be 64 bit. Fixes: af9d00e93a4f ("powerpc/mm/radix: Create separate mappings for hot-plugged memory") Signed-off-by: Aneesh

[PATCH v2 3/4] powerpc/memhotplug: Make lmb size 64bit

2020-08-06 Thread Aneesh Kumar K.V
Similar to commit 89c140bbaeee ("pseries: Fix 64 bit logical memory block panic") make sure different variables tracking lmb_size are updated to be 64 bit. This was found by code audit. Cc: sta...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- .../platforms/pseries/hotplu

[PATCH v2 2/4] powerpc/mem: Store the dt_root_size/addr cell values for later usage

2020-08-06 Thread Aneesh Kumar K.V
dt_root_addr_cells and dt_root_size_cells are __initdata variables. So make a copy of the same which can be used post init. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/drmem.h | 2 ++ arch/powerpc/kernel/prom.c | 7 +++ arch/powerpc/mm/numa.c | 1 + 3 files

[PATCH v2 1/4] powerpc/drmem: Make lmb_size 64 bit

2020-08-06 Thread Aneesh Kumar K.V
Similar to commit 89c140bbaeee ("pseries: Fix 64 bit logical memory block panic") make sure different variables tracking lmb_size are updated to be 64 bit. This was found by code audit. Cc: sta...@vger.kernel.org Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/drmem.h |

[RFC PATCH] powerpc/drmem: use global variable instead of fetching again

2020-08-06 Thread Aneesh Kumar K.V
use mem_addr_cells/mem_size_cells instead of fetching the values again from device tree. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/drmem.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c

Re: [PATCH] powerpc/book3s64/radix: Make radix_mem_block_size 64bit

2020-08-06 Thread Aneesh Kumar K.V
Michael Ellerman writes: > "Aneesh Kumar K.V" writes: >> Similar to commit: 89c140bbaeee ("pseries: Fix 64 bit logical memory block >> panic") >> make sure we update different variables tracking lmb_size are updated >> to be 64 bit. > > Tha

[RFC PATCH 3/3] powerpc/lmb-size: Use addr #size-cells value when fetching lmb-size

2020-08-06 Thread Aneesh Kumar K.V
Make it consistent with other usages. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c| 7 --- arch/powerpc/platforms/pseries/hotplug-memory.c | 10 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/mm/book3s64

[RFC PATCH 2/3] powerpc/numa: Use global variable instead of fetching again

2020-08-06 Thread Aneesh Kumar K.V
use mem_addr_cells/mem_size_cells instead of fetching the values again from device tree. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 36 ++-- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm

[RFC PATCH 1/3] powerpc/mem: Store the dt_root_size/addr cell values for later usage

2020-08-06 Thread Aneesh Kumar K.V
dt_root_addr_cells and dt_root_size_cells are __initdata variables. So make a copy of the same which can be used post init. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/drmem.h | 2 ++ arch/powerpc/kernel/prom.c | 7 +++ arch/powerpc/mm/numa.c | 1 + 3 files

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-06 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2020-08-02 19:51:41]: >> Srikar Dronamraju writes: >> > * Aneesh Kumar K.V [2020-07-31 16:49:14]: >> > >> > >> > If its just to eliminate node 0, then we have 2 other probably better >> >

[PATCH] powerpc/book3s64/radix: Make radix_mem_block_size 64bit

2020-08-06 Thread Aneesh Kumar K.V
Similar to commit: 89c140bbaeee ("pseries: Fix 64 bit logical memory block panic") make sure we update different variables tracking lmb_size are updated to be 64 bit. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu.h | 2 +- arch/powerpc/include/a

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-02 Thread Aneesh Kumar K.V
Srikar Dronamraju writes: > * Aneesh Kumar K.V [2020-07-31 16:49:14]: > >> We use ibm,associativity and ibm,associativity-lookup-arrays to derive the >> numa >> node numbers. These device tree properties are firmware indicated grouping of >> resources based on t

[PATCH 2/2] powerpc/vmemmap: Don't warn if we don't find a mapping vmemmap list entry

2020-07-31 Thread Aneesh Kumar K.V
Now that we are handling vmemmap list allocation failure correctly, don't WARN in section deactivate when we don't find a mapping vmemmap list entry. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/init_64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ar

[PATCH 1/2] powerpc/vmemmap: Fix memory leak with vmemmap list allocation failures.

2020-07-31 Thread Aneesh Kumar K.V
If we fail to allocate vmemmap list, we don't keep track of allocated vmemmap block buf. Hence on section deactivate we skip vmemmap block buf free. This results in memory leak. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/init_64.c | 35 --- 1

[RFC PATCH 2/2] powerpc/powernv/cpufreq: Don't assume chip id is same as Linux node id

2020-07-31 Thread Aneesh Kumar K.V
pping between firmware group id and Linux node id. Signed-off-by: Aneesh Kumar K.V --- drivers/cpufreq/powernv-cpufreq.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 8646eb197cd9..ca82b6a

[RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-07-31 Thread Aneesh Kumar K.V
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 node 0 size: 50912 MB node 0 free: 49724 MB node distances: node 0 0: 10 Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/topology.h | 1 + arch/powerpc/mm/numa.c | 49 ++--- 2 files

Re: [PATCH v4 2/2] powerpc/papr_scm: Add support for fetching nvdimm 'fuel-gauge' metric

2020-07-31 Thread Aneesh Kumar K.V
t buffer > large enough to hold the performance stat and passes it to > drc_pmem_query_stats() that issues the HCALL to PHYP. The return value > of the stat is then populated in the 'struct > nd_papr_pdsm_health.dimm_fuel_gauge' field with extension flag > 'PDSM_DIMM_HEALTH

Re: [PATCH v4 1/2] powerpc/papr_scm: Fetch nvdimm performance stats from PHYP

2020-07-31 Thread Aneesh Kumar K.V
Vaibhav Jain writes: > Update papr_scm.c to query dimm performance statistics from PHYP via > H_SCM_PERFORMANCE_STATS hcall and export them to user-space as PAPR > specific NVDIMM attribute 'perf_stats' in sysfs. The patch also > provide a sysfs ABI documentation for the stats being reported and

[PATCH v2] powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE

2020-07-27 Thread Aneesh Kumar K.V
on a hypervisor that doesn't force the guest to hash translation even though it can't handle the radix GTSE=0 request via CAS. With radix_hcall_invalidate=on if the hypervisor doesn't support hcall_rpt_invalidate hcall it should force the LPAR to hash translation. Signed-off-

[PATCH v2] powerpc/book3s64/pkey: Disable pkey on POWER6 and before

2020-07-26 Thread Aneesh Kumar K.V
pkey support via ibm,processor-storage-keys. Hence check for P7 CPU_FTR bit to decide on pkey support. Fixes: a24204c30796 ("powerpc/book3s64/pkeys: kill cpu feature key CPU_FTR_PKEY") Reported-by: Michael Ellerman Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 6

[PATCH] powerpc/book3s64/pkey: Disable pkey on POWER6 and before

2020-07-26 Thread Aneesh Kumar K.V
pkey support via ibm,processor-storage-keys. Hence check for P7 CPU_FTR bit to decide on pkey support. Fixes: a24204c30796 ("powerpc/book3s64/pkeys: kill cpu feature key CPU_FTR_PKEY") Reported-by: Michael Ellerman Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c

[PATCH] powerpc/book3s64/radix: Add kernel command line option to disable radix GTSE

2020-07-24 Thread Aneesh Kumar K.V
on a hypervisor that doesn't force the guest to hash translation even though it can't handle the radix GTSE=0 request via CAS. With radix_gtse=off if the hypervisor doesn't support hcall_rpt_invalidate hcall it should force the LPAR to hash translation. Signed-off-by: Aneesh Kumar K.V ---

Re: [PATCH v3 0/4] powerpc/mm/radix: Memory unplug fixes

2020-07-20 Thread Aneesh Kumar K.V
On 7/21/20 7:15 AM, Michael Ellerman wrote: Nathan Lynch writes: "Aneesh Kumar K.V" writes: This is the next version of the fixes for memory unplug on radix. The issues and the fix are described in the actual patches. I guess this isn't actually causing problems at runtime r

Re: [PATCH v6 03/23] powerpc/book3s64/pkeys: pkeys are supported only on hash on book3s.

2020-07-19 Thread Aneesh Kumar K.V
On 7/20/20 11:35 AM, Michael Ellerman wrote: "Aneesh Kumar K.V" writes: Move them to hash specific file and add BUG() for radix path. --- .../powerpc/include/asm/book3s/64/hash-pkey.h | 32 arch/powerpc/include/asm/book3s/64/pkeys.h| 25 + ar

Re: [powerpc:next-test 103/106] arch/powerpc/mm/book3s64/radix_pgtable.c:513:21: error: use of undeclared identifier 'SECTION_SIZE_BITS'

2020-07-18 Thread Aneesh Kumar K.V
kernel test robot writes: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > next-test > head: 5fed3b3e21db21f9a7002426f456fd3a8a8c0772 > commit: 21407f39b9d547da527ad5224c4323e1f62bb514 [103/106] powerpc/mm/radix: > Create separate mappings for hot-plugged memory >

Re: [powerpc:next-test 125/127] arch/powerpc/mm/book3s64/pkeys.c:392:7: error: implicit declaration of function 'is_pkey_enabled'; did you mean

2020-07-16 Thread Aneesh Kumar K.V
On 7/17/20 7:29 AM, kernel test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: 0fbd1eb4df96e1cbd039e0b95fdf62cf65a7faf9 commit: ed411c66eea2ccf93a634ae661a1f79c2bc63d88 [125/127] powerpc/book3s64/pkeys: Remove is_pkey_enabled() config: p

Re: [PATCH] pseries: Fix 64 bit logical memory block panic

2020-07-16 Thread Aneesh Kumar K.V
On 7/16/20 7:00 AM, Paul Mackerras wrote: On Wed, Jul 15, 2020 at 06:12:25PM +0530, Aneesh Kumar K.V wrote: Anton Blanchard writes: Booting with a 4GB LMB size causes us to panic: qemu-system-ppc64: OS terminated: OS panic: Memory block size not suitable: 0x0 Fix

Re: [PATCH] pseries: Fix 64 bit logical memory block panic

2020-07-15 Thread Aneesh Kumar K.V
Anton Blanchard writes: > Booting with a 4GB LMB size causes us to panic: > > qemu-system-ppc64: OS terminated: OS panic: > Memory block size not suitable: 0x0 > > Fix pseries_memory_block_size() to handle 64 bit LMBs. > > Cc: sta...@vger.kernel.org > Signed-off-by: Anton Blanchard > ---

[PATCH 2/2] powerpc/kvm/cma: Improve kernel log during boot

2020-07-13 Thread Aneesh Kumar K.V
area [0.00] cma: Reserved 26224 MiB at 0x00795900 [0.00] hugetlb_cma: reserve 65536 MiB, up to 16384 MiB per node [0.00] cma: Reserved 16384 MiB at 0x0018 Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kvm/book3s_hv_builtin.c | 2 +- 1 file changed, 1

[PATCH 1/2] powerpc/hugetlb/cma: Allocate gigantic hugetlb pages using CMA

2020-07-13 Thread Aneesh Kumar K.V
commit: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") added support for allocating gigantic hugepages using CMA. This patch enables the same for powerpc Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/hugetlb.h | 7 +++ arch/powe

[PATCH] powerpc/book3s64/pkeys: Fix pkey_access_permitted w.r.t execute disable pkey

2020-07-12 Thread Aneesh Kumar K.V
P; region[i] = PPC_INST_BLR; do_protect(region); return EXIT_SUCCESS; } Fixes: f2407ef3ba22 ("powerpc: helper to validate key-access permissions of a pte") Reported-by: Sandipan Das Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 12 +

[PATCH v3 4/4] powerpc/mm/radix: Create separate mappings for hot-plugged memory

2020-07-09 Thread Aneesh Kumar K.V
ff-by: Bharata B Rao Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu.h | 5 ++ arch/powerpc/mm/book3s64/radix_pgtable.c | 81 arch/powerpc/platforms/powernv/setup.c | 10 ++- 3 files changed, 84 insertions(+), 12 deletions(-) diff --git a/arch

[PATCH v3 3/4] powerpc/mm/radix: Remove split_kernel_mapping()

2020-07-09 Thread Aneesh Kumar K.V
ao Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_pgtable.c | 95 +--- 1 file changed, 19 insertions(+), 76 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 46ad2da3087a..d5a01b9aadc9 10

<    3   4   5   6   7   8   9   10   11   12   >