[PATCH v4 23/41] powerpc/exec: Set thread.regs early during exec

2020-06-15 Thread Aneesh Kumar K.V
In later patches during exec, we would like to access default regs.kuap to control access to the user mapping. Having thread.regs set early makes the code changes simpler. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/thread_info.h | 2 -- arch/powerpc/kernel/process.c |

[PATCH v4 24/41] powerpc/book3s64/pkeys: Store/restore userspace AMR correctly on entry and exit from kernel

2020-06-15 Thread Aneesh Kumar K.V
This prepare kernel to operate with a different value than userspace AMR. For this, AMR needs to be saved and restored on entry and return from the kernel. With KUAP we modify kernel AMR when accessing user address from the kernel via copy_to/from_user interfaces. If MMU_FTR_KEY is enabled we alw

[PATCH v4 26/41] powerpc/book3s64/pkeys: Inherit correctly on fork.

2020-06-15 Thread Aneesh Kumar K.V
Child thread.kuap value is inherited from the parent in copy_thread_tls. We still need to make sure when the child returns from a fork in the kernel we start with the kernel default AMR value. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/process.c | 9 + 1 file changed, 9 in

[PATCH v4 25/41] powerpc/book3s64/kuep: Store/restore userspace IAMR correctly on entry and exit from kernel

2020-06-15 Thread Aneesh Kumar K.V
This prepare kernel to operate with a different value than userspace IAMR. For this, IAMR needs to be saved and restored on entry and return from the kernel. If MMU_FTR_KEY is enabled we always use the key mechanism to implement KUEP feature. If MMU_FTR_KEY is not supported and if we support MMU_F

[PATCH v4 27/41] powerpc/book3s64/pkeys: Reset userspace AMR correctly on exec

2020-06-15 Thread Aneesh Kumar K.V
On fork, we inherit from the parent and on exec, we should switch to default_amr values. Also, avoid changing the AMR register value within the kernel. The kernel now runs with different AMR values. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 ++ arch/pow

[PATCH v4 28/41] powerpc/ptrace-view: Use pt_regs values instead of thread_struct based one.

2020-06-15 Thread Aneesh Kumar K.V
We will remove thread.amr/iamr/uamor in a later patch Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/ptrace/ptrace-view.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel/ptrace/p

[PATCH v4 07/41] powerpc/book3s64/pkeys: kill cpu feature key CPU_FTR_PKEY

2020-06-15 Thread Aneesh Kumar K.V
We don't use CPU_FTR_PKEY anymore. Remove the feature bit and mark it free. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cputable.h | 13 ++--- arch/powerpc/kernel/dt_cpu_ftrs.c | 6 -- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/in

[PATCH v4 29/41] powerpc/book3s64/pkeys: Don't update SPRN_AMR when in kernel mode.

2020-06-15 Thread Aneesh Kumar K.V
Now that kernel correctly store/restore userspace AMR/IAMR values, avoid manipulating AMR and IAMR from the kernel on behalf of userspace. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 23 arch/powerpc/include/asm/processor.h | 5 -- arch/powerpc/ke

[PATCH v4 30/41] powerpc/book3s64/kuap: Restrict access to userspace based on userspace AMR

2020-06-15 Thread Aneesh Kumar K.V
If an application has configured address protection such that read/write is denied using pkey even the kernel should receive a FAULT on accessing the same. This patch use user AMR value stored in pt_regs.kuap to achieve the same. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book

[PATCH v4 31/41] powerpc/book3s64/kuap: Improve error reporting with KUAP

2020-06-15 Thread Aneesh Kumar K.V
With hash translation use DSISR_KEYFAULT to identify a wrong access. With Radix we look at the AMR value and type of fault. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/32/kup.h | 4 +-- arch/powerpc/include/asm/book3s/64/kup.h | 28 arch/powe

[PATCH v4 32/41] powerpc/book3s64/kuap: Use Key 3 to implement KUAP with hash translation.

2020-06-15 Thread Aneesh Kumar K.V
Radix use AMR Key 0 and hash translation use AMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h i

[PATCH v4 33/41] powerpc/book3s64/kuep: Use Key 3 to implement KUEP with hash translation.

2020-06-15 Thread Aneesh Kumar K.V
Radix use IAMR Key 0 and hash translation use IAMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h index f6

[PATCH v4 34/41] powerpc/book3s64/hash/kuap: Enable kuap on hash

2020-06-15 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index b260e33e4e23..0d6fd69708f2 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/a

[PATCH v4 35/41] powerpc/book3s64/hash/kuep: Enable KUEP on hash

2020-06-15 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 0d6fd69708f2..9ab8fdaf7146 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/a

[PATCH v4 36/41] powerpc/book3s64/keys: Print information during boot.

2020-06-15 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 9ab8fdaf7146..65dbb335f0a0 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s6

[PATCH v4 37/41] powerpc/selftest/ptrave-pkey: Rename variables to make it easier to follow code

2020-06-15 Thread Aneesh Kumar K.V
Rename variable to indicate that they are invalid values which we will use to test ptrace update of pkeys. Signed-off-by: Aneesh Kumar K.V --- .../selftests/powerpc/ptrace/ptrace-pkey.c| 26 +-- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/testing/sel

[PATCH v4 38/41] powerpc/selftest/ptrace-pkey: Update the test to mark an invalid pkey correctly

2020-06-15 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- .../selftests/powerpc/ptrace/ptrace-pkey.c| 30 --- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index f9216c7a18

[PATCH v4 40/41] powerpc/book3s64/keys/kuap: Reset AMR/IAMR values on kexec

2020-06-15 Thread Aneesh Kumar K.V
We can kexec into a kernel that doesn't use memory keys for kernel mapping (such as an older kernel which doesn't support kuap/kuep with hash translation). We need to make sure we reset the AMR/IAMR value on kexec otherwise, the new kernel will use key 0 for kernel mapping and the old AMR value pre

[PATCH v4 19/41] powerpc/book3s64/kuap: Rename MMU_FTR_RADIX_KUAP to MMU_FTR_KUAP

2020-06-15 Thread Aneesh Kumar K.V
The next set of patches adds support for kuap with hash translation. In preparation for that rename/move kuap related functions to non radix names. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 18 +- arch/powerpc/include/asm/mmu.h | 6

Re: [PATCH] SUNRPC: Add missing asm/cacheflush.h

2020-06-15 Thread Christophe Leroy
Le 14/06/2020 à 20:57, Chuck Lever a écrit : Hi Christophe - On Jun 14, 2020, at 1:07 PM, Christophe Leroy wrote: Even if that's only a warning, not including asm/cacheflush.h leads to svc_flush_bvec() being empty allthough powerpc defines ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE. CC net

[PATCH v4 41/41] powerpc/book3s64/hash/kup: Don't hardcode kup key

2020-06-15 Thread Aneesh Kumar K.V
Make KUAP/KUEP key a variable and also check whether the platform limit the max key such that we can't use the key for KUAP/KEUP. Signed-off-by: Aneesh Kumar K.V --- .../powerpc/include/asm/book3s/64/hash-pkey.h | 22 + arch/powerpc/include/asm/book3s/64/kup.h | 1 + arch/powerpc/m

[PATCH v4 39/41] powerpc/selftest/ptrace-pkey: IAMR and uamor cannot be updated by ptrace

2020-06-15 Thread Aneesh Kumar K.V
Both IAMR and uamor are privileged and cannot be updated by userspace. Hence we also don't allow ptrace interface to update them. Don't update them in the test. Also expected_iamr is only changed if we can allocate a DISABLE_EXECUTE pkey. Signed-off-by: Aneesh Kumar K.V --- tools/testing/selfte

Re: [PATCH 04/21] mm: free_area_init: use maximal zone PFNs rather than zone sizes

2020-06-15 Thread Mike Rapoport
Hi Greg, On Mon, Jun 15, 2020 at 01:53:42PM +1000, Greg Ungerer wrote: > Hi Mike, > > From: Mike Rapoport > > Currently, architectures that use free_area_init() to initialize memory map > > and node and zone structures need to calculate zone and hole sizes. We can > > use free_area_init_nodes()

[PATCH v2] SUNRPC: Add missing definition of ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE

2020-06-15 Thread Christophe Leroy
Even if that's only a warning, not including asm/cacheflush.h leads to svc_flush_bvec() being empty allthough powerpc defines ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE. CC net/sunrpc/svcsock.o net/sunrpc/svcsock.c:227:5: warning: "ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE" is not defined [-Wundef] #if AR

Re: [PATCH 5/5] powerpc: Add LKDTM test to hijack a patch mapping

2020-06-15 Thread Christophe Leroy
Le 03/06/2020 à 07:19, Christopher M. Riedl a écrit : When live patching with STRICT_KERNEL_RWX, the CPU doing the patching must use a temporary mapping which allows for writing to kernel text. During the entire window of time when this temporary mapping is in use, another CPU could write to t

[PATCH 18/29] docs: powerpc: fix some issues at vas-api.rst

2020-06-15 Thread Mauro Carvalho Chehab
There are a few issues on this document, when built via the building with ``make htmldocs``: Documentation/powerpc/vas-api.rst:116: WARNING: Unexpected indentation. Documentation/powerpc/vas-api.rst:116: WARNING: Inline emphasis start-string without end-string. Documentation/powerpc/v

[PATCH 00/22] ReST conversion patches (final?)

2020-06-15 Thread Mauro Carvalho Chehab
Hi Jon, That's my final(*) series of conversion patches from .txt to ReST. (*) Well, running the script I'm using to check, I noticed a couple of new *.txt files. If I have some time, I'll try to address those last pending things for v5.9. Mauro Carvalho Chehab (22): docs: dt: convert booting

[PATCH 15/22] docs: powerpc: convert vcpudispatch_stats.txt to ReST

2020-06-15 Thread Mauro Carvalho Chehab
- Add a SPDX header; - Use standard markup for document title; - Adjust identation on lists and add blank lines where needed; - Add it to the powerpc index.rst file. Acked-by: Michael Ellerman # powerpc Signed-off-by: Mauro Carvalho Chehab --- Documentation/powerpc/index.rst |

Re: [PATCH 04/21] mm: free_area_init: use maximal zone PFNs rather than zone sizes

2020-06-15 Thread Greg Ungerer
Hi Mike, On 15/6/20 4:22 pm, Mike Rapoport wrote: On Mon, Jun 15, 2020 at 01:53:42PM +1000, Greg Ungerer wrote: From: Mike Rapoport Currently, architectures that use free_area_init() to initialize memory map and node and zone structures need to calculate zone and hole sizes. We can use free_a

Re: PowerPC KVM-PR issue

2020-06-15 Thread Christian Zigotzky
On 15 June 2020 at 01:39 am, Christian Zigotzky wrote: On 14 June 2020 at 04:52 pm, Christian Zigotzky wrote: On 14 June 2020 at 02:53 pm, Nicholas Piggin wrote: Excerpts from Christian Zigotzky's message of June 12, 2020 11:01 pm: On 11 June 2020 at 04:47 pm, Christian Zigotzky wrote: On 10

Re: [PATCH v2 00/12] x86: tag application address space for devices

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:21PM -0700, Fenghua Yu wrote: > This series only provides simple and basic support for ENQCMD and the MSR: > 1. Clean up type definitions (patch 1-3). These patches can be in a >separate series. >- Define "pasid" as "unsigned int" consistently (patch 1 and 2).

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > @@ -447,6 +458,18 @@ dotraplinkage void do_general_protection(struct pt_regs > *regs, long error_code) > int ret; > > RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU"); > + > + /* > + * Perform th

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > +/* > + * Apply some heuristics to see if the #GP fault was caused by a thread > + * that hasn't had the IA32_PASID MSR initialized. If it looks like that > + * is the problem, try initializing the IA32_PASID MSR. If the heuristic > + *

[PATCH] powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when page size is 256k

2020-06-15 Thread Christophe Leroy
FIX_EARLY_DEBUG_BASE reserves a 128k area for debuging. When page size is 256k, the calculation results in a 0 number of pages, leading to the following failure: CC arch/powerpc/kernel/asm-offsets.s In file included from ./arch/powerpc/include/asm/nohash/32/pgtable.h:77:0,

[PATCH 00/29] Documentation fixes

2020-06-15 Thread Mauro Carvalho Chehab
Hi Jon, That's a bunch of files I have to be applied on the top of v5.8-rc1 fixing documentation warnings. I already removed some duplicated stuff. Regards, Mauro Mauro Carvalho Chehab (29): mm: vmalloc.c: remove a kernel-doc annotation from a removed parameter net: dev: add a missing kernel

Re: [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:21 UTC, Boris Brezillon wrote: > Now that the driver implements exec_op(), we can get rid of the legacy > interface implementation. > > Signed-off-by: Boris Brezillon Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel

Re: [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:20 UTC, Boris Brezillon wrote: > Implement exec_op() so we can get rid of the legacy interface > implementation. > > Signed-off-by: Boris Brezillon > Reviewed-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thank

Re: [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:19 UTC, Boris Brezillon wrote: > Explicitly inherit from nand_controller instead of relying on the > nand_chip.legacy.dummy_controller field. > > Signed-off-by: Boris Brezillon > Reviewed-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mt

Re: [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:18 UTC, Boris Brezillon wrote: > The integer-based GPIO ids are now deprecated in favor of the GPIO desc > API. The PPC platforms have already been converted to GPIOLIB, so let's > use gpio descs in the NAND driver too. > > While at it, we use devm_gpiod_get_index_optio

Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:17 UTC, Boris Brezillon wrote: > Replace the of_address_to_resource() + devm_ioremap() calls by > platform_get_resource() + devm_ioremap_resource() ones which allows us > to get rid of one error message since devm_ioremap_resource() already > takes care of that. > > Sig

Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:16 UTC, Boris Brezillon wrote: > This simplifies the init() error path and the remove() handler. > > Signed-off-by: Boris Brezillon Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel

Re: [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:15 UTC, Boris Brezillon wrote: > This simplifies the init error patch and remove function. > > Signed-off-by: Boris Brezillon > Reviewed-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel

Re: [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:14 UTC, Boris Brezillon wrote: > fsl_upm_nand.parts is unused, let's get rid of it. > > Signed-off-by: Boris Brezillon > Reviewed-by: Miquel Raynal Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel

Re: [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var

2020-06-15 Thread Miquel Raynal
On Wed, 2020-06-03 at 13:49:13 UTC, Boris Brezillon wrote: > The mtd var in fun_wait_rnb() is now unused, let's get rid of it and > fix the warning resulting from this unused var. > > Fixes: 50a487e7719c ("mtd: rawnand: Pass a nand_chip object to > chip->dev_ready()") > Signed-off-by: Boris Brezi

[PATCH] powerpc/8xx: use pmd_off() to access a PMD entry in pte_update()

2020-06-15 Thread Mike Rapoport
From: Mike Rapoport The pte_update() implementation for PPC_8xx unfolds page table from the PGD level to access a PMD entry. Since 8xx has only 2-level page table this can be simplified with pmd_off() shortcut. Replace explicit unfolding with pmd_off() and drop defines of pgd_index() and pgd_off

Re: [PATCH] powerpc/8xx: use pmd_off() to access a PMD entry in pte_update()

2020-06-15 Thread Christophe Leroy
Le 15/06/2020 à 11:22, Mike Rapoport a écrit : From: Mike Rapoport The pte_update() implementation for PPC_8xx unfolds page table from the PGD level to access a PMD entry. Since 8xx has only 2-level page table this can be simplified with pmd_off() shortcut. Replace explicit unfolding with p

[PATCH v2 6/8] PCI/AER: Convert PCIBIOS_* errors to generic -E* errors

2020-06-15 Thread refactormyself
From: Bolarinwa Olayemi Saheed pci_enable_pcie_error_reporting() return PCIBIOS_ error codes which were passed on down the call heirarchy from PCIe capability accessors. PCIBIOS_ error codes have positive values. Passing on these values is inconsistent with functions which return only a negative

[PATCH v2 7/8] PCI/AER: Convert PCIBIOS_* errors to generic -E* errors

2020-06-15 Thread refactormyself
From: Bolarinwa Olayemi Saheed pci_disable_pcie_error_reporting() returns PCIBIOS_ error code which were passed down the call heirarchy from PCIe capability accessors. PCIBIOS_ error codes have positive values. Passing on these values is inconsistent with functions which return only a negative v

[PATCH 0/8 v2] PCI: Align return values of PCIe capability and PCI accessors

2020-06-15 Thread refactormyself
From: Bolarinwa Olayemi Saheed PATCH 1/8 to 7/8: PCIBIOS_ error codes have positive values and they are passed down the call heirarchy from accessors. For functions which are meant to return only a negative value on failure, passing on this value is a bug. To mitigate this, call pcibios_err_to_e

[Bug 208181] New: BUG: KASAN: stack-out-of-bounds in strcmp+0x58/0xd8

2020-06-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208181 Bug ID: 208181 Summary: BUG: KASAN: stack-out-of-bounds in strcmp+0x58/0xd8 Product: Platform Specific/Hardware Version: 2.5 Kernel Version: 5.8-rc1 Hardware: PPC-32 OS: Li

[Bug 208181] BUG: KASAN: stack-out-of-bounds in strcmp+0x58/0xd8

2020-06-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=208181 --- Comment #1 from Erhard F. (erhar...@mailbox.org) --- Created attachment 289661 --> https://bugzilla.kernel.org/attachment.cgi?id=289661&action=edit kernel .config (5.8-rc1, PowerMac G4 DP) -- You are receiving this mail because: You are wa

[PATCH v12 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
Changes since v11 [1]: * Minor update to 'papr_pdsm.h' fixing a misleading comment about 'possible' padding being added by GCC which doesn't apply in case structs are marked as __packed. * Fix the order of initialization of 'struct nd_papr_pdsm_health' in papr_pdsm_health(). * Added acks from

[PATCH v12 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Acked-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v11..v1

[PATCH v12 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-15 Thread Vaibhav Jain
Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit bitmap, bitwise-and of which is then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attri

[PATCH v12 2/6] seq_buf: Export seq_buf_printf

2020-06-15 Thread Vaibhav Jain
'seq_buf' provides a very useful abstraction for writing to a string buffer without needing to worry about it over-flowing. However even though the API has been stable for couple of years now its still not exported to kernel loadable modules limiting its usage. Hence this patch proposes update to

[PATCH v12 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-15 Thread Vaibhav Jain
Since papr_scm_ndctl() can be called from outside papr_scm, its exposed to the possibility of receiving NULL as value of 'cmd_rc' argument. This patch updates papr_scm_ndctl() to protect against such possibility by assigning it pointer to a local variable in case cmd_rc == NULL. Finally the patch

[PATCH v12 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-15 Thread Vaibhav Jain
Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm module and add the command family NVDIMM_FAMILY_PAPR to the white list of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the nvdimm command mask and implement necessary scaffolding in the module to handle ND_CMD_

[PATCH v12 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-15 Thread Vaibhav Jain
This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' that returns a newly introduced 'struct nd_papr_pdsm_health' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_pdsm_health() that que

Re: [PATCH v2] SUNRPC: Add missing definition of ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE

2020-06-15 Thread Chuck Lever
> On Jun 15, 2020, at 2:25 AM, Christophe Leroy > wrote: > > Even if that's only a warning, not including asm/cacheflush.h > leads to svc_flush_bvec() being empty allthough powerpc defines > ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE. > > CC net/sunrpc/svcsock.o > net/sunrpc/svcsock.c:227:5: wa

[PATCH v13 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
Changes since v12 [1]: * Fixed the clang warning regarding variable length object' being not at the end of the 'struct nd_pdsm_cmd_pkg' by introducing a new layout. * Removed instance of 'struct nd_cmd_pkg hdr' from 'struct nd_pdsm_cmd_pkg' and renamed the struct to 'struct nd_pkg_pdsm' to ma

[PATCH v13 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
Add documentation to 'papr_hcalls.rst' describing the bitmap flags that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM specification. Cc: "Aneesh Kumar K . V" Cc: Dan Williams Cc: Michael Ellerman Cc: Ira Weiny Acked-by: Ira Weiny Signed-off-by: Vaibhav Jain --- Changelog: v12..v1

[PATCH v13 3/6] powerpc/papr_scm: Fetch nvdimm health information from PHYP

2020-06-15 Thread Vaibhav Jain
Implement support for fetching nvdimm health information via H_SCM_HEALTH hcall as documented in Ref[1]. The hcall returns a pair of 64-bit bitmap, bitwise-and of which is then stored in 'struct papr_scm_priv' and subsequently partially exposed to user-space via newly introduced dimm specific attri

[PATCH v13 6/6] powerpc/papr_scm: Implement support for PAPR_PDSM_HEALTH

2020-06-15 Thread Vaibhav Jain
This patch implements support for PDSM request 'PAPR_PDSM_HEALTH' that returns a newly introduced 'struct nd_papr_pdsm_health' instance containing dimm health information back to user space in response to ND_CMD_CALL. This functionality is implemented in newly introduced papr_pdsm_health() that que

[PATCH v13 4/6] powerpc/papr_scm: Improve error logging and handling papr_scm_ndctl()

2020-06-15 Thread Vaibhav Jain
Since papr_scm_ndctl() can be called from outside papr_scm, its exposed to the possibility of receiving NULL as value of 'cmd_rc' argument. This patch updates papr_scm_ndctl() to protect against such possibility by assigning it pointer to a local variable in case cmd_rc == NULL. Finally the patch

[PATCH v13 2/6] seq_buf: Export seq_buf_printf

2020-06-15 Thread Vaibhav Jain
'seq_buf' provides a very useful abstraction for writing to a string buffer without needing to worry about it over-flowing. However even though the API has been stable for couple of years now its still not exported to kernel loadable modules limiting its usage. Hence this patch proposes update to

[PATCH v13 5/6] ndctl/papr_scm, uapi: Add support for PAPR nvdimm specific methods

2020-06-15 Thread Vaibhav Jain
Introduce support for PAPR NVDIMM Specific Methods (PDSM) in papr_scm module and add the command family NVDIMM_FAMILY_PAPR to the white list of NVDIMM command sets. Also advertise support for ND_CMD_CALL for the nvdimm command mask and implement necessary scaffolding in the module to handle ND_CMD_

Re: [PATCH v12 1/6] powerpc: Document details on H_SCM_HEALTH hcall

2020-06-15 Thread Vaibhav Jain
This accidently got reposted. Please ignore. Vaibhav Jain writes: > Add documentation to 'papr_hcalls.rst' describing the bitmap flags > that are returned from H_SCM_HEALTH hcall as per the PAPR-SCM > specification. > > Cc: "Aneesh Kumar K . V" > Cc: Dan Williams > Cc: Michael Ellerman > Cc

Re: [PATCH v12 0/6] powerpc/papr_scm: Add support for reporting nvdimm health

2020-06-15 Thread Vaibhav Jain
This accidently got reposted. Please ignore. v13 version of the patch series located at https://lore.kernel.org/linux-nvdimm/20200615124407.32596-1-vaib...@linux.ibm.com Vaibhav Jain writes: > Changes since v11 [1]: > * Minor update to 'papr_pdsm.h' fixing a misleading comment about > 'possi

Re: [PATCH v13 2/6] seq_buf: Export seq_buf_printf

2020-06-15 Thread Borislav Petkov
On Mon, Jun 15, 2020 at 06:14:03PM +0530, Vaibhav Jain wrote: > 'seq_buf' provides a very useful abstraction for writing to a string > buffer without needing to worry about it over-flowing. However even > though the API has been stable for couple of years now its still not > exported to kernel load

[PATCH 2/3] mm: Allow arches to provide ptep_get()

2020-06-15 Thread Christophe Leroy
Since commit 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses"), it is not possible anymore to use READ_ONCE() to access complex page table entries like the one defined for powerpc 8xx with 16k size pages. Define a ptep_get() helper that architectures can overrid

[PATCH 1/3] mm/gup: Use huge_ptep_get() in gup_hugepte()

2020-06-15 Thread Christophe Leroy
gup_hugepte() reads hugepage table entries, it can't read them directly, huge_ptep_get() must be used. Fixes: 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") Cc: Will Deacon Signed-off-by: Christophe Leroy --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+

[PATCH 0/3] Fix build failure with v5.8-rc1

2020-06-15 Thread Christophe Leroy
Commit 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() memory accesses") leads to following build failure on powerpc 8xx. To fix it, this small series introduces a new helper named ptep_get() to replace the direct access with READ_ONCE(). This new helper can be overriden by arc

[PATCH 3/3] powerpc/8xx: Provide ptep_get() with 16k pages

2020-06-15 Thread Christophe Leroy
READ_ONCE() now enforces atomic read, which leads to: CC mm/gup.o In file included from ./include/linux/kernel.h:11:0, from mm/gup.c:2: In function 'gup_hugepte.constprop', inlined from 'gup_huge_pd.isra.79' at mm/gup.c:2465:8: ./include/linux/compiler.h:392:38: error:

[PATCH 1/6] exec: cleanup the execve wrappers

2020-06-15 Thread Christoph Hellwig
Remove a whole bunch of wrappers that eventually all call __do_execve_file, and consolidate the execvce helpers to: (1) __do_execveat, which is the lowest level helper implementing the actual functionality (2) do_execvat, which is used by all callers that want native pointers (3)

properly support exec and wait with kernel pointers

2020-06-15 Thread Christoph Hellwig
Hi all, this series first cleans up the exec code and then adds proper kernel_execveat and kernel_wait callers instead of relying on the fact that the early init code and kernel threads implicitly run with the address limit set to KERNEL_DS. Note that the cleanup removes the compat execve(at) han

[PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Christoph Hellwig
The only differenence betweeen the compat exec* syscalls and their native versions is that compat_ptr sign extension, and the fact that the pointer arithmetics for the two dimensional arrays needs to use the compat pointer size. Instead of the compat wrappers and the struct user_arg_ptr machinery

[PATCH 3/6] exec: cleanup the count() function

2020-06-15 Thread Christoph Hellwig
Remove the max argument as it is hard wired to MAX_ARG_STRINGS, and give the function a slightly less generic name. Signed-off-by: Christoph Hellwig --- fs/exec.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 94107eceda8a67..6e4d9d1ffa

[PATCH 4/6] exec: split prepare_arg_pages

2020-06-15 Thread Christoph Hellwig
Move counting the arguments and enviroment variables out of prepare_arg_pages and rename the rest of the function to check_arg_limit. This prepares for a version of do_execvat that takes kernel pointers. Signed-off-by: Christoph Hellwig --- fs/exec.c | 26 ++ 1 file chang

[PATCH 5/6] exec: add a kernel_execveat helper

2020-06-15 Thread Christoph Hellwig
Add a kernel_execveat helper to execute a binary with kernel space argv and envp pointers. Switch executing init and user mode helpers to this new helper instead of relying on the implicit set_fs(KERNEL_DS) for early init code and kernel threads, and move the getname call into the do_execve helper

[PATCH 6/6] kernel: add a kernel_wait helper

2020-06-15 Thread Christoph Hellwig
Add a helper that waits for a pid and stores the status in the passed in kernel pointer. Use it to fix the usage of kernel_wait4 in call_usermodehelper_exec_sync that only happens to work due to the implicit set_fs(KERNEL_DS) for kernel threads. Signed-off-by: Christoph Hellwig --- include/linu

[PATCH] powerpc/ptdump: Fix build failure in hashpagetable.c

2020-06-15 Thread Christophe Leroy
H_SUCCESS is only defined when CONFIG_PPC_PSERIES is defined. != H_SUCCESS means != 0. Modify the test accordingly. Reported-by: kernel test robot Fixes: 65e701b2d2a8 ("powerpc/ptdump: drop non vital #ifdefs") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdum

Re: [PATCH 3/3] powerpc/8xx: Provide ptep_get() with 16k pages

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 12:57:59PM +, Christophe Leroy wrote: > READ_ONCE() now enforces atomic read, which leads to: > Fixes: 2ab3a0a02905 ("READ_ONCE: Enforce atomicity for {READ,WRITE}_ONCE() > memory accesses") > Cc: Will Deacon > Signed-off-by: Christophe Leroy > --- > arch/powerpc/i

Re: properly support exec and wait with kernel pointers

2020-06-15 Thread Arnd Bergmann
On Mon, Jun 15, 2020 at 3:00 PM Christoph Hellwig wrote: > > Hi all, > > this series first cleans up the exec code and then adds proper > kernel_execveat and kernel_wait callers instead of relying on the fact > that the early init code and kernel threads implicitly run with > the address limit set

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Arnd Bergmann
On Mon, Jun 15, 2020 at 3:00 PM Christoph Hellwig wrote: > > The only differenence betweeen the compat exec* syscalls and their > native versions is that compat_ptr sign extension, and the fact that > the pointer arithmetics for the two dimensional arrays needs to use > the compat pointer size. I

Re: [PATCH 0/8 v2] PCI: Align return values of PCIe capability and PCI accessors

2020-06-15 Thread Jason Gunthorpe
On Mon, Jun 15, 2020 at 09:32:17AM +0200, refactormys...@gmail.com wrote: > From: Bolarinwa Olayemi Saheed > > > PATCH 1/8 to 7/8: > PCIBIOS_ error codes have positive values and they are passed down the > call heirarchy from accessors. For functions which are meant to return > only a negative v

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2020 at 03:31:35PM +0200, Arnd Bergmann wrote: > > #ifdef CONFIG_COMPAT > > - if (unlikely(argv.is_compat)) { > > + if (in_compat_syscall()) { > > + const compat_uptr_t __user *compat_argv = > > + compat_ptr((unsigned long)argv); > >

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2020 at 04:40:28PM +0200, Arnd Bergmann wrote: > > ld: arch/x86/entry/syscall_x32.o:(.rodata+0x1040): undefined reference to > > `__x32_sys_execve' > > ld: arch/x86/entry/syscall_x32.o:(.rodata+0x1108): undefined reference to > > `__x32_sys_execveat' > > make: *** [Makefile:1139: vm

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Arnd Bergmann
On Mon, Jun 15, 2020 at 4:12 PM Christoph Hellwig wrote: > On Mon, Jun 15, 2020 at 03:31:35PM +0200, Arnd Bergmann wrote: > > > I don't really understand > > the comment, why can't this just use this? > > That errors out with: > > ld: arch/x86/entry/syscall_x32.o:(.rodata+0x1040): undefined refer

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Arnd Bergmann
On Mon, Jun 15, 2020 at 4:43 PM Christoph Hellwig wrote: > > On Mon, Jun 15, 2020 at 04:40:28PM +0200, Arnd Bergmann wrote: > > > ld: arch/x86/entry/syscall_x32.o:(.rodata+0x1040): undefined reference to > > > `__x32_sys_execve' > > > ld: arch/x86/entry/syscall_x32.o:(.rodata+0x1108): undefined re

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Brian Gerst
On Mon, Jun 15, 2020 at 10:13 AM Christoph Hellwig wrote: > > On Mon, Jun 15, 2020 at 03:31:35PM +0200, Arnd Bergmann wrote: > > > #ifdef CONFIG_COMPAT > > > - if (unlikely(argv.is_compat)) { > > > + if (in_compat_syscall()) { > > > + const compat_uptr_t __user *compat_a

Re: [PATCH net] ibmvnic: Harden device login requests

2020-06-15 Thread Thomas Falcon
On 6/12/20 4:10 PM, David Miller wrote: From: Thomas Falcon Date: Fri, 12 Jun 2020 13:31:39 -0500 @@ -841,13 +841,14 @@ static int ibmvnic_login(struct net_device *netdev) { struct ibmvnic_adapter *adapter = netdev_priv(netdev); unsigned long timeout = msecs_to_jiffies(3)

Re: [PATCH v2 00/12] x86: tag application address space for devices

2020-06-15 Thread Fenghua Yu
Hi, Peter, On Mon, Jun 15, 2020 at 09:52:02AM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2020 at 05:41:21PM -0700, Fenghua Yu wrote: > > > This series only provides simple and basic support for ENQCMD and the MSR: > > 1. Clean up type definitions (patch 1-3). These patches can be in a > >s

Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE

2020-06-15 Thread Scott Wood
On Sat, 2020-06-13 at 23:28 +0700, Arseny Solokha wrote: > Building the current 5.8 kernel for a e500 machine with > CONFIG_RANDOMIZE_BASE set yields the following failure: > > arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init': > arch/powerpc/mm/nohash/kaslr_booke.c:387:2: e

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2020 at 04:46:15PM +0200, Arnd Bergmann wrote: > How about this one: > > diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c > index 3d8d70d3896c..0ce15807cf54 100644 > --- a/arch/x86/entry/syscall_x32.c > +++ b/arch/x86/entry/syscall_x32.c > @@ -16,6 +16,9 @@

Re: [PATCH] scsi: target/sbp: remove firewire SBP target driver

2020-06-15 Thread Chris Boot
On 15/06/2020 00:28, Finn Thain wrote: > On Sun, 14 Jun 2020, Chris Boot wrote: > >> I expect that if someone finds this useful it can stick around (but >> that's not my call). > > Who's call is that? If the patch had said "From: Martin K. Petersen" and > "This driver is being removed because i

[PATCH net v2] ibmvnic: Harden device login requests

2020-06-15 Thread Thomas Falcon
The VNIC driver's "login" command sequence is the final step in the driver's initialization process with device firmware, confirming the available device queue resources to be utilized by the driver. Under high system load, firmware may not respond to the request in a timely manner or may abort the

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Brian Gerst
On Mon, Jun 15, 2020 at 11:10 AM Christoph Hellwig wrote: > > On Mon, Jun 15, 2020 at 04:46:15PM +0200, Arnd Bergmann wrote: > > How about this one: > > > > diff --git a/arch/x86/entry/syscall_x32.c b/arch/x86/entry/syscall_x32.c > > index 3d8d70d3896c..0ce15807cf54 100644 > > --- a/arch/x86/entry

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Fenghua Yu
Hi, Peter, On Mon, Jun 15, 2020 at 09:56:49AM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > > +/* > > + * Apply some heuristics to see if the #GP fault was caused by a thread > > + * that hasn't had the IA32_PASID MSR initialized. If it looks like tha

Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-15 Thread Peter Zijlstra
On Mon, Jun 15, 2020 at 08:48:54AM -0700, Fenghua Yu wrote: > Hi, Peter, > On Mon, Jun 15, 2020 at 09:56:49AM +0200, Peter Zijlstra wrote: > > On Fri, Jun 12, 2020 at 05:41:33PM -0700, Fenghua Yu wrote: > > > +/* > > > + * Apply some heuristics to see if the #GP fault was caused by a thread > > > +

Re: [PATCH 2/6] exec: simplify the compat syscall handling

2020-06-15 Thread Christoph Hellwig
On Mon, Jun 15, 2020 at 11:33:49AM -0400, Brian Gerst wrote: > If you move those aliases above all the __SYSCALL_* defines it will > work, since that will get the forward declaration too. This would be > the simplest workaround. That compiles and also passes my exaustive x32 tests (chroot + ls -l

  1   2   >