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

2020-12-14 Thread Paul Mackerras
ARNING: 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
d 't' is missing 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 def

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 > 'kvmppc_radix_s

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 > f

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 s

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 arch/powerpc/include

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

2020-07-22 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 a

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

2020-07-20 Thread Paul Mackerras
grate 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 t

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 Ultrav

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. > > arch/powerpc/kvm/bo

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
7; parameters at the same time. This > 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 a

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

2020-05-25 Thread Paul Mackerras
ia Zhang This looks fine. I assume each 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 > ‘kvmppc_mmu_book3s_32_xlate_pte

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-22 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 thi

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 ultravisor

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
PPIOCDETACH 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 Acked-by: Paul Mackerras

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

2018-05-16 Thread Paul Mackerras
48: 7c 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 returns a > > VM_FAULT v

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 > arch/power

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 > system

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
C_PSERIES 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. > > This issue was detected by using

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 th

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 > > --- a/arch/powerpc/kv

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 good

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 > w

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 El

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 "KVM: PPC: BookE:

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

2017-08-27 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-22 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-20 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, P

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

2017-05-27 Thread Paul Mackerras
se 128-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..8fe2

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 timespec_add_ns(tk->xti

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

2017-05-11 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' ar

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 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 s

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 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 in

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 interrupt

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
heck 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 > > duplication while initializing an idle state in powern

Re: [PATCH 0/6] KVM: PPC: e500: Fine-tuning for two function implementations

2016-09-11 Thread Paul Mackerras
On Sun, Aug 28, 2016 at 07:09:57PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 28 Aug 2016 19:01:02 +0200 > > Several update suggestions were taken into account > from static source code analysis. > > Markus Elfring (6): > Use kmalloc_array() in kvm_vcpu_ioctl_config_tl

Re: [PATCH v2] powerpc: move hmi.c to arch/powerpc/kvm/

2016-09-11 Thread Paul Mackerras
rather than CONFIG_PPC_BOOK3S_64. The sibling_subcore_state is also > included in struct paca_struct only if KVM is supported by the kernel. > > Cc: Daniel Axtens > Cc: Michael Ellerman > Cc: Mahesh Salgaonkar > Cc: Paul Mackerras > Cc: linuxppc-...@lists.ozlabs.org >

Re: [PATCH 6/6] KVM: PPC: e500: Rename jump labels in kvmppc_e500_tlb_init()

2016-09-11 Thread Paul Mackerras
On Sun, Aug 28, 2016 at 07:19:22PM +0200, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 28 Aug 2016 18:45:26 +0200 > > Adjust jump labels according to the current Linux coding style convention. > > Signed-off-by: Markus Elfring With this I get a compile error: CC arch/po

Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot

2016-08-04 Thread Paul Mackerras
On Thu, Aug 04, 2016 at 10:24:04AM +0100, Mel Gorman wrote: > Paul Mackerras and Reza Arbab reported that machines with memoryless nodes > fails when vmstats are refreshed. Paul reported an oops as follows > > [1.713998] Unable to handle kernel paging request for dat

Crashes in refresh_zone_stat_thresholds when some nodes have no memory

2016-08-03 Thread Paul Mackerras
crashing on machines which have memoryless nodes by checking for non-NULL pgdat->per_cpu_nodestats. Signed-off-by: Paul Mackerras --- diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 6137719..48b2780 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h @@ -184,8 +1

Re: [PATCH] powerpc: inline current_stack_pointer()

2016-05-24 Thread Paul Mackerras
On Mon, May 23, 2016 at 07:17:38PM +0200, Gabriel Paubert wrote: > On Mon, May 23, 2016 at 10:46:02AM +0200, Christophe Leroy wrote: > > current_stack_pointeur() is a single instruction function. it > > It is not worth breaking the execution flow with a bl/blr for a > > single instruction > > Are

Re: [PATCH v2 7/9] powerpc/powernv: Add platform support for stop instruction

2016-05-19 Thread Paul Mackerras
On Tue, May 03, 2016 at 01:54:36PM +0530, Shreyas B. Prabhu wrote: > POWER ISA v3 defines a new idle processor core mechanism. In summary, > a) new instruction named stop is added. This instruction replaces > instructions like nap, sleep, rvwinkle. > b) new per thread SPR named PSSCR is add

Re: [PATCH v2 2/9] powerpc/kvm: make hypervisor state restore a function

2016-05-19 Thread Paul Mackerras
any unusual exit conditions, but if there are any they should be documented too. Reviewed-by: Paul Mackerras

Re: [PATCH v2 2/3] /dev/dax, core: file operations and dax-mmap

2016-05-18 Thread Paul Mackerras
On Wed, May 18, 2016 at 10:07:19AM +0200, Hannes Reinecke wrote: > On 05/18/2016 12:19 AM, Dan Williams wrote: > > On Tue, May 17, 2016 at 3:57 AM, Johannes Thumshirn > > wrote: > >> On Sat, May 14, 2016 at 11:26:29PM -0700, Dan Williams wrote: > >>> The "Device DAX" core enables dax mappings of

Re: [PATCH v2] kvm-pr: manage single-step mode

2016-05-11 Thread Paul Mackerras
On Fri, Apr 08, 2016 at 06:05:00PM +0200, Laurent Vivier wrote: > Until now, when we connect gdb to the QEMU gdb-server, the > single-step mode is not managed. > > This patch adds this, only for kvm-pr: > > If KVM_GUESTDBG_SINGLESTEP is set, we enable single-step trace bit in the > MSR (MSR_SE) j

Regression in v4.6-rc due to SCSI multipath change

2016-05-03 Thread Paul Mackerras
Current upstream kernels fail to boot on my POWER8 server with multipath SCSI disks and IPR host bus adapters. What happens is that the system finds each disk twice (as normal) and then prints messages like this: [2.827761] sd 1:2:4:0: alua: supports implicit TPGS [2.827875] sd 1:2:4:0: a

Re: [PATCH 1/3] powerpc/powernv: Move CHECK_HMI_INTERRUPT to exception-64s header

2016-03-20 Thread Paul Mackerras
On Mon, Feb 29, 2016 at 05:52:58PM +0530, Shreyas B. Prabhu wrote: > CHECK_HMI_INTERRUPT is used to check for HMI's in reset vector. Move > the macro to a common location (exception-64s.h) > This patch does not change any functionality. Comments below... > diff --git a/arch/powerpc/include/asm/ex

Re: [PATCH 2/3] powerpc/powernv: Encapsulate idle preparation steps in a macro

2016-03-19 Thread Paul Mackerras
On Mon, Feb 29, 2016 at 05:52:59PM +0530, Shreyas B. Prabhu wrote: > Before entering any idle state which can result in a state loss > we currently save the context in the stack before entering idle. > Encapsulate these steps in a macro IDLE_STATE_PREP. Move this > and other macros to commonly acce

Re: [PATCH 2/3] powerpc/powernv: Encapsulate idle preparation steps in a macro

2016-03-18 Thread Paul Mackerras
On Fri, Mar 18, 2016 at 08:23:24PM +0530, Shreyas B Prabhu wrote: > Hi Paul, > > On 03/17/2016 04:45 PM, Paul Mackerras wrote: > > On Mon, Feb 29, 2016 at 05:52:59PM +0530, Shreyas B. Prabhu wrote: > >> Before entering any idle state which can result in a state loss &g

Re: [kernel] powerpc: Make vmalloc_to_phys() public

2016-01-25 Thread Paul Mackerras
On Mon, Jan 25, 2016 at 04:46:03PM +1100, Michael Ellerman wrote: > On Thu, 2016-21-01 at 07:35:08 UTC, Alexey Kardashevskiy wrote: > > This makes vmalloc_to_phys() public as there will be another user > > (in-kernel VFIO acceleration) for it soon. > > > > As a part of future little optimization,

Bad backport of "net: Fix skb_set_peeked use-after-free bug" in 3.18.23

2015-12-13 Thread Paul Mackerras
Commit d9a1133495b4 ("net: Fix skb_set_peeked use-after-free bug") in 3.18.23 claims to be a backport of commit a0a2a6602496, but in fact the patch is identical to commit 738ac1ebb96d ("net: Clone skb before setting peeked flag"), which is the commit that introduces the use-after-free bug that a0a2

Re: [PATCH] kvm: remove unused variable 'vcpu_book3s'

2015-12-09 Thread Paul Mackerras
On Tue, Dec 01, 2015 at 08:42:10PM -0300, Geyslan G. Bem wrote: > The vcpu_book3s struct is assigned but never used. So remove it. > > Signed-off-by: Geyslan G. Bem Thanks, applied to my kvm-ppc-next branch. Paul. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the

Re: [PATCH kernel] rcu: Define lockless version of list_for_each_entry_rcu

2015-12-07 Thread Paul Mackerras
On Sat, Dec 05, 2015 at 06:19:46PM -0800, Paul E. McKenney wrote: > > As in the following? (And yes, I was confused by the fact that the > docbook header was in front of a differently-named macro!) > > Thanx, Paul That looks great! Have you

Re: [PATCH kernel] rcu: Define lockless version of list_for_each_entry_rcu

2015-11-29 Thread Paul Mackerras
On Wed, Nov 18, 2015 at 11:13:28AM -0800, Paul E. McKenney wrote: > On Fri, Nov 06, 2015 at 01:17:17PM +1100, Alexey Kardashevskiy wrote: [snip] > > Still, is my approach correct? What does the comment for > > lockless_dereference() actally mean - it won't work together with > > RCU at all or this

Re: [RFC] kvm - possible out of bounds

2015-11-29 Thread Paul Mackerras
On Sun, Nov 29, 2015 at 05:14:03PM -0300, Geyslan Gregório Bem wrote: > Hello, > > I have found a possible out of bounds reading in > arch/powerpc/kvm/book3s_64_mmu.c (kvmppc_mmu_book3s_64_xlate > function). pteg[] array could be accessed twice using the i variable > after the for iteration. What

Re: [PATCH tip/locking/core v4 1/6] powerpc: atomic: Make *xchg and *cmpxchg a full barrier

2015-10-25 Thread Paul Mackerras
On Wed, Oct 21, 2015 at 10:18:33AM +0200, Peter Zijlstra wrote: > On Tue, Oct 20, 2015 at 02:28:35PM -0700, Paul E. McKenney wrote: > > I am not seeing a sync there, but I really have to defer to the > > maintainers on this one. I could easily have missed one. > > So x86 implies a full barrier fo

Re: [PATCH v3 2/4] KVM: use simple waitqueue for vcpu->wq

2015-10-21 Thread Paul Mackerras
On Tue, Oct 20, 2015 at 04:00:31PM +0200, Peter Zijlstra wrote: > > Should we not take this opportunity to get rid of these open-coded wait > loops? > > > Does this work? No, on Book3S HV (POWER8) the VM hangs immediately after the kernel brings up all the secondary vCPUs, and is then unkillabl

Re: [PATCH v3 2/4] KVM: use simple waitqueue for vcpu->wq

2015-10-21 Thread Paul Mackerras
On Tue, Oct 20, 2015 at 04:00:31PM +0200, Peter Zijlstra wrote: > @@ -2018,17 +2017,9 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) > } while (single_task_running() && ktime_before(cur, stop)); > } > > - for (;;) { > - prepare_to_wait(&vcpu->wq, &wait, TASK_IN

Re: [PATCH v3 2/4] KVM: use simple waitqueue for vcpu->wq

2015-10-21 Thread Paul Mackerras
On Tue, Oct 20, 2015 at 04:00:31PM +0200, Peter Zijlstra wrote: > On Tue, Oct 20, 2015 at 09:28:08AM +0200, Daniel Wagner wrote: > > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c > > index 2280497..f534e15 100644 > > --- a/arch/powerpc/kvm/book3s_hv.c > > +++ b/arch/power

Re: [PATCH 15/19] KVM: PPC: e500: fix handling local_sid_lookup result

2015-10-14 Thread Paul Mackerras
On Thu, Sep 24, 2015 at 04:00:23PM +0200, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 >

Re: [PATCH] powerpc: define empty enable_kernel_vsx() when CONFIG_VSX=n

2015-09-08 Thread Paul Mackerras
On Tue, Sep 08, 2015 at 12:13:11PM -0600, tim.gard...@canonical.com wrote: > From: Tim Gardner > > commit 72cd7b44bc99 ("powerpc: Uncomment and make enable_kernel_vsx() > routine available") neglected to define an empty inline replacement for > enable_kernel_vsx() when CONFIG_VSX=n. If code that

Re: [RFC PATCH v2] memory-barriers: remove smp_mb__after_unlock_lock()

2015-08-31 Thread Paul Mackerras
On Thu, Jul 16, 2015 at 03:14:55PM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2015-07-16 at 15:03 +1000, Benjamin Herrenschmidt wrote: > > On Thu, 2015-07-16 at 12:00 +1000, Michael Ellerman wrote: > > > That would fix the problem with smp_mb__after_unlock_lock(), but not > > > the original wor

Re: [PATCH] vfio: Enable VFIO device for powerpc

2015-08-26 Thread Paul Mackerras
On Wed, Aug 26, 2015 at 11:34:26AM +0200, Alexander Graf wrote: > > > On 13.08.15 03:15, David Gibson wrote: > > ec53500f "kvm: Add VFIO device" added a special KVM pseudo-device which is > > used to handle any necessary interactions between KVM and VFIO. > > > > Currently that device is built o

Re: linux-next: manual merge of the kvm-ppc tree with the tip tree

2015-08-26 Thread Paul Mackerras
Hi Stephen, On Mon, Aug 24, 2015 at 03:59:54PM +1000, Stephen Rothwell wrote: > Hi Alexander, > > Today's linux-next merge of the kvm-ppc tree got a conflict in: > > arch/powerpc/kvm/book3s_hv.c > > between commit: > > c56dadf39761 ("sched/preempt, powerpc, kvm: Use need_resched() instead

Re: [PATCH] kvm:powerpc:Fix return statements for wrapper functions in the file book3s_64_mmu_hv.c

2015-08-20 Thread Paul Mackerras
On Mon, Aug 10, 2015 at 11:27:31AM -0400, Nicholas Krause wrote: > This fixes the wrapper functions kvm_umap_hva_hv and the function > kvm_unmap_hav_range_hv to return the return value of the function > kvm_handle_hva or kvm_handle_hva_range that they are wrapped to > call internally rather then al

Re: [PATCH RESEND v4 3/3] kvm/powerpc: Export HCALL reason codes

2015-06-14 Thread Paul Mackerras
On Mon, Jun 15, 2015 at 10:26:09AM +0530, Hemant Kumar wrote: > For perf to analyze the KVM events like hcalls, we need the > hypervisor calls and their codes to be exported through uapi. Why? The hcall codes are defined externally to the kernel (in the PAPR document) and won't change. They're n

Re: [PATCH RESEND v4 1/3] kvm/powerpc: Export kvm exit reasons

2015-06-14 Thread Paul Mackerras
On Mon, Jun 15, 2015 at 10:26:07AM +0530, Hemant Kumar wrote: > To analyze the kvm exits with perf, we will need to map the exit codes > with the exit reasons. Such a mapping exists today in trace_book3s.h. > Currently its not exported to perf. > > This patch moves these kvm exit reasons and their

[tip:perf/core] perf: Remove myself from MAINTAINERS entry

2015-05-28 Thread tip-bot for Paul Mackerras
Commit-ID: 09a216ea5c528356797dc12ab35234922a6c02be Gitweb: http://git.kernel.org/tip/09a216ea5c528356797dc12ab35234922a6c02be Author: Paul Mackerras AuthorDate: Thu, 28 May 2015 16:17:57 +1000 Committer: Ingo Molnar CommitDate: Thu, 28 May 2015 10:43:03 +0200 perf: Remove myself from

[PATCH] perf: Remove myself from MAINTAINERS entry

2015-05-27 Thread Paul Mackerras
I haven't been working on perf for a while, so remove my name from the MAINTAINERS entry for it. Signed-off-by: Paul Mackerras --- diff --git a/MAINTAINERS b/MAINTAINERS index 781e099..cd37cb1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7604,7 +7604,6 @@ F:kernel/delaya

  1   2   3   4   5   6   7   >