Re: [PATCH v1 23/55] KVM: PPC: Book3S HV P9: Reduce mtmsrd instructions required to save host SPRs

2021-07-26 Thread kernel test robot
'--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Nicholas-Piggin/KVM-PPC-Book3S-HV-P9-entry-exit-optimisations/20210726-115329 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds

Linux kernel: powerpc: KVM guest to host memory corruption

2021-07-26 Thread Michael Ellerman
The Linux kernel for powerpc since v3.10 has a bug which allows a malicious KVM guest to corrupt host memory. In the handling of the H_RTAS hypercall, args.rets is made to point into the args.args buffer which is located on the stack: args.rets = &args.args[be32_to_cpu(args.nargs)]; Ho

[PATCH v3] soc: fsl: qe: convert QE interrupt controller to platform_device

2021-07-26 Thread Maxim Kochetkov
Since 5.13 QE's ucc nodes can't get interrupts from devicetree: ucc@2000 { cell-index = <1>; reg = <0x2000 0x200>; interrupts = <32>; interrupt-parent = <&qeic>; }; Now fw_devlink expects driver to create and probe a

Re: [PATCH v3 0/5] powerpc: apm82181: adding customer devices

2021-07-26 Thread Andy Shevchenko
On Sat, Jul 24, 2021 at 12:08:30AM +0200, Christian Lamparter wrote: > On 23/07/2021 21:19, Andy Shevchenko wrote: > > On Sun, Sep 06, 2020 at 12:06:10AM +0200, Christian Lamparter wrote: > > > I've been holding on to these devices dts' for a while now. > > > But ever since the recent purge of the

[RFC PATCH 4/4] powerpc/64e: Get dear offset with _DEAR macro

2021-07-26 Thread sxwjean
From: Xiongwei Song Use _DEAR to get the offset of dear register in pr_regs for 64e cpus. Signed-off-by: Xiongwei Song --- arch/powerpc/kernel/asm-offsets.c| 13 +++-- arch/powerpc/kernel/exceptions-64e.S | 8 2 files changed, 7 insertions(+), 14 deletions(-) diff --git

[RFC PATCH 2/4] powerpc/64e: Get esr offset with _ESR macro

2021-07-26 Thread sxwjean
From: Xiongwei Song Use _ESR to get the offset of esr register in pr_regs for 64e cpus. Signed-off-by: Xiongwei Song --- arch/powerpc/kernel/asm-offsets.c| 2 +- arch/powerpc/kernel/exceptions-64e.S | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/power

[RFC PATCH 3/4] powerpc: Optimize register usage for dear register

2021-07-26 Thread sxwjean
From: Xiongwei Song Create an anonymous union for dar and dear regsiters, we can reference dear to get the effective address when CONFIG_4xx=y or CONFIG_BOOKE=y. Otherwise, reference dar. This makes code more clear. Signed-off-by: Xiongwei Song --- arch/powerpc/include/asm/ptrace.h | 5 ++

[RFC PATCH 1/4] powerpc: Optimize register usage for esr register

2021-07-26 Thread sxwjean
From: Xiongwei Song Create an anonymous union for dsisr and esr regsiters, we can reference esr to get the exception detail when CONFIG_4xx=y or CONFIG_BOOKE=y. Otherwise, reference dsisr. This makes code more clear. Signed-off-by: Xiongwei Song --- arch/powerpc/include/asm/ptrace.h |

[PATCH] powerpc/stacktrace: Include linux/delay.h

2021-07-26 Thread Michal Suchanek
commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") introduces udelay() call without including the linux/delay.h header. This may happen to work on master but the header that declares the functionshould be included nonetheless. Fixes: 7c6986ade69e ("po

[PATCH] cpufreq:powernv: Fix init_chip_info initialization in numa=off

2021-07-26 Thread Pratik R. Sampat
In the numa=off kernel command-line configuration init_chip_info() loops around the number of chips and attempts to copy the cpumask of that node which is NULL for all iterations after the first chip. Hence, store the cpu mask for each chip instead of derving cpumask from node while populating the

Re: [PATCH] powerpc/stacktrace: Include linux/delay.h

2021-07-26 Thread Gabriel Paubert
On Mon, Jul 26, 2021 at 05:42:43PM +0200, Michal Suchanek wrote: > commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in > raise_backtrace_ipi()") > introduces udelay() call without including the linux/delay.h header. > This may happen to work on master but the header that decla

[PATCH v5 0/2] KVM: PPC: Book3S HV: Nested guest state sanitising changes

2021-07-26 Thread Fabiano Rosas
This series aims to stop contaminating the l2_hv structure with bits that might have come from L1 state. Patch 1 makes l2_hv read-only (mostly). It is now only changed when we explicitly want to pass information to L1. Patch 2 makes sure that L1 is not forwarded HFU interrupts when the host has d

[PATCH v5 1/2] KVM: PPC: Book3S HV: Sanitise vcpu registers in nested path

2021-07-26 Thread Fabiano Rosas
As one of the arguments of the H_ENTER_NESTED hypercall, the nested hypervisor (L1) prepares a structure containing the values of various hypervisor-privileged registers with which it wants the nested guest (L2) to run. Since the nested HV runs in supervisor mode it needs the host to write to these

[PATCH v5 2/2] KVM: PPC: Book3S HV: Stop forwarding all HFUs to L1

2021-07-26 Thread Fabiano Rosas
If the nested hypervisor has no access to a facility because it has been disabled by the host, it should also not be able to see the Hypervisor Facility Unavailable that arises from one of its guests trying to access the facility. This patch turns a HFU that happened in L2 into a Hypervisor Emulat

RE: [PATCH v3] soc: fsl: qe: convert QE interrupt controller to platform_device

2021-07-26 Thread Leo Li
> -Original Message- > From: Maxim Kochetkov > Sent: Monday, July 26, 2021 12:22 AM > To: linuxppc-dev@lists.ozlabs.org > Cc: linux-arm-ker...@lists.infradead.org; linux-ker...@vger.kernel.org; > sarava...@google.com; Leo Li ; Qiang Zhao > ; gre...@linuxfoundation.org; Maxim Kochetkov >

Re: Linux kernel: powerpc: KVM guest to host memory corruption

2021-07-26 Thread Michael Ellerman
Michael Ellerman writes: > The Linux kernel for powerpc since v3.10 has a bug which allows a malicious > KVM guest to > corrupt host memory. > > In the handling of the H_RTAS hypercall, args.rets is made to point into the > args.args > buffer which is located on the stack: > > args.rets =

Re: [PATCH v5 2/2] KVM: PPC: Book3S HV: Stop forwarding all HFUs to L1

2021-07-26 Thread Nicholas Piggin
Excerpts from Fabiano Rosas's message of July 27, 2021 6:17 am: > If the nested hypervisor has no access to a facility because it has > been disabled by the host, it should also not be able to see the > Hypervisor Facility Unavailable that arises from one of its guests > trying to access the facili

Re: [PATCH v5 4/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-07-26 Thread Aneesh Kumar K.V
David Gibson writes: > On Thu, Jul 22, 2021 at 12:37:46PM +0530, Aneesh Kumar K.V wrote: >> David Gibson writes: >> >> > On Mon, Jun 28, 2021 at 08:41:15PM +0530, Aneesh Kumar K.V wrote: > >> > >> >> + nid = of_read_number(&aa.arrays[index], 1); >> >> + >> >> + if (nid =

[PATCH] tests/nvdimm/ndtest: Simulate nvdimm health, DSC and smart-inject

2021-07-26 Thread Shivaprasad G Bhat
The 'papr_scm' module and 'papr' implementation in libndctl supports PDSMs for reporting PAPR NVDIMM health, its dirty-shutdown-count and injecting smart-error. This patch adds support for those PDSMs in ndtest module so that PDSM specific paths in libndctl can be exercised. Signed-off-by: Shivapr

Re: [PATCH v5 4/6] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-07-26 Thread David Gibson
On Tue, Jul 27, 2021 at 09:02:33AM +0530, Aneesh Kumar K.V wrote: > David Gibson writes: > > > On Thu, Jul 22, 2021 at 12:37:46PM +0530, Aneesh Kumar K.V wrote: > >> David Gibson writes: > >> > >> > On Mon, Jun 28, 2021 at 08:41:15PM +0530, Aneesh Kumar K.V wrote: > > > > > > >> > > >>

switch the block layer to use kmap_local_page v3

2021-07-26 Thread Christoph Hellwig
Hi all, this series switches the core block layer code and all users of the existing bvec kmap helpers to use kmap_local_page. Drivers that currently use open coded kmap_atomic calls will converted in a follow on series. To do so a new kunmap variant is added that calls flush_kernel_dcache_page.

[PATCH 01/15] MIPS: don't include in

2021-07-26 Thread Christoph Hellwig
There is no need to include genhd.h from a random arch header, and not doing so prevents the possibility for nasty include loops. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- arch/mips/include/asm/mach-rc32434/rb.h

[PATCH 02/15] bvec: fix the include guards for bvec.h

2021-07-26 Thread Christoph Hellwig
Fix the include guards to match the file naming. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --g

[PATCH 03/15] bvec: add a bvec_kmap_local helper

2021-07-26 Thread Christoph Hellwig
Add a helper to call kmap_local_page on a bvec. There is no need for an unmap helper given that kunmap_local accept any address in the mapped page. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h

[PATCH 04/15] bvec: add memcpy_{from, to}_bvec and memzero_bvec helper

2021-07-26 Thread Christoph Hellwig
Add helpers to perform common memory operation on a bvec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h | 33 + 1 file changed, 33 insertions(+) diff --git a/inc

[PATCH 05/15] block: use memzero_page in zero_fill_bio

2021-07-26 Thread Christoph Hellwig
Use memzero_bvec to zero each segment in the bio instead of manually mapping and zeroing the data. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- block/bio.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletion

[PATCH 06/15] rbd: use memzero_bvec

2021-07-26 Thread Christoph Hellwig
Use memzero_bvec instead of reimplementing it. Signed-off-by: Christoph Hellwig Acked-by: Ilya Dryomov Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- drivers/block/rbd.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/block/rbd.c b/driv

[PATCH 07/15] dm-writecache: use bvec_kmap_local instead of bvec_kmap_irq

2021-07-26 Thread Christoph Hellwig
There is no need to disable interrupts in bio_copy_block, and the local only mappings helps to avoid any sort of problems with stray writes into the bio data. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- drivers/md/dm-writecache.c | 5 ++--- 1 fil

[PATCH 08/15] ps3disk: use memcpy_{from,to}_bvec

2021-07-26 Thread Christoph Hellwig
Use the bvec helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Tested-by: Geoff Levand --- drivers/block/ps3disk.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/block/ps3disk.c b/drivers/b

[PATCH 09/15] block: remove bvec_kmap_irq and bvec_kunmap_irq

2021-07-26 Thread Christoph Hellwig
These two helpers are entirely unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- include/linux/bio.h | 42 -- 1 file changed, 42 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 2203b686e1f0..7b5f65

Re: [PATCH] cpufreq:powernv: Fix init_chip_info initialization in numa=off

2021-07-26 Thread Gautham R Shenoy
On Mon, Jul 26, 2021 at 10:37:57PM +0530, Pratik R. Sampat wrote: > In the numa=off kernel command-line configuration init_chip_info() loops > around the number of chips and attempts to copy the cpumask of that node > which is NULL for all iterations after the first chip. > > Hence, store the cpu

[PATCH 10/15] block: rewrite bio_copy_data_iter to use bvec_kmap_local and memcpy_to_bvec

2021-07-26 Thread Christoph Hellwig
Use the proper helpers instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bio.c | 28 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/block/bio.c b/block/bio.c index 2e436bccb1e2..0c89fa2f7a85 1

[PATCH 11/15] block: use memcpy_to_bvec in copy_to_high_bio_irq

2021-07-26 Thread Christoph Hellwig
Use memcpy_to_bvec instead of opencoding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bounce.c | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/block/bounce.c b/block/bounce.c index 94081e013c58..7e9e666c04dc 1006

[PATCH 12/15] block: use memcpy_from_bvec in bio_copy_kern_endio_read

2021-07-26 Thread Christoph Hellwig
Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/blk-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-map.c b/block/blk-map.c index 3743158ddaeb..d1448aaad980 100644 --- a/block/b

[PATCH 13/15] block: use memcpy_from_bvec in __blk_queue_bounce

2021-07-26 Thread Christoph Hellwig
Rewrite the actual bounce buffering loop in __blk_queue_bounce to that the memcpy_to_bvec helper can be used to perform the data copies. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bounce.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-)

[PATCH 14/15] block: use bvec_kmap_local in t10_pi_type1_{prepare, complete}

2021-07-26 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/t10-pi.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/block

[PATCH 15/15] block: use bvec_kmap_local in bio_integrity_process

2021-07-26 Thread Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen --- block/bio-integrity.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/b

Re: [PATCH] cpufreq:powernv: Fix init_chip_info initialization in numa=off

2021-07-26 Thread Pratik Sampat
On 27/07/21 11:46 am, Gautham R Shenoy wrote: On Mon, Jul 26, 2021 at 10:37:57PM +0530, Pratik R. Sampat wrote: In the numa=off kernel command-line configuration init_chip_info() loops around the number of chips and attempts to copy the cpumask of that node which is NULL for all iterations af

[PATCH 1/3] powerpc64/bpf: Store temp registers' bpf to ppc mapping

2021-07-26 Thread Jordan Niethe
In bpf_jit_build_body(), the mapping of TMP_REG_1 and TMP_REG_2's bpf register to ppc register is evalulated at every use despite not changing. Instead, determine the ppc register once and store the result. This will be more useful when a later patch introduces a more complex mapping from bpf regis

[PATCH 2/3] powerpc/bpf: Use helper for mapping bpf to ppc registers on PPC64

2021-07-26 Thread Jordan Niethe
Prepare for doing commit 40272035e1d0 ("powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32") on PPC64 in a later patch. Instead of directly accessing the const b2p[] array for mapping bpf to ppc registers use bpf_to_ppc() which allows per struct codegen_context mappi

[PATCH 3/3] powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC64

2021-07-26 Thread Jordan Niethe
Implement commit 40272035e1d0 ("powerpc/bpf: Reallocate BPF registers to volatile registers when possible on PPC32") for PPC64. When the BPF routine doesn't call any function, the non volatile registers can be reallocated to volatile registers in order to avoid having to save them/restore on the s