Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Mike Rapoport
On Wed, Jan 29, 2020 at 11:20:44PM +0100, Gerald Schaefer wrote: > On Mon, 27 Jan 2020 22:33:08 -0500 > > For example, who would have thought that pXd_bad() is supposed to > report large entries as bad? It's not really documented anywhere, A bit off-topic, @Anshuman, maybe you could start a

[PATCH 1/2] selftests: vm: Do not override definition of ARCH

2020-01-29 Thread Sandipan Das
Independent builds of the vm selftests is currently broken because commit 7549b3364201 overrides the value of ARCH with the machine name from uname. This does not always match the architecture names used for tasks like header installation. E.g. for building tests on powerpc64, we need

[PATCH 2/2] selftests: vm: Fix 64-bit test builds for powerpc64le

2020-01-29 Thread Sandipan Das
Some tests are built only for 64-bit systems. This makes sure that these tests are built for both big and little endian variants of powerpc64. Fixes: 7549b3364201 ("selftests: vm: Build/Run 64bit tests only on 64bit arch") Reviewed-by: Kamalesh Babulal Signed-off-by: Sandipan Das ---

[PATCH 0/2] selftests: vm: Build fixes for powerpc64

2020-01-29 Thread Sandipan Das
The second patch was already posted independently but because of the changes in the first patch, the second one now depends on it. Hence posting it now as a part of this series. The last version (v2) of the second patch can be found at: https://patchwork.ozlabs.org/patch/1225969/ Sandipan Das

Re: [PATCH 2/2] pseries/makefile: Remove CONFIG_PPC_PSERIES check

2020-01-29 Thread Oliver O'Halloran
On Thu, Jan 30, 2020 at 5:32 PM Oliver O'Halloran wrote: > > The platform makefile (arch/powerpc/platforms/pseries/Makefile) is only doh s/platform/pseries/ > included by the platform makefile (arch/powerpc/platform/Makefile) when > CONFIG_PPC_PSERIES is selected, so checking for

[PATCH v18 24/24] selftests: vm: pkeys: Fix multilib builds for x86

2020-01-29 Thread Sandipan Das
This ensures that both 32-bit and 64-bit binaries are generated when this is built on a x86_64 system. Most of the changes have been borrowed from tools/testing/selftests/x86/Makefile. Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/Makefile | 72 + 1 file

[PATCH v18 23/24] selftests: vm: pkeys: Use the correct page size on powerpc

2020-01-29 Thread Sandipan Das
Both 4K and 64K pages are supported on powerpc. Parts of the selftest code perform alignment computations based on the PAGE_SIZE macro which is currently hardcoded to 64K for powerpc. This causes some test failures on kernels configured with 4K page size. In some cases, we need to enforce

[PATCH v18 22/24] selftests/vm/pkeys: Override access right definitions on powerpc

2020-01-29 Thread Sandipan Das
From: Ram Pai Some platforms hardcode the x86 values for PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE such as those in: /usr/include/bits/mman-shared.h. This overrides the definitions with correct values for powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by:

[PATCH v18 21/24] selftests/vm/pkeys: Test correct behaviour of pkey-0

2020-01-29 Thread Sandipan Das
From: Ram Pai Ensure that pkey-0 is allocated on start and that it can be attached dynamically in various modes, without failures. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 53

[PATCH v18 16/24] selftests/vm/pkeys: Improve checks to determine pkey support

2020-01-29 Thread Sandipan Das
From: Ram Pai For the pkeys subsystem to work, both the CPU and the kernel need to have support. So, additionally check if the kernel supports pkeys apart from the CPU feature checks. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Sandipan Das ---

[PATCH v18 20/24] selftests/vm/pkeys: Introduce a sub-page allocator

2020-01-29 Thread Sandipan Das
From: Ram Pai This introduces a new allocator that allocates 4K hardware pages to back 64K linux pages. This allocator is available only on powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das ---

[PATCH v18 19/24] selftests/vm/pkeys: Detect write violation on a mapped access-denied-key page

2020-01-29 Thread Sandipan Das
From: Ram Pai Detect write-violation on a page to which access-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 13

[PATCH v18 18/24] selftests/vm/pkeys: Associate key on a mapped page and detect write violation

2020-01-29 Thread Sandipan Das
From: Ram Pai Detect write-violation on a page to which write-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 12

[PATCH v18 17/24] selftests/vm/pkeys: Associate key on a mapped page and detect access violation

2020-01-29 Thread Sandipan Das
From: Ram Pai Detect access-violation on a page to which access-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 19

[PATCH v18 15/24] selftests/vm/pkeys: Fix assertion in test_pkey_alloc_exhaust()

2020-01-29 Thread Sandipan Das
From: Ram Pai Some pkeys which are valid on the hardware are reserved and not available for application use. These keys cannot be allocated. test_pkey_alloc_exhaust() tries to account for these and has an assertion which validates if all available pkeys have been exahaustively allocated.

[PATCH v18 14/24] selftests/vm/pkeys: Fix number of reserved powerpc pkeys

2020-01-29 Thread Sandipan Das
From: "Desnes A. Nunes do Rosario" The number of reserved pkeys in a PowerNV environment is different from that on PowerVM or KVM. Tested on PowerVM and PowerNV environments. Signed-off-by: "Desnes A. Nunes do Rosario" Signed-off-by: Ram Pai Signed-off-by: Sandipan Das ---

[PATCH v18 13/24] selftests/vm/pkeys: Introduce powerpc support

2020-01-29 Thread Sandipan Das
From: Ram Pai This makes use of the abstractions added earlier and introduces support for powerpc. For powerpc, after receiving the SIGSEGV, the signal handler must explicitly restore access permissions for the faulting pkey to allow the test to continue. As this makes use of

[PATCH v18 12/24] selftests/vm/pkeys: Introduce generic pkey abstractions

2020-01-29 Thread Sandipan Das
From: Ram Pai This introduces some generic abstractions and provides the corresponding architecture-specfic implementations for these abstractions. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das ---

[PATCH v18 11/24] selftests: vm: pkeys: Use the correct huge page size

2020-01-29 Thread Sandipan Das
The huge page size can vary across architectures. This will ensure that the correct huge page size is used when accessing the hugetlb controls under sysfs. Instead of using a hardcoded page size (i.e. 2MB), this now uses the HPAGE_SIZE macro which is arch-specific. Signed-off-by: Sandipan Das

[PATCH v18 10/24] selftests/vm/pkeys: Fix alloc_random_pkey() to make it really random

2020-01-29 Thread Sandipan Das
From: Ram Pai alloc_random_pkey() was allocating the same pkey every time. Not all pkeys were geting tested. This fixes it. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 3 ++-

[PATCH v18 09/24] selftests/vm/pkeys: Fix assertion in pkey_disable_set/clear()

2020-01-29 Thread Sandipan Das
From: Ram Pai In some cases, a pkey's bits need not necessarily change in a way that the value of the pkey register increases when performing a pkey_disable_set() or decreases when performing a pkey_disable_clear(). For example, on powerpc, if a pkey's current state is PKEY_DISABLE_ACCESS and

[PATCH v18 08/24] selftests/vm/pkeys: Fix pkey_disable_clear()

2020-01-29 Thread Sandipan Das
From: Ram Pai Currently, pkey_disable_clear() sets the specified bits instead clearing them. This has been dead code up to now because its only callers i.e. pkey_access/write_allow() are also unused. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen

[PATCH v18 00/24] selftests, powerpc, x86: Memory Protection Keys

2020-01-29 Thread Sandipan Das
Memory protection keys enables an application to protect its address space from inadvertent access by its own code. This feature is now enabled on powerpc and has been available since 4.16-rc1. The patches move the selftests to arch neutral directory and enhance their test coverage. Tested on

[PATCH v18 07/24] selftests: vm: pkeys: Add helpers for pkey bits

2020-01-29 Thread Sandipan Das
This introduces some functions that help with setting or clearing bits of a particular pkey. This also adds an abstraction for getting a pkey's bit position in the pkey register as this may vary across architectures. Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h|

[PATCH v18 06/24] selftests: vm: pkeys: Use sane types for pkey register

2020-01-29 Thread Sandipan Das
The size of the pkey register can vary across architectures. This converts the data type of all its references to u64 in preparation for multi-arch support. To keep the definition of the u64 type consistent and remove format specifier related warnings, __SANE_USERSPACE_TYPES__ is defined as

[PATCH v18 05/24] selftests/vm/pkeys: Make gcc check arguments of sigsafe_printf()

2020-01-29 Thread Sandipan Das
From: Thiago Jung Bauermann This will help us ensure we print pkey_reg_t values correctly in different architectures. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v18 04/24] selftests/vm/pkeys: Move some definitions to arch-specific header

2020-01-29 Thread Sandipan Das
From: Thiago Jung Bauermann In preparation for multi-arch support, move definitions which have arch-specific values to x86-specific header. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Hansen Signed-off-by: Sandipan Das ---

[PATCH v18 03/24] selftests/vm/pkeys: Move generic definitions to header file

2020-01-29 Thread Sandipan Das
From: Ram Pai Moved all the generic definition and helper functions to the header file. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h| 35

[PATCH v18 02/24] selftests/vm/pkeys: Rename all references to pkru to a generic name

2020-01-29 Thread Sandipan Das
From: Ram Pai This renames PKRU references to "pkey_reg" or "pkey" based on the usage. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Reviewed-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h|

[PATCH v18 01/24] selftests/x86/pkeys: Move selftests to arch-neutral directory

2020-01-29 Thread Sandipan Das
From: Ram Pai cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Ingo Molnar Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile

[PATCH 1/2] pseries/vio: Remove stray #ifdef CONFIG_PPC_PSERIES

2020-01-29 Thread Oliver O'Halloran
vio.c requires CONFIG_IBMVIO which in turn depends on PPC_PSERIES. In other words, this ifdef is pointless. At a guess it's a carry-over from pre-history. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/pseries/vio.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH 2/2] pseries/makefile: Remove CONFIG_PPC_PSERIES check

2020-01-29 Thread Oliver O'Halloran
The platform makefile (arch/powerpc/platforms/pseries/Makefile) is only included by the platform makefile (arch/powerpc/platform/Makefile) when CONFIG_PPC_PSERIES is selected, so checking for CONFIG_PPC_PSERIES in the pseries makefile is pointless. Signed-off-by: Oliver O'Halloran ---

Re: [PATCH v16 00/23] selftests, powerpc, x86: Memory Protection Keys

2020-01-29 Thread Sandipan Das
Hi Dave, On 30/01/20 12:29 am, Dave Hansen wrote: > On 1/28/20 1:38 AM, Sandipan Das wrote: >> On 27/01/20 9:12 pm, Dave Hansen wrote: >>> How have you tested this patch (and the whole series for that matter)? >>> >> I replaced the second patch with this one and did a build test. >> Till v16, I

[PATCH] powerpc/papr_scm: Mark papr_scm_ndctl() as static

2020-01-29 Thread Vaibhav Jain
Function papr_scm_ndctl() is neither exported from the module nor called directly from outside 'papr.c' hence should be marked 'static'. Signed-off-by: Vaibhav Jain --- arch/powerpc/platforms/pseries/papr_scm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

Re: [PATCH FIX] KVM: PPC: Book3S HV: Release lock on page-out failure path

2020-01-29 Thread Paul Mackerras
On Wed, Jan 22, 2020 at 10:25:42AM +0530, Bharata B Rao wrote: > When migrate_vma_setup() fails in kvmppc_svm_page_out(), > release kvm->arch.uvmem_lock before returning. > > Fixes: ca9f4942670 ("KVM: PPC: Book3S HV: Support for running secure guests") > Signed-off-by: Bharata B Rao Thanks,

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Gerald Schaefer
On Mon, 27 Jan 2020 22:33:08 -0500 Qian Cai wrote: > > > >> Did those tests ever find any regression or this is almost only useful for > >> new > > > > The test has already found problems with s390 page table helpers. > > Hmm, that is pretty weak where s390 is not even official supported

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Gerald Schaefer
On Tue, 28 Jan 2020 06:57:53 +0530 Anshuman Khandual wrote: > This adds tests which will validate architecture page table helpers and > other accessors in their compliance with expected generic MM semantics. > This will help various architectures in validating changes to existing > page table

Re: [PATCH] powerpc/process: Remove unneccessary #ifdef CONFIG_PPC64 in copy_thread_tls()

2020-01-29 Thread Michal Suchánek
On Wed, Jan 29, 2020 at 07:50:07PM +, Christophe Leroy wrote: > is_32bit_task() exists on both PPC64 and PPC32, no need of an ifdefery. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/process.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git

[PATCH] powerpc/process: Remove unneccessary #ifdef CONFIG_PPC64 in copy_thread_tls()

2020-01-29 Thread Christophe Leroy
is_32bit_task() exists on both PPC64 and PPC32, no need of an ifdefery. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/process.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index fad50db9dcf2..e730b8e522b0 100644

Re: [PATCH v16 00/23] selftests, powerpc, x86: Memory Protection Keys

2020-01-29 Thread Florian Weimer
* Dave Hansen: > Still doesn't build for me: > >> # make >> make --no-builtin-rules ARCH=x86_64 -C ../../../.. headers_install >> make[1]: Entering directory '/home/dave/linux.git' >> INSTALL ./usr/include >> make[1]: Leaving directory '/home/dave/linux.git' >> make: *** No rule to make target

Re: [PATCH v16 00/23] selftests, powerpc, x86: Memory Protection Keys

2020-01-29 Thread Dave Hansen
On 1/28/20 1:38 AM, Sandipan Das wrote: > On 27/01/20 9:12 pm, Dave Hansen wrote: >> How have you tested this patch (and the whole series for that matter)? >> > I replaced the second patch with this one and did a build test. > Till v16, I had tested the whole series (build + run) on both a POWER8

Re: [PATCH] powerpc/drmem: cache LMBs in xarray to accelerate lookup

2020-01-29 Thread Scott Cheloha
On Tue, Jan 28, 2020 at 05:56:55PM -0600, Nathan Lynch wrote: > Scott Cheloha writes: > > LMB lookup is currently an O(n) linear search. This scales poorly when > > there are many LMBs. > > > > If we cache each LMB by both its base address and its DRC index > > in an xarray we can cut lookups to

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Segher Boessenkool
On Wed, Jan 29, 2020 at 06:02:34PM +0100, Florian Weimer wrote: > * Segher Boessenkool: > > > On Wed, Jan 29, 2020 at 05:19:19PM +0100, Florian Weimer wrote: > >> * Segher Boessenkool: > >> >> But GCC doesn't expose them as integers to C code, so you can't do much > >> >> without them. > >> > >

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Florian Weimer
* Segher Boessenkool: > On Wed, Jan 29, 2020 at 05:19:19PM +0100, Florian Weimer wrote: >> * Segher Boessenkool: >> >> But GCC doesn't expose them as integers to C code, so you can't do much >> >> without them. >> > >> > Sure, it doesn't expose any other registers directly, either. >> >> I can

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Segher Boessenkool
On Wed, Jan 29, 2020 at 05:19:19PM +0100, Florian Weimer wrote: > * Segher Boessenkool: > >> But GCC doesn't expose them as integers to C code, so you can't do much > >> without them. > > > > Sure, it doesn't expose any other registers directly, either. > > I can use r0 & 1 with a register

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Florian Weimer
* Segher Boessenkool: > On Tue, Jan 28, 2020 at 05:04:49PM +0100, Florian Weimer wrote: >> * Segher Boessenkool: >> >> >> > I don't think we can save LR in a regular register around the system >> >> > call, explicitly in the inline asm statement, because we still have to >> >> > generate proper

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Tulio Magno Quites Machado Filho
Nicholas Piggin writes: > Adhemerval Zanella's on January 29, 2020 3:26 am: >> >> We already had to push a similar hack where glibc used to abort transactions >> prior syscalls to avoid some side-effects on kernel (commit 56cf2763819d2f). >> It was eventually removed from syscall handling by

[RFC PATCH 6/6] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_STATS

2020-01-29 Thread Vaibhav Jain
The DSM 'DSM_PAPR_SCM_STATS' should return the PAPR defined buffer that holds various dimm performance attributes as defined in Ref[1] back to user-space in response to ND_CMD_CALL. Presently the module doesn't interpret nor consume these stat as they are only intended to be consumer and reported

[RFC PATCH 5/6] powerpc/papr_scm: Implement support for DSM_PAPR_SCM_HEALTH

2020-01-29 Thread Vaibhav Jain
The DSM 'DSM_PAPR_SCM_HEALTH' should return the health-bitmap and health-valid-bitmap information for a dimm back to userspace in response to ND_CMD_CALL. This patch implements this DSM by implementing a new function papr_scm_get_health() that queries the DIMM health information and then copies

[RFC PATCH 4/6] powerpc/papr_scm: Add support for handling PAPR DSM commands

2020-01-29 Thread Vaibhav Jain
Implement support for handling PAPR DSM commands in papr_scm module. We advertise support for ND_CMD_CALL for the dimm command mask and implement necessary scaffolding in the module to handle ND_CMD_CALL ioctl and DSM commands that we receive. The layout of the DSM commands as we expect from

[RFC PATCH 3/6] UAPI: ndctl: Introduce NVDIMM_FAMILY_PAPR as a new NVDIMM DSM family

2020-01-29 Thread Vaibhav Jain
Add PAPR-scm family of DSM command-set to to the white list of NVDIMM command sets. Signed-off-by: Vaibhav Jain --- include/uapi/linux/ndctl.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index de5d90212409..0e09dc5cec19 100644 ---

[RFC PATCH 2/6] powerpc/papr_scm: Fetch dimm performance stats from PHYP

2020-01-29 Thread Vaibhav Jain
Implement support for fetching dimm performance metrics via H_SCM_PERFORMANCE_HEALTH hcall as documented in Ref[1]. The hcall returns a structure as described in Ref[1] and defined as newly introduced 'struct papr_scm_perf_stats'. The struct has a header followed by key-value pairs of performance

[RFC PATCH 1/6] powerpc/papr_scm: Provide support for fetching dimm health information

2020-01-29 Thread Vaibhav Jain
Implement support for fetching dimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit big-endian integers which are then stored in 'struct papr_scm_priv' and subsequently exposed to userspace via dimm attribute 'papr_health'. References: [1]:

[RFC PATCH 0/6] powerpc/papr_scm: Implement support for reporting DIMM health and stats

2020-01-29 Thread Vaibhav Jain
The PAPR standard provides suitable mechanisms to query the health and performance stats of an NVDIMM via various hcalls as described in Ref[2]. Until now these stats were never fetched in the papr_scm modules nor exposed to the user-space tools like 'ndctl'. This is partly due to PAPR platform

[PATCH v6 4/5] powerpc/numa: Early request for home node associativity

2020-01-29 Thread Srikar Dronamraju
Currently the kernel detects if its running on a shared lpar platform and requests home node associativity before the scheduler sched_domains are setup. However between the time NUMA setup is initialized and the request for home node associativity, workqueue initializes its per node cpumask. The

[PATCH v6 5/5] powerpc/numa: Remove late request for home node associativity

2020-01-29 Thread Srikar Dronamraju
With commit ("powerpc/numa: Early request for home node associativity"), commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") which was requesting home node associativity becomes redundant. Hence remove the late request for home node associativity. Signed-off-by:

[PATCH v6 2/5] powerpc/numa: Handle extra hcall_vphn error cases

2020-01-29 Thread Srikar Dronamraju
Currently code handles H_FUNCTION, H_SUCCESS, H_HARDWARE return codes. However hcall_vphn can return other return codes. Now it also handles H_PARAMETER return code. Also the rest return codes are handled under the default case. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc:

[PATCH v6 3/5] powerpc/numa: Use cpu node map of first sibling thread

2020-01-29 Thread Srikar Dronamraju
All the sibling threads of a core have to be part of the same node. To ensure that all the sibling threads map to the same node, always lookup/update the cpu-to-node map of the first thread in the core. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch

[PATCH v6 1/5] powerpc/vphn: Check for error from hcall_vphn

2020-01-29 Thread Srikar Dronamraju
There is no value in unpacking associativity, if H_HOME_NODE_ASSOCIATIVITY hcall has returned an error. Signed-off-by: Srikar Dronamraju Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Nathan Lynch Cc: linuxppc-dev@lists.ozlabs.org Cc: Abdul Haleem Cc: Satheesh Rajendran Reported-by: Abdul

[PATCH v6 0/5] Early node associativity

2020-01-29 Thread Srikar Dronamraju
Note: (Only patch 4 changes from v5) Abdul reported a warning on a shared lpar. "WARNING: workqueue cpumask: online intersect > possible intersect". This is because per node workqueue possible mask is set very early in the boot process even before the system was querying the home node

[PATCH v4] powerpc/smp: Use nid as fallback for package_id

2020-01-29 Thread Srikar Dronamraju
Package_id is to find out all cores that are part of the same chip. On PowerNV machines, package_id defaults to chip_id. However ibm,chip_id property is not present in device-tree of PowerVM Lpars. Hence lscpu output shows one core per socket and multiple cores. To overcome this, use nid as the

Re: powerpc Linux scv support and scv system call ABI proposal

2020-01-29 Thread Segher Boessenkool
On Wed, Jan 29, 2020 at 02:58:44PM +1000, Nicholas Piggin wrote: > Adhemerval Zanella's on January 29, 2020 3:26 am: > > __asm__ __volatile__\ > > ("sc\n\t" \ > >"bns+ 1f\n\t"

[PATCH] powerpc/32s: Fix kasan_early_hash_table() for CONFIG_VMAP_STACK

2020-01-29 Thread Christophe Leroy
On book3s/32 CPUs that are handling MMU through a hash table, MMU_init_hw() function was adapted for VMAP_STACK in order to handle virtual addresses instead of physical addresses in the low level hash functions. When using KASAN, the same adaptations are required for the early hash table set up

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Qian Cai
> On Jan 29, 2020, at 5:36 AM, Catalin Marinas wrote: > > On Tue, Jan 28, 2020 at 02:07:10PM -0500, Qian Cai wrote: >> On Jan 28, 2020, at 12:47 PM, Catalin Marinas >> wrote: >>> The primary goal here is not finding regressions but having clearly >>> defined semantics of the page table

[PATCH v2] powerpc/uaccess: simplify the get_fs() set_fs() logic

2020-01-29 Thread Christophe Leroy
On powerpc, we only have USER_DS and KERNEL_DS Today, this is managed as an 'unsigned long' data space limit which is used to compare the passed address with, plus a bit in the thread_info flags that is set whenever modifying the limit to enable the verification in addr_limit_user_check() The

[PATCH v1] powerpc/uaccess: simplify the get_fs() set_fs() logic

2020-01-29 Thread Christophe Leroy
On powerpc, we only have USER_DS and KERNEL_DS Today, this is managed as an 'unsigned long' data space limit which is used to compare the passed address with, plus a bit in the thread_info flags that is set whenever modifying the limit to enable the verification in addr_limit_user_check() The

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Catalin Marinas
On Tue, Jan 28, 2020 at 02:07:10PM -0500, Qian Cai wrote: > On Jan 28, 2020, at 12:47 PM, Catalin Marinas wrote: > > The primary goal here is not finding regressions but having clearly > > defined semantics of the page table accessors across architectures. x86 > > and arm64 are a good starting

Re: [PATCH v16 00/23] selftests, powerpc, x86: Memory Protection Keys

2020-01-29 Thread Sandipan Das
Hi Dave, On 28/01/20 3:08 pm, Sandipan Das wrote: > On 27/01/20 9:12 pm, Dave Hansen wrote: >> >> How have you tested this patch (and the whole series for that matter)? >> > > I replaced the second patch with this one and did a build test. > Till v16, I had tested the whole series (build + run)