Re: [PATCH] KVM: PPC: Book3S: Assign boolean values to a bool variable

2020-12-14 Thread Paul Mackerras
: WARNING: Assignment of 0/1 to bool > variable > > Reported-by: Tosk Robot > Signed-off-by: Kaixu Xia Acked-by: Paul Mackerras

Re: [PATCH v2 1/1] powerpc/kvm: Fix mask size for emulated msgsndp

2020-12-14 Thread Paul Mackerras
issing their MSB: > msgtype: ((arg >> 27) & 0xf) : Gets (RB) 33:36, missing bit 32 > t: (arg &= 0x3f) : Gets (RB) 58:63, missing bit 57 > > Fixes this by applying the correct mask. > > Signed-off-by: Leonardo Bras Acked-by: Paul Mackerras

Re: [PATCH v2 4/4] KVM: PPC: Introduce new capability for 2nd DAWR

2020-12-08 Thread Paul Mackerras
On Tue, Nov 24, 2020 at 04:29:53PM +0530, Ravi Bangoria wrote: > Introduce KVM_CAP_PPC_DAWR1 which can be used by Qemu to query whether > kvm supports 2nd DAWR or not. This should be described in Documentation/virt/kvm/api.rst. Strictly speaking, it should be a capability which is disabled by

Re: [PATCH -next v2] KVM: PPC: Book3S HV: XIVE: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-22 Thread Paul Mackerras
On Sat, Sep 19, 2020 at 09:29:25AM +0800, Qinglang Miao wrote: > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Qinglang Miao Thanks, applied. Paul.

Re: [PATCH -next] powerpc/kvm/books: Fix symbol undeclared warnings

2020-09-22 Thread Paul Mackerras
On Mon, Sep 21, 2020 at 11:22:11AM +, Wang Wensheng wrote: > Build the kernel with `C=2`: > arch/powerpc/kvm/book3s_hv_nested.c:572:25: warning: symbol > 'kvmhv_alloc_nested' was not declared. Should it be static? > arch/powerpc/kvm/book3s_64_mmu_radix.c:350:6: warning: symbol >

Re: [PATCH] KVM: PPC: Book3S: Remove redundant initialization of variable ret

2020-09-22 Thread Paul Mackerras
On Sat, Sep 19, 2020 at 03:12:30PM +0800, Jing Xiangfeng wrote: > The variable ret is being initialized with '-ENOMEM' that is meaningless. > So remove it. > > Signed-off-by: Jing Xiangfeng Thanks, applied. Paul.

Re: [PATCH V2] Doc: admin-guide: Add entry for kvm_cma_resv_ratio kernel param

2020-09-21 Thread Paul Mackerras
sh mode PowerPC KVM guests. > > Cc: linux-kernel@vger.kernel.org > Cc: kvm-...@vger.kernel.org > Cc: linuxppc-...@lists.ozlabs.org > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Jonathan Corbet > Reviewed-by: Randy Dunlap > Signed-off-by: Satheesh Rajendran > -

Re: [PATCH -next] powerpc: Convert to DEFINE_SHOW_ATTRIBUTE

2020-09-01 Thread Paul Mackerras
On Thu, Jul 16, 2020 at 05:07:12PM +0800, Qinglang Miao wrote: > From: Chen Huang > > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Chen Huang For the arch/powerpc/kvm part: Acked-by: Paul Mackerras I expect Michael Ellerman will take the patch t

Re: [PATCH 0/7] powerpc/watchpoint: 2nd DAWR kvm enablement + selftests

2020-09-01 Thread Paul Mackerras
On Thu, Jul 23, 2020 at 03:50:51PM +0530, Ravi Bangoria wrote: > Patch #1, #2 and #3 enables p10 2nd DAWR feature for Book3S kvm guest. DAWR > is a hypervisor resource and thus H_SET_MODE hcall is used to set/unset it. > A new case H_SET_MODE_RESOURCE_SET_DAWR1 is introduced in H_SET_MODE hcall >

Re: [PATCH 2/7] powerpc/watchpoint/kvm: Add infrastructure to support 2nd DAWR

2020-09-01 Thread Paul Mackerras
On Thu, Jul 23, 2020 at 03:50:53PM +0530, Ravi Bangoria wrote: > kvm code assumes single DAWR everywhere. Add code to support 2nd DAWR. > DAWR is a hypervisor resource and thus H_SET_MODE hcall is used to set/ > unset it. Introduce new case H_SET_MODE_RESOURCE_SET_DAWR1 for 2nd DAWR. Is this the

Re: [PATCH 1/7] powerpc/watchpoint/kvm: Rename current DAWR macros and variables

2020-09-01 Thread Paul Mackerras
On Thu, Jul 23, 2020 at 03:50:52PM +0530, Ravi Bangoria wrote: > Power10 is introducing second DAWR. Use real register names (with > suffix 0) from ISA for current macros and variables used by kvm. Most of this looks fine, but I think we should not change the existing names in

Re: [PATCH v6 3/5] KVM: PPC: clean up redundant kvm_run parameters in assembly

2020-07-23 Thread Paul Mackerras
On Tue, Jun 23, 2020 at 09:14:16PM +0800, Tianjia Zhang wrote: > In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' > structure. For historical reasons, many kvm-related function parameters > retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This > patch does

Re: [PATCH 2/2] KVM: PPC: Book3S HV: rework secure mem slot dropping

2020-07-20 Thread Paul Mackerras
the pages, the > > > VMA is fetched in a lazy way, to not trigger find_vma() all the time. In > > > addition, the mmap_sem is help in read mode during that time, not in write > > > mode since the virual memory layout is not impacted, and > > >

Re: [PATCH 1/1] KVM/PPC: Fix typo on H_DISABLE_AND_GET hcall

2020-07-08 Thread Paul Mackerras
for InfiniBand usage"), and was > later used without having the typo noticed. > > Signed-off-by: Leonardo Bras Acked-by: Paul Mackerras Since this hypercall is not implemented in KVM nor used by KVM guests, I'll leave this one for Michael to pick up. Paul.

Re: [PATCH v4 3/7] KVM: PPC: Remove redundant kvm_run from vcpu_arch

2020-05-26 Thread Paul Mackerras
On Mon, Apr 27, 2020 at 12:35:10PM +0800, Tianjia Zhang wrote: > The 'kvm_run' field already exists in the 'vcpu' structure, which > is the same structure as the 'kvm_run' in the 'vcpu_arch' and > should be deleted. > > Signed-off-by: Tianjia Zhang Thanks, patches 3 and 4 of this series applied

Re: [PATCH -next] KVM: PPC: Book3S HV: remove redundant NULL check

2020-05-26 Thread Paul Mackerras
On Wed, Apr 01, 2020 at 09:09:03PM +0800, Chen Zhou wrote: > Free function kfree() already does NULL check, so the additional > check is unnecessary, just remove it. > > Signed-off-by: Chen Zhou Thanks, applied to my kvm-ppc-next branch. Paul.

Re: [PATCH] KVM: PPC: Book3S HV: read ibm,secure-memory nodes

2020-05-26 Thread Paul Mackerras
On Thu, Apr 16, 2020 at 06:27:15PM +0200, Laurent Dufour wrote: > The newly introduced ibm,secure-memory nodes supersede the > ibm,uv-firmware's property secure-memory-ranges. > > Firmware will no more expose the secure-memory-ranges property so first > read the new one and if not found rollback

Re: [PATCH] powerpc/kvm/radix: ignore kmemleak false positives

2020-05-26 Thread Paul Mackerras
On Wed, May 13, 2020 at 09:39:15AM -0400, Qian Cai wrote: > kvmppc_pmd_alloc() and kvmppc_pte_alloc() allocate some memory but then > pud_populate() and pmd_populate() will use __pa() to reference the newly > allocated memory. > > Since kmemleak is unable to track the physical memory resulting in

Re: [PATCH v2] KVM: PPC: Book3S HV: relax check on H_SVM_INIT_ABORT

2020-05-26 Thread Paul Mackerras
On Wed, May 20, 2020 at 07:43:08PM +0200, Laurent Dufour wrote: > The commit 8c47b6ff29e3 ("KVM: PPC: Book3S HV: Check caller of H_SVM_* > Hcalls") added checks of secure bit of SRR1 to filter out the Hcall > reserved to the Ultravisor. > > However, the Hcall H_SVM_INIT_ABORT is made by the

Re: [PATCH] powerpc/kvm/book3s64/vio: fix some RCU-list locks

2020-05-26 Thread Paul Mackerras
On Sun, May 10, 2020 at 01:18:34AM -0400, Qian Cai wrote: > It is unsafe to traverse kvm->arch.spapr_tce_tables and > stt->iommu_tables without the RCU read lock held. Also, add > cond_resched_rcu() in places with the RCU read lock held that could take > a while to finish. > >

Re: [PATCH] powerpc/kvm/book3s64/vio: fix some RCU-list locks

2020-05-26 Thread Paul Mackerras
On Sun, May 10, 2020 at 01:18:34AM -0400, Qian Cai wrote: > It is unsafe to traverse kvm->arch.spapr_tce_tables and > stt->iommu_tables without the RCU read lock held. Also, add > cond_resched_rcu() in places with the RCU read lock held that could take > a while to finish. This mostly looks fine.

Re: [linux-next PATCH] mm/gup.c: Convert to use get_user_{page|pages}_fast_only()

2020-05-26 Thread Paul Mackerras
f the API. > > Signed-off-by: Souptick Joarder The arch/powerpc/kvm bits look reasonable. Reviewed-by: Paul Mackerras

Re: [PATCH v4 4/7] KVM: PPC: clean up redundant 'kvm_run' parameters

2020-05-25 Thread Paul Mackerras
; patch does a unified cleanup of these remaining redundant parameters. > > Signed-off-by: Tianjia Zhang This looks OK, though possibly a little larger than it needs to be because of variable name changes (kvm_run -> run) that aren't strictly necessary. Reviewed-by: Paul Mackerras

Re: [PATCH v4 5/7] KVM: PPC: clean up redundant kvm_run parameters in assembly

2020-05-25 Thread Paul Mackerras
On Mon, Apr 27, 2020 at 12:35:12PM +0800, Tianjia Zhang wrote: > In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' > structure. For historical reasons, many kvm-related function parameters > retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This > patch does

Re: [PATCH v4 3/7] KVM: PPC: Remove redundant kvm_run from vcpu_arch

2020-05-25 Thread Paul Mackerras
ch architecture sub-maintainer is taking the relevant patches from this series via their tree - is that right? Reviewed-by: Paul Mackerras

Re: [PATCH] powerpc/kvm: Mark expected switch fall-through

2019-08-23 Thread Paul Mackerras
On Tue, Jul 30, 2019 at 04:46:37PM +0200, Paul Menzel wrote: > Date: Tue, 30 Jul 2019 10:53:10 +0200 > > Fix the error below triggered by `-Wimplicit-fallthrough`, by tagging > it as an expected fall-through. > > arch/powerpc/kvm/book3s_32_mmu.c: In function >

Re: [PATCH 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro

2019-08-13 Thread Paul Mackerras
On Tue, Aug 13, 2019 at 09:59:35AM +, Christophe Leroy wrote: [snip] > +.macro __LOAD_REG_IMMEDIATE r, x > + .if \x & ~0x != 0 > + __LOAD_REG_IMMEDIATE_32 \r, (\x) >> 32 > + rldicr \r, \r, 32, 31 > + .if (\x) & 0x != 0 > +

Re: [PATCH v3 14/16] powerpc/32: implement fast entry for syscalls on BOOKE

2019-05-23 Thread Paul Mackerras
On Tue, Apr 30, 2019 at 12:39:03PM +, Christophe Leroy wrote: > This patch implements a fast entry for syscalls. > > Syscalls don't have to preserve non volatile registers except LR. > > This patch then implement a fast entry for syscalls, where > volatile registers get clobbered. > > As

Re: [RFC PATCH 02/12] powerpc: Add support for adding an ESM blob to the zImage wrapper

2019-05-21 Thread Paul Mackerras
On Tue, May 21, 2019 at 07:13:26AM +0200, Christoph Hellwig wrote: > On Tue, May 21, 2019 at 01:49:02AM -0300, Thiago Jung Bauermann wrote: > > From: Benjamin Herrenschmidt > > > > For secure VMs, the signing tool will create a ticket called the "ESM blob" > > for the Enter Secure Mode

Re: [PATCH] KVM: PPC: Book3S: Replace kmalloc_node+memset with kzalloc_node

2019-02-22 Thread Paul Mackerras
On Mon, Jan 07, 2019 at 08:15:52PM +0800, wangbo wrote: > Replace kmalloc_node and memset with kzalloc_node > > Signed-off-by: wangbo Thanks, applied to my kvm-ppc-next tree. Paul.

Re: [PATCH] KVM: PPC: Book3S HV: Change to use DEFINE_SHOW_ATTRIBUTE macro

2018-12-17 Thread Paul Mackerras
On Mon, Nov 05, 2018 at 09:47:17AM -0500, Yangtao Li wrote: > Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. > > Signed-off-by: Yangtao Li Thanks, patch applied to my kvm-ppc-next branch. Paul.

Re: [Resend PATCH V5 7/10] KVM: Make kvm_set_spte_hva() return int

2018-12-11 Thread Paul Mackerras
turn value(s) mean that the caller should flush the tlb. I would guess that non-zero means to do the flush, but you should make that explicit. > Signed-off-by: Lan Tianyu For the powerpc bits: Acked-by: Paul Mackerras

Re: [PATCH v2] ppp: remove the PPPIOCDETACH ioctl

2018-05-23 Thread Paul Mackerras
CDETACH ioctl and see if anyone actually notices. Leave > a stub in place that prints a one-time warning and returns EINVAL. > > Reported-by: syzbot+16363c99d4134717c...@syzkaller.appspotmail.com > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: sta...@vger.kernel.org > Signed-off-by: Eric Biggers <ebigg...@google.com> Acked-by: Paul Mackerras <pau...@ozlabs.org>

Re: [PATCH v2] ppp: remove the PPPIOCDETACH ioctl

2018-05-23 Thread Paul Mackerras
nyone actually notices. Leave > a stub in place that prints a one-time warning and returns EINVAL. > > Reported-by: syzbot+16363c99d4134717c...@syzkaller.appspotmail.com > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: sta...@vger.kernel.org > Signed-off-by: Eric Biggers Acked-by: Paul Mackerras

Re: [PATCH] Revert "powerpc/64: Fix checksum folding in csum_add()"

2018-05-16 Thread Paul Mackerras
c 80 22 14 add r4,r0,r4 > 24c: 78 83 00 20 clrldi r3,r4,32 > 250: 4e 80 00 20 blr > > Fixes: 6ad966d7303b7 ("powerpc/64: Fix checksum folding in csum_add()") > Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> Seems I was right first time... :) Acked-by: Paul Mackerras <pau...@ozlabs.org>

Re: [PATCH] Revert "powerpc/64: Fix checksum folding in csum_add()"

2018-05-16 Thread Paul Mackerras
c 80 22 14 add r4,r0,r4 > 24c: 78 83 00 20 clrldi r3,r4,32 > 250: 4e 80 00 20 blr > > Fixes: 6ad966d7303b7 ("powerpc/64: Fix checksum folding in csum_add()") > Signed-off-by: Christophe Leroy Seems I was right first time... :) Acked-by: Paul Mackerras

Re: [PATCH v2] powerpc: kvm: Change return type to vm_fault_t

2018-05-16 Thread Paul Mackerras
On Wed, May 16, 2018 at 10:11:11AM +0530, Souptick Joarder wrote: > On Thu, May 10, 2018 at 11:57 PM, Souptick Joarder > wrote: > > Use new return type vm_fault_t for fault handler > > in struct vm_operations_struct. For now, this is > > just documenting that the function

Re: [PATCH v2] powerpc: kvm: Change return type to vm_fault_t

2018-05-16 Thread Paul Mackerras
On Wed, May 16, 2018 at 10:11:11AM +0530, Souptick Joarder wrote: > On Thu, May 10, 2018 at 11:57 PM, Souptick Joarder > wrote: > > Use new return type vm_fault_t for fault handler > > in struct vm_operations_struct. For now, this is > > just documenting that the function returns a > > VM_FAULT

Re: [PATCH] powerpc/misc: get rid of add_reloc_offset()

2018-04-17 Thread Paul Mackerras
On Tue, Apr 17, 2018 at 09:56:24AM +0200, Christophe Leroy wrote: > add_reloc_offset() is almost redundant with reloc_offset() > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/setup.h | 3 +-- > arch/powerpc/kernel/misc.S | 16

Re: [PATCH] powerpc/misc: get rid of add_reloc_offset()

2018-04-17 Thread Paul Mackerras
On Tue, Apr 17, 2018 at 09:56:24AM +0200, Christophe Leroy wrote: > add_reloc_offset() is almost redundant with reloc_offset() > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/setup.h | 3 +-- > arch/powerpc/kernel/misc.S | 16 >

Re: [PATCH] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

2018-03-04 Thread Paul Mackerras
On Fri, Mar 02, 2018 at 11:51:56AM +0100, Laurent Vivier wrote: > Since commit 8b24e69fc47e ("KVM: PPC: Book3S HV: Close race with testing > for signals on guest entry"), if CONFIG_VIRT_CPU_ACCOUNTING_GEN is set, the > guest time is not accounted to guest time and user time, but instead to >

Re: [PATCH] KVM: PPC: Book3S HV: Fix guest time accounting with VIRT_CPU_ACCOUNTING_GEN

2018-03-04 Thread Paul Mackerras
On Fri, Mar 02, 2018 at 11:51:56AM +0100, Laurent Vivier wrote: > Since commit 8b24e69fc47e ("KVM: PPC: Book3S HV: Close race with testing > for signals on guest entry"), if CONFIG_VIRT_CPU_ACCOUNTING_GEN is set, the > guest time is not accounted to guest time and user time, but instead to >

Re: [PATCH 02/20] KVM: PPC: Book3S PR: Fix broken select due to misspelling

2018-02-04 Thread Paul Mackerras
On Mon, Feb 05, 2018 at 05:58:59AM +0100, Ulf Magnusson wrote: > On Mon, Feb 5, 2018 at 5:48 AM, Paul Mackerras <pau...@ozlabs.org> wrote: > > On Mon, Feb 05, 2018 at 02:21:14AM +0100, Ulf Magnusson wrote: > >> Commit 76d837a4c0f9 ("KVM: PPC: Book3S PR: Don't inclu

Re: [PATCH 02/20] KVM: PPC: Book3S PR: Fix broken select due to misspelling

2018-02-04 Thread Paul Mackerras
On Mon, Feb 05, 2018 at 05:58:59AM +0100, Ulf Magnusson wrote: > On Mon, Feb 5, 2018 at 5:48 AM, Paul Mackerras wrote: > > On Mon, Feb 05, 2018 at 02:21:14AM +0100, Ulf Magnusson wrote: > >> Commit 76d837a4c0f9 ("KVM: PPC: Book3S PR: Don't include SPAPR TCE code > &

Re: [PATCH 02/20] KVM: PPC: Book3S PR: Fix broken select due to misspelling

2018-02-04 Thread Paul Mackerras
RIES was > probably intended. > > Change PPC_SERIES to PPC_PSERIES. > > Discovered with the > https://github.com/ulfalizer/Kconfiglib/blob/master/examples/list_undefined.py > script. > > Signed-off-by: Ulf Magnusson <ulfali...@gmail.com> Acked-by: Paul Mackerras

Re: [PATCH 02/20] KVM: PPC: Book3S PR: Fix broken select due to misspelling

2018-02-04 Thread Paul Mackerras
RIES was > probably intended. > > Change PPC_SERIES to PPC_PSERIES. > > Discovered with the > https://github.com/ulfalizer/Kconfiglib/blob/master/examples/list_undefined.py > script. > > Signed-off-by: Ulf Magnusson Acked-by: Paul Mackerras Which tree is this series going into? Paul.

Re: [PATCH] KVM: PPC: Use seq_puts() in kvmppc_exit_timing_show()

2018-01-11 Thread Paul Mackerras
On Sun, Jan 07, 2018 at 10:18:08AM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 7 Jan 2018 10:07:36 +0100 > > A headline should be quickly put into a sequence. Thus use the > function "seq_puts" instead of "seq_printf" for this purpose. > >

Re: [PATCH] KVM: PPC: Use seq_puts() in kvmppc_exit_timing_show()

2018-01-11 Thread Paul Mackerras
On Sun, Jan 07, 2018 at 10:18:08AM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 7 Jan 2018 10:07:36 +0100 > > A headline should be quickly put into a sequence. Thus use the > function "seq_puts" instead of "seq_printf" for this purpose. > > This issue was detected by

Re: [PATCH] KVM: PPC: Book3S HV: Remove vcpu->arch.dec usage

2018-01-11 Thread Paul Mackerras
On Tue, Dec 19, 2017 at 03:56:24PM +0100, Alexander Graf wrote: > On Book3S in HV mode, we don't use the vcpu->arch.dec field at all. > Instead, all logic is built around vcpu->arch.dec_expires. > > So let's remove the one remaining piece of code that was setting it. > > Signed-off-by: Alexander

Re: [PATCH] KVM: PPC: Book3S HV: Remove vcpu->arch.dec usage

2018-01-11 Thread Paul Mackerras
On Tue, Dec 19, 2017 at 03:56:24PM +0100, Alexander Graf wrote: > On Book3S in HV mode, we don't use the vcpu->arch.dec field at all. > Instead, all logic is built around vcpu->arch.dec_expires. > > So let's remove the one remaining piece of code that was setting it. > > Signed-off-by: Alexander

Re: [PATCH] KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt()

2018-01-11 Thread Paul Mackerras
On Wed, Jan 10, 2018 at 05:04:39PM +1100, David Gibson wrote: > The KVM_PPC_ALLOCATE_HTAB ioctl(), implemented by kvmppc_alloc_reset_hpt() > is supposed to completely clear and reset a guest's Hashed Page Table (HPT) > allocating or re-allocating it if necessary. > > In the case where an HPT of

Re: [PATCH] KVM: PPC: Book3S HV: Always flush TLB in kvmppc_alloc_reset_hpt()

2018-01-11 Thread Paul Mackerras
On Wed, Jan 10, 2018 at 05:04:39PM +1100, David Gibson wrote: > The KVM_PPC_ALLOCATE_HTAB ioctl(), implemented by kvmppc_alloc_reset_hpt() > is supposed to completely clear and reset a guest's Hashed Page Table (HPT) > allocating or re-allocating it if necessary. > > In the case where an HPT of

Re: [PATCH 03/11] powerpc/64s: Simple RFI macro conversions

2018-01-08 Thread Paul Mackerras
On Mon, Jan 08, 2018 at 06:09:51PM +0100, Peter Zijlstra wrote: > On Tue, Jan 09, 2018 at 03:54:45AM +1100, Michael Ellerman wrote: > > diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S > > b/arch/powerpc/kvm/book3s_rmhandlers.S > > index 42a4b237df5f..34a5adeff084 100644 > > ---

Re: [PATCH 03/11] powerpc/64s: Simple RFI macro conversions

2018-01-08 Thread Paul Mackerras
On Mon, Jan 08, 2018 at 06:09:51PM +0100, Peter Zijlstra wrote: > On Tue, Jan 09, 2018 at 03:54:45AM +1100, Michael Ellerman wrote: > > diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S > > b/arch/powerpc/kvm/book3s_rmhandlers.S > > index 42a4b237df5f..34a5adeff084 100644 > > ---

Re: [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive()

2017-12-04 Thread Paul Mackerras
On Fri, Nov 24, 2017 at 07:38:13AM +1100, Benjamin Herrenschmidt wrote: > On Thu, 2017-11-23 at 10:06 +0100, Laurent Vivier wrote: > > This is needed to map kvmppc_xive_set_xive() behavior > > to kvmppc_xics_set_xive(). > > > > As we store the server, kvmppc_xive_get_xive() can return > > the

Re: [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive()

2017-12-04 Thread Paul Mackerras
On Fri, Nov 24, 2017 at 07:38:13AM +1100, Benjamin Herrenschmidt wrote: > On Thu, 2017-11-23 at 10:06 +0100, Laurent Vivier wrote: > > This is needed to map kvmppc_xive_set_xive() behavior > > to kvmppc_xics_set_xive(). > > > > As we store the server, kvmppc_xive_get_xive() can return > > the

Re: [PATCH v2 0/2] KVM: fixes for the kernel-hardening tree

2017-10-26 Thread Paul Mackerras
On Thu, Oct 26, 2017 at 03:45:45PM +0200, Paolo Bonzini wrote: > Four KVM ioctls (KVM_GET/SET_CPUID2 on x86, KVM_GET/SET_ONE_REG on > ARM and s390) directly access the kvm_vcpu_arch struct. Therefore, the > new usercopy hardening work in linux-next, which forbids copies from and > to slab objects

Re: [PATCH v2 0/2] KVM: fixes for the kernel-hardening tree

2017-10-26 Thread Paul Mackerras
On Thu, Oct 26, 2017 at 03:45:45PM +0200, Paolo Bonzini wrote: > Four KVM ioctls (KVM_GET/SET_CPUID2 on x86, KVM_GET/SET_ONE_REG on > ARM and s390) directly access the kvm_vcpu_arch struct. Therefore, the > new usercopy hardening work in linux-next, which forbids copies from and > to slab objects

Re: [PATCH] bitmap: Fix optimization of bitmap_set/clear for big-endian machines

2017-10-25 Thread Paul Mackerras
On Wed, Oct 25, 2017 at 07:39:48AM +, Matthew Wilcox wrote: > Hang on, don't tell me you found this by inspection. Are you not running the > bitmap testcase, enabled by CONFIG_TEST_BITMAP? Either that should be > producing an error, or there's a missing test case, or your inspection is >

Re: [PATCH] bitmap: Fix optimization of bitmap_set/clear for big-endian machines

2017-10-25 Thread Paul Mackerras
On Wed, Oct 25, 2017 at 07:39:48AM +, Matthew Wilcox wrote: > Hang on, don't tell me you found this by inspection. Are you not running the > bitmap testcase, enabled by CONFIG_TEST_BITMAP? Either that should be > producing an error, or there's a missing test case, or your inspection is >

Re: [PATCH] KVM: PPC: Book3S HV: Delete an error message for a failed memory allocation in kvmppc_allocate_hpt()

2017-10-18 Thread Paul Mackerras
On Thu, Oct 05, 2017 at 01:23:30PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Thu, 5 Oct 2017 13:16:51 +0200 > > Omit an extra message for a memory allocation failure in this function. > > This issue was detected by using the Coccinelle

Re: [PATCH] KVM: PPC: Book3S HV: Delete an error message for a failed memory allocation in kvmppc_allocate_hpt()

2017-10-18 Thread Paul Mackerras
On Thu, Oct 05, 2017 at 01:23:30PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Thu, 5 Oct 2017 13:16:51 +0200 > > Omit an extra message for a memory allocation failure in this function. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus

Re: [PATCH 1/10] KVM: PPC: Book3S HV: Use ARRAY_SIZE macro

2017-10-18 Thread Paul Mackerras
On Sun, Sep 03, 2017 at 02:19:31PM +0200, Thomas Meyer wrote: > Use ARRAY_SIZE macro, rather than explicitly coding some variant of it > yourself. > Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e > 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)

Re: [PATCH 1/10] KVM: PPC: Book3S HV: Use ARRAY_SIZE macro

2017-10-18 Thread Paul Mackerras
On Sun, Sep 03, 2017 at 02:19:31PM +0200, Thomas Meyer wrote: > Use ARRAY_SIZE macro, rather than explicitly coding some variant of it > yourself. > Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e > 's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)

Re: [PATCH 6/7] KVM: PPC: Cocci spatch "vma_pages"

2017-10-18 Thread Paul Mackerras
On Thu, Sep 21, 2017 at 12:29:36AM +0200, Thomas Meyer wrote: > Use vma_pages function on vma object instead of explicit computation. > Found by coccinelle spatch "api/vma_pages.cocci" > > Signed-off-by: Thomas Meyer Thanks, applied to my kvm-ppc-next branch, with the headline

Re: [PATCH 6/7] KVM: PPC: Cocci spatch "vma_pages"

2017-10-18 Thread Paul Mackerras
On Thu, Sep 21, 2017 at 12:29:36AM +0200, Thomas Meyer wrote: > Use vma_pages function on vma object instead of explicit computation. > Found by coccinelle spatch "api/vma_pages.cocci" > > Signed-off-by: Thomas Meyer Thanks, applied to my kvm-ppc-next branch, with the headline "KVM: PPC: BookE:

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-28 Thread Paul Mackerras
On Mon, Aug 28, 2017 at 06:28:08AM +0100, Al Viro wrote: > On Mon, Aug 28, 2017 at 02:38:37PM +1000, Paul Mackerras wrote: > > On Sun, Aug 27, 2017 at 10:02:20PM +0100, Al Viro wrote: > > > On Wed, Aug 23, 2017 at 04:06:24PM +1000, Paul Mackerras wrote: > > > > >

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-28 Thread Paul Mackerras
On Mon, Aug 28, 2017 at 06:28:08AM +0100, Al Viro wrote: > On Mon, Aug 28, 2017 at 02:38:37PM +1000, Paul Mackerras wrote: > > On Sun, Aug 27, 2017 at 10:02:20PM +0100, Al Viro wrote: > > > On Wed, Aug 23, 2017 at 04:06:24PM +1000, Paul Mackerras wrote: > > > > >

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-27 Thread Paul Mackerras
On Sun, Aug 27, 2017 at 10:02:20PM +0100, Al Viro wrote: > On Wed, Aug 23, 2017 at 04:06:24PM +1000, Paul Mackerras wrote: > > > It seems to me that it would be better to do the anon_inode_getfd() > > call before the kvm_get_kvm() call, and go to the fail label if it > &

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-27 Thread Paul Mackerras
On Sun, Aug 27, 2017 at 10:02:20PM +0100, Al Viro wrote: > On Wed, Aug 23, 2017 at 04:06:24PM +1000, Paul Mackerras wrote: > > > It seems to me that it would be better to do the anon_inode_getfd() > > call before the kvm_get_kvm() call, and go to the fail label if it > &

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-23 Thread Paul Mackerras
On Wed, Aug 23, 2017 at 01:43:08AM +, Nixiaoming wrote: > >On 22.08.2017 17:15, David Hildenbrand wrote: > >> On 22.08.2017 16:28, nixiaoming wrote: > >>> miss kfree(stt) when anon_inode_getfd return fail so add check > >>> anon_inode_getfd return val, and kfree stt > >>> > >>> Signed-off-by:

Re: Re: [PATCH] fix memory leak on kvm_vm_ioctl_create_spapr_tce

2017-08-23 Thread Paul Mackerras
On Wed, Aug 23, 2017 at 01:43:08AM +, Nixiaoming wrote: > >On 22.08.2017 17:15, David Hildenbrand wrote: > >> On 22.08.2017 16:28, nixiaoming wrote: > >>> miss kfree(stt) when anon_inode_getfd return fail so add check > >>> anon_inode_getfd return val, and kfree stt > >>> > >>> Signed-off-by:

Re: [PATCH 2/4] time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD

2017-06-21 Thread Paul Mackerras
On Tue, Jun 20, 2017 at 10:21:31PM -0700, John Stultz wrote: > CONFIG_GENERIC_TIME_VSYSCALL_OLD was introduced five years ago > to allow a transition from the old vsyscall implementations to > the new method (which simplified internal accounting and made > timekeeping more precise). > > However,

Re: [PATCH 2/4] time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD

2017-06-21 Thread Paul Mackerras
On Tue, Jun 20, 2017 at 10:21:31PM -0700, John Stultz wrote: > CONFIG_GENERIC_TIME_VSYSCALL_OLD was introduced five years ago > to allow a transition from the old vsyscall implementations to > the new method (which simplified internal accounting and made > timekeeping more precise). > > However,

[PATCH] powerpc: Convert VDSO update function to use new update_vsyscall interface

2017-05-27 Thread Paul Mackerras
8-bit arithmetic.) Signed-off-by: Paul Mackerras <pau...@ozlabs.org> --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/time.c | 68 +++--- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[PATCH] powerpc: Convert VDSO update function to use new update_vsyscall interface

2017-05-27 Thread Paul Mackerras
8-bit arithmetic.) Signed-off-by: Paul Mackerras --- arch/powerpc/Kconfig | 2 +- arch/powerpc/kernel/time.c | 68 +++--- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f7c8f99..8fe2dc7 1

Re: [RFC][PATCH] time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD

2017-05-25 Thread Paul Mackerras
On Mon, May 22, 2017 at 12:06:04PM -0700, John Stultz wrote: > > Basically long ago, timekeeping was handled (roughly) like: > > clock_gettime(): > now = tk->clock->read() > offset_ns = ((now - tk->cycle_last) * tk->clock->mult) >> > tk->clock->shift; > return

Re: [RFC][PATCH] time: Add warning about imminent deprecation of CONFIG_GENERIC_TIME_VSYSCALL_OLD

2017-05-25 Thread Paul Mackerras
On Mon, May 22, 2017 at 12:06:04PM -0700, John Stultz wrote: > > Basically long ago, timekeeping was handled (roughly) like: > > clock_gettime(): > now = tk->clock->read() > offset_ns = ((now - tk->cycle_last) * tk->clock->mult) >> > tk->clock->shift; > return

Re: [PATCH] KVM: Eliminate unused variable warning on uniprocessor configs

2017-05-12 Thread Paul Mackerras
On Thu, May 11, 2017 at 09:44:06AM +0200, Paolo Bonzini wrote: > > > On 11/05/2017 05:40, Paul Mackerras wrote: > > When the > > kernel is compiled with CONFIG_SMP=n, smp_call_function_many() turns > > into a macro which doesn't use the 'wait' argument, lea

Re: [PATCH] KVM: Eliminate unused variable warning on uniprocessor configs

2017-05-12 Thread Paul Mackerras
On Thu, May 11, 2017 at 09:44:06AM +0200, Paolo Bonzini wrote: > > > On 11/05/2017 05:40, Paul Mackerras wrote: > > When the > > kernel is compiled with CONFIG_SMP=n, smp_call_function_many() turns > > into a macro which doesn't use the 'wait' argument, lea

Re: [PATCH] KVM: Prevent double-free on HPT resize commit path

2017-02-28 Thread Paul Mackerras
On Tue, Feb 28, 2017 at 11:56:55AM +1100, David Gibson wrote: > On Wed, Feb 15, 2017 at 02:40:04PM +1100, David Gibson wrote: > > resize_hpt_release(), called once the HPT resize of a KVM guest is > > completed (successfully or unsuccessfully) free()s the state structure for > > the resize. It is

Re: [PATCH] KVM: Prevent double-free on HPT resize commit path

2017-02-28 Thread Paul Mackerras
On Tue, Feb 28, 2017 at 11:56:55AM +1100, David Gibson wrote: > On Wed, Feb 15, 2017 at 02:40:04PM +1100, David Gibson wrote: > > resize_hpt_release(), called once the HPT resize of a KVM guest is > > completed (successfully or unsuccessfully) free()s the state structure for > > the resize. It is

Re: [PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2017-01-31 Thread Paul Mackerras
On Wed, Feb 01, 2017 at 03:56:36PM +1100, David Gibson wrote: > On Wed, Feb 01, 2017 at 09:18:13AM +1100, Paul Mackerras wrote: > > On Tue, Dec 20, 2016 at 04:48:56PM +1100, David Gibson wrote: > > > Here is the KVM implementation for the proposed PAPR extension which > &

Re: [PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2017-01-31 Thread Paul Mackerras
On Wed, Feb 01, 2017 at 03:56:36PM +1100, David Gibson wrote: > On Wed, Feb 01, 2017 at 09:18:13AM +1100, Paul Mackerras wrote: > > On Tue, Dec 20, 2016 at 04:48:56PM +1100, David Gibson wrote: > > > Here is the KVM implementation for the proposed PAPR extension which > &

Re: [PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2017-01-31 Thread Paul Mackerras
On Tue, Dec 20, 2016 at 04:48:56PM +1100, David Gibson wrote: > Here is the KVM implementation for the proposed PAPR extension which > allows the runtime resizing of a PAPR guest's Hashed Page Table (HPT). > > Using this requires a guest kernel with support for the extension. > Patches for guest

Re: [PATCHv2 00/11] KVM implementation of PAPR HPT resizing extension

2017-01-31 Thread Paul Mackerras
On Tue, Dec 20, 2016 at 04:48:56PM +1100, David Gibson wrote: > Here is the KVM implementation for the proposed PAPR extension which > allows the runtime resizing of a PAPR guest's Hashed Page Table (HPT). > > Using this requires a guest kernel with support for the extension. > Patches for guest

Re: [PATCH] powerpc: Fix LPCR_VRMASD definition

2016-12-08 Thread Paul Mackerras
On Thu, Dec 08, 2016 at 11:29:30AM +0800, Jia He wrote: > Fixes: a4b349540a ("powerpc/mm: Cleanup LPCR defines") > Signed-off-by: Jia He <hejia...@gmail.com> Acked-by: Paul Mackerras <pau...@ozlabs.org>

Re: [PATCH] powerpc: Fix LPCR_VRMASD definition

2016-12-08 Thread Paul Mackerras
On Thu, Dec 08, 2016 at 11:29:30AM +0800, Jia He wrote: > Fixes: a4b349540a ("powerpc/mm: Cleanup LPCR defines") > Signed-off-by: Jia He Acked-by: Paul Mackerras

Re: [PATCH 00/10] vtime: Delay cputime accounting to tick

2016-12-05 Thread Paul Mackerras
On Tue, Dec 06, 2016 at 03:32:13AM +0100, Frederic Weisbecker wrote: > This follows up Martin Schwidefsky's patch which propose to delay > cputime accounting to the tick in order to minimize the calls to > account_system_time() and alikes as these functions can carry quite some > overhead: > >

Re: [PATCH 00/10] vtime: Delay cputime accounting to tick

2016-12-05 Thread Paul Mackerras
On Tue, Dec 06, 2016 at 03:32:13AM +0100, Frederic Weisbecker wrote: > This follows up Martin Schwidefsky's patch which propose to delay > cputime accounting to the tick in order to minimize the calls to > account_system_time() and alikes as these functions can carry quite some > overhead: > >

Re: [PATCH 0/2] Preliminary cleanups for HPT resizing

2016-11-23 Thread Paul Mackerras
On Wed, Nov 23, 2016 at 04:14:05PM +1100, David Gibson wrote: > Hi Paul, > > I'm still chasing this confusion about the CAS bit to send the real > HPT resizing patches. However, in the meantime, here are some > preliminary cleanups. > > These cleanups stand on their own, although I wrote them

Re: [PATCH 0/2] Preliminary cleanups for HPT resizing

2016-11-23 Thread Paul Mackerras
On Wed, Nov 23, 2016 at 04:14:05PM +1100, David Gibson wrote: > Hi Paul, > > I'm still chasing this confusion about the CAS bit to send the real > HPT resizing patches. However, in the meantime, here are some > preliminary cleanups. > > These cleanups stand on their own, although I wrote them

Re: [PATCH v2] powernv: Handle wakeup from idle due to SRESET

2016-11-22 Thread Paul Mackerras
On Tue, Nov 22, 2016 at 11:06:32PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > The existing code doesn't handle the case when CPU which was in a > hardware-idle state (nap,sleep,winkle on POWER8 and various stop > states on POWER9) gets woken up due

Re: [PATCH v2] powernv: Handle wakeup from idle due to SRESET

2016-11-22 Thread Paul Mackerras
On Tue, Nov 22, 2016 at 11:06:32PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > The existing code doesn't handle the case when CPU which was in a > hardware-idle state (nap,sleep,winkle on POWER8 and various stop > states on POWER9) gets woken up due to a System Reset

Re: [PATCH 2/4] cputime/powerpc: remove cputime_to_scaled()

2016-11-02 Thread Paul Mackerras
On Mon, Oct 31, 2016 at 01:36:27PM +0100, Stanislaw Gruszka wrote: > Currently cputime_to_scaled() just return it's argument on > all implementations, we don't need to call this function. > > Signed-off-by: Stanislaw Gruszka <sgrus...@redhat.com> Looks OK to me. Reviewed-by: P

Re: [PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-11-02 Thread Paul Mackerras
and cputime_to_scaled() just returns > the argument. > > Signed-off-by: Stanislaw Gruszka <sgrus...@redhat.com> Yes, I should have removed them in that commit. We don't want to do any scaling in the places where cputime_to_scaled() is used. Acked-by: Paul Mackerras <pau...@ozlabs.org>

Re: [PATCH 2/4] cputime/powerpc: remove cputime_to_scaled()

2016-11-02 Thread Paul Mackerras
On Mon, Oct 31, 2016 at 01:36:27PM +0100, Stanislaw Gruszka wrote: > Currently cputime_to_scaled() just return it's argument on > all implementations, we don't need to call this function. > > Signed-off-by: Stanislaw Gruszka Looks OK to me. Reviewed-by: Paul Mackerras

Re: [PATCH 1/4] cputime/powerpc: remove cputime_last_delta global variable

2016-11-02 Thread Paul Mackerras
and cputime_to_scaled() just returns > the argument. > > Signed-off-by: Stanislaw Gruszka Yes, I should have removed them in that commit. We don't want to do any scaling in the places where cputime_to_scaled() is used. Acked-by: Paul Mackerras

Re: [PATCH v2 2/3] cpuidle:powernv: Add helper function to populate powernv idle states.

2016-11-01 Thread Paul Mackerras
On Tue, Nov 01, 2016 at 07:32:58PM +1100, Oliver O'Halloran wrote: > On Thu, Oct 27, 2016 at 7:35 PM, Gautham R. Shenoy > wrote: > > From: "Gautham R. Shenoy" > > > > In the current code for powernv_add_idle_states, there is a lot of code > >

Re: [PATCH v2 2/3] cpuidle:powernv: Add helper function to populate powernv idle states.

2016-11-01 Thread Paul Mackerras
On Tue, Nov 01, 2016 at 07:32:58PM +1100, Oliver O'Halloran wrote: > On Thu, Oct 27, 2016 at 7:35 PM, Gautham R. Shenoy > wrote: > > From: "Gautham R. Shenoy" > > > > In the current code for powernv_add_idle_states, there is a lot of code > > duplication while initializing an idle state in

  1   2   3   4   5   6   7   8   9   10   >