[PATCH v8 1/6] KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments

2021-06-21 Thread Bharata B Rao
From: "Aneesh Kumar K.V" The type values H_RPTI_TYPE_PRT and H_RPTI_TYPE_PAT indicate invalidating the caching of process and partition scoped entries respectively. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch/powerpc/include/as

[PATCH v8 6/6] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-06-21 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas Reviewed

[PATCH v8 2/6] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-06-21 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch

[PATCH v8 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-06-21 Thread Bharata B Rao
invalidation requests are forwarded to the right nested guest, handled there and passed down to L0 for eventual handling. Signed-off-by: Bharata B Rao Signed-off-by: Aneesh Kumar K.V [Nested guest partition-scoped invalidation changes] --- .../include/asm/book3s/64/tlbflush-radix.h| 4

[PATCH v8 5/6] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability

2021-06-21 Thread Bharata B Rao
Now that we have H_RPT_INVALIDATE fully implemented, enable support for the same via KVM_CAP_PPC_RPT_INVALIDATE KVM capability Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- Documentation/virt/kvm/api.rst | 18 ++ arch/powerpc/kvm/powerpc.c | 3 +++ include

PowerPC guest getting "BUG: scheduling while atomic" on linux-next-20210623 during secondary CPUs bringup

2021-06-24 Thread Bharata B Rao
Hi, A PowerPC KVM guest gets the following BUG message when booting linux-next-20210623: smp: Bringing up secondary CPUs ... BUG: scheduling while atomic: swapper/1/0/0x no locks held by swapper/1/0. Modules linked in: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.13.0-rc7-next-20210623

Re: PowerPC guest getting "BUG: scheduling while atomic" on linux-next-20210623 during secondary CPUs bringup

2021-06-24 Thread Bharata B Rao
On Fri, Jun 25, 2021 at 11:16:08AM +0530, Srikar Dronamraju wrote: > * Bharata B Rao [2021-06-24 21:25:09]: > > > A PowerPC KVM guest gets the following BUG message when booting > > linux-next-20210623: > > > > smp: Bringing up secondary CPUs ... > > BUG:

Re: PowerPC guest getting "BUG: scheduling while atomic" on linux-next-20210623 during secondary CPUs bringup

2021-06-25 Thread Bharata B Rao
On Fri, Jun 25, 2021 at 09:28:09AM +0200, Peter Zijlstra wrote: > On Fri, Jun 25, 2021 at 11:16:08AM +0530, Srikar Dronamraju wrote: > > * Bharata B Rao [2021-06-24 21:25:09]: > > > > > A PowerPC KVM guest gets the following BUG message when booting > > > linu

Re: PowerPC guest getting "BUG: scheduling while atomic" on linux-next-20210623 during secondary CPUs bringup

2021-06-25 Thread Bharata B Rao
On Fri, Jun 25, 2021 at 12:16:52PM +0200, Peter Zijlstra wrote: > You mean: CONFIG_PREEMPTION=n, what about CONFIG_PREEMPT_COUNT? > > Because if both are =n, then I don't see how that warning could trigger. > in_atomic_preempt_off() would then result in prempt_count() == 0, and > per the print

Re: [PATCH v7 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-05-06 Thread Bharata B Rao
On Thu, May 06, 2021 at 03:45:21PM +1000, Nicholas Piggin wrote: > Excerpts from Bharata B Rao's message of May 6, 2021 1:46 am: > > > > +static long kvmppc_h_rpt_invalidate(struct kvm_vcpu *vcpu, > > + unsigned long id, unsigned long target, > > +

[RFC PATCH v0 1/1] powerpc/percpu: Use 2MB atom_size in percpu allocator on radix

2021-07-07 Thread Bharata B Rao
allocation). Signed-off-by: Bharata B Rao --- arch/powerpc/kernel/setup_64.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 1ff258f6c76c..45ce2d6e8112 100644 --- a/arch

Re: [PATCH] powerpc: preempt: Don't touch the idle task's preempt_count during hotplug

2021-07-08 Thread Bharata B Rao
would invoke init_idle() via > idle_thread_get(), which would have already reset the CPU's idle task's > preempt_count to PREEMPT_ENABLED. > > Get rid of this preempt_count write. > > Cc: Guenter Roeck > Fixes: f1a0a376ca0c ("sched/core: Initialize the idle task with preempti

Re: [RFC PATCH v0 1/1] powerpc/percpu: Use 2MB atom_size in percpu allocator on radix

2021-07-11 Thread Bharata B Rao
here for long, so was just checking if it makes sense here too. > > > > > Signed-off-by: Bharata B Rao > > --- > > arch/powerpc/kernel/setup_64.c | 34 +- > > 1 file changed, 25 insertions(+), 9 deletions(-) > > > >

Re: [PATCH v8 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-07-05 Thread Bharata B Rao
On Mon, Jul 05, 2021 at 02:42:33PM +1000, David Gibson wrote: > On Mon, Jun 21, 2021 at 02:20:00PM +0530, Bharata B Rao wrote: > > diff --git a/arch/powerpc/include/asm/mmu_context.h > > b/arch/powerpc/include/asm/mmu_context.h > > index 4bc45d3ed8b0..b44f291fc909 100644 &

[PATCH v7 1/6] KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments

2021-05-05 Thread Bharata B Rao
From: "Aneesh Kumar K.V" The type values H_RPTI_TYPE_PRT and H_RPTI_TYPE_PAT indicate invalidating the caching of process and partition scoped entries respectively. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch/powerpc/include/as

[PATCH v7 0/6] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-05-05 Thread Bharata B Rao
of H_RPT_INVALIDATE arguments Bharata B Rao (5): powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE KVM: PPC: Book3S HV: Add

[PATCH v7 2/6] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-05-05 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch

[PATCH v7 5/6] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability

2021-05-05 Thread Bharata B Rao
Now that we have H_RPT_INVALIDATE fully implemented, enable support for the same via KVM_CAP_PPC_RPT_INVALIDATE KVM capability Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- Documentation/virt/kvm/api.rst | 18 ++ arch/powerpc/kvm/powerpc.c | 3 +++ include

[PATCH v7 6/6] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-05-05 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas Reviewed

[PATCH v7 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-05-05 Thread Bharata B Rao
invalidation requests are forwarded to the right nested guest, handled there and passed down to L0 for eventual handling. Signed-off-by: Bharata B Rao Signed-off-by: Aneesh Kumar K.V [Nested guest partition-scoped invalidation changes] --- .../include/asm/book3s/64/tlbflush-radix.h| 4

[PATCH v7 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-05-05 Thread Bharata B Rao
nge are to be invalidated.   Those which are partially covered are considered outside invalidation range, which allows a caller to optimally invalidate ranges that may   contain mixed page sizes. * Return H_SUCCESS on success. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- arch/powerpc/incl

Re: [PATCH v6 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-03-22 Thread Bharata B Rao
On Tue, Mar 23, 2021 at 01:26:56PM +1100, David Gibson wrote: > On Thu, Mar 11, 2021 at 02:09:36PM +0530, Bharata B Rao wrote: > > H_RPT_INVALIDATE does two types of TLB invalidations: > > > > 1. Process-scoped invalidations for guests when LPCR[GTSE]=0. > >This i

[PATCH v6 3/6] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-03-11 Thread Bharata B Rao
nge are to be invalidated.   Those which are partially covered are considered outside invalidation range, which allows a caller to optimally invalidate ranges that may   contain mixed page sizes. * Return H_SUCCESS on success. Signed-off-by: Bharata B Rao --- .../include/asm/book3s/64/tlbflush-radi

[PATCH v6 1/6] KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments

2021-03-11 Thread Bharata B Rao
From: "Aneesh Kumar K.V" The type values H_RPTI_TYPE_PRT and H_RPTI_TYPE_PAT indicate invalidating the caching of process and partition scoped entries respectively. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 4 ++-- 1 file

[PATCH v6 2/6] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-03-11 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/book3s/64

[PATCH v6 5/6] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_RPT_INVALIDATE capability

2021-03-11 Thread Bharata B Rao
Now that we have H_RPT_INVALIDATE fully implemented, enable support for the same via KVM_CAP_PPC_RPT_INVALIDATE KVM capability Signed-off-by: Bharata B Rao --- Documentation/virt/kvm/api.rst | 18 ++ arch/powerpc/kvm/powerpc.c | 3 +++ include/uapi/linux/kvm.h | 1

[PATCH v6 0/6] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-03-11 Thread Bharata B Rao
Kumar K.V (1): KVM: PPC: Book3S HV: Fix comments of H_RPT_INVALIDATE arguments Bharata B Rao (5): powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

[PATCH v6 4/6] KVM: PPC: Book3S HV: Nested support in H_RPT_INVALIDATE

2021-03-11 Thread Bharata B Rao
invalidation requests are forwarded to the right nested guest, handled there and passed down to L0 for eventual handling. Signed-off-by: Bharata B Rao Signed-off-by: Aneesh Kumar K.V [Nested guest partition-scoped invalidation changes] --- arch/powerpc/include/asm/kvm_book3s.h | 3 + arch

[PATCH v6 6/6] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-03-11 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas --- arch/p

Re: [PATCH v5 1/3] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-03-01 Thread Bharata B Rao
On Tue, Mar 02, 2021 at 12:28:34PM +1100, David Gibson wrote: > On Wed, Feb 24, 2021 at 01:55:08PM +0530, Bharata B Rao wrote: > > Add a field to mmu_psize_def to store the page size encodings > > of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix &

Re: [PATCH v5 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-03-01 Thread Bharata B Rao
On Wed, Feb 24, 2021 at 12:58:02PM -0300, Fabiano Rosas wrote: > > @@ -1590,6 +1662,24 @@ static int kvmppc_handle_nested_exit(struct kvm_vcpu > > *vcpu) > > if (!xics_on_xive()) > > kvmppc_xics_rm_complete(vcpu, 0); > > break; > > + case

Re: [PATCH v5 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-03-01 Thread Bharata B Rao
On Tue, Mar 02, 2021 at 12:45:18PM +1100, David Gibson wrote: > > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst > > index 45fd862ac128..38ce3f21b21f 100644 > > --- a/Documentation/virt/kvm/api.rst > > +++ b/Documentation/virt/kvm/api.rst > > @@ -6225,6 +6225,24 @@

[PATCH v5 0/3] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-02-24 Thread Bharata B Rao
. - Redid nested exit changes as per Paul Mackerras' suggestion. - Folded the patch that added tlbie primitives into the hcall implementation patch. v4: https://lore.kernel.org/linuxppc-dev/20210215063542.3642366-1-bhar...@linux.ibm.com/T/#t Bharata B Rao (3): powerpc/book3s64/radix: Add

[PATCH v5 3/3] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-02-24 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas --- arch/p

[PATCH v5 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-02-24 Thread Bharata B Rao
-by: Bharata B Rao --- Documentation/virt/kvm/api.rst| 18 +++ .../include/asm/book3s/64/tlbflush-radix.h| 4 + arch/powerpc/include/asm/kvm_book3s.h | 3 + arch/powerpc/include/asm/mmu_context.h| 11 ++ arch/powerpc/kvm/book3s_hv.c | 90

[PATCH v5 1/3] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-02-24 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/book3s/64

[PATCH v4 3/3] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-02-14 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas --- arch/p

[PATCH v4 1/3] powerpc/book3s64/radix/tlb: tlbie primitives for process-scoped invalidations from guests

2021-02-14 Thread Bharata B Rao
hcall. While we are here, move RIC_FLUSH definitions to header file and introduce helper rpti_pgsize_to_psize() that will be needed by the upcoming hcall. Signed-off-by: Bharata B Rao --- .../include/asm/book3s/64/tlbflush-radix.h| 18 +++ arch/powerpc/mm/book3s64/radix_tlb.c | 122

[PATCH v4 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-02-14 Thread Bharata B Rao
H_TLB_INVALIDATE hcall. Signed-off-by: Bharata B Rao --- Documentation/virt/kvm/api.rst | 17 + arch/powerpc/include/asm/kvm_book3s.h | 3 + arch/powerpc/include/asm/mmu_context.h | 11 +++ arch/powerpc/kvm/book3s_hv.c | 91 arch/powerpc/kvm

[PATCH v4 0/3] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-02-14 Thread Bharata B Rao
nested guest exit path. v3: https://lore.kernel.org/linuxppc-dev/20210105090557.2150104-1-bhar...@linux.ibm.com/T/#t Bharata B Rao (3): powerpc/book3s64/radix/tlb: tlbie primitives for process-scoped invalidations from guests KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE KVM

Re: [PATCH v4 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-02-21 Thread Bharata B Rao
On Wed, Feb 17, 2021 at 11:38:07AM +1100, David Gibson wrote: > On Mon, Feb 15, 2021 at 12:05:41PM +0530, Bharata B Rao wrote: > > Implement H_RPT_INVALIDATE hcall and add KVM capability > > KVM_CAP_PPC_RPT_INVALIDATE to indicate the support for the same. > > > > This

Re: [PATCH v4 1/3] powerpc/book3s64/radix/tlb: tlbie primitives for process-scoped invalidations from guests

2021-02-21 Thread Bharata B Rao
On Wed, Feb 17, 2021 at 11:24:48AM +1100, David Gibson wrote: > On Mon, Feb 15, 2021 at 12:05:40PM +0530, Bharata B Rao wrote: > > H_RPT_INVALIDATE hcall needs to perform process scoped tlbie > > invalidations of L1 and nested guests from L0. This needs RS register > >

Re: [RFC PATCH v0 5/5] pseries: Asynchronous page fault support

2021-08-12 Thread Bharata B Rao
On Fri, Aug 13, 2021 at 02:06:40PM +1000, Nicholas Piggin wrote: > Excerpts from Bharata B Rao's message of August 5, 2021 5:24 pm: > > Add asynchronous page fault support for pseries guests. > > > > 1. Setup the guest to handle async-pf > >- Issue H_REG_SNS hcall to register the SNS region.

[RFC PATCH v0 4/5] KVM: PPC: BOOK3S HV: Async PF support

2021-08-05 Thread Bharata B Rao
fulfilled by host leading the long delays in guest. This needs some debugging. - A few other aspects recommended by PAPR around this feature(like setting of page state flags) need to be evaluated and incorporated into the implementation if found appropriate. Signed-off-by: Bharata B Rao

[RFC PATCH v0 5/5] pseries: Asynchronous page fault support

2021-08-05 Thread Bharata B Rao
reused here. TODO: - Check how to keep this feature together with other CMO features. - The async-pf check in the page fault handler path is limited to guest with an #ifdef. This isn't sufficient and hence needs to be replaced by an appropriate check. Signed-off-by: Bharata B Rao --- arch

[RFC PATCH v0 2/5] KVM: PPC: Add support for KVM_REQ_ESN_EXIT

2021-08-05 Thread Bharata B Rao
Add a new KVM exit request KVM_REQ_ESN_EXIT that will be used to exit to userspace (QEMU) whenever subvention notification needs to be sent to the guest. The userspace (QEMU) issues the subvention notification by injecting an interrupt into the guest. Signed-off-by: Bharata B Rao --- arch

[RFC PATCH v0 3/5] KVM: PPC: Book3S: Enable setting SRR1 flags for DSI

2021-08-05 Thread Bharata B Rao
to the guest. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_ppc.h | 3 ++- arch/powerpc/kvm/book3s.c | 6 +++--- arch/powerpc/kvm/book3s_64_mmu_radix.c | 6 +++--- arch/powerpc/kvm/book3s_hv.c | 4 ++-- arch/powerpc/kvm/book3s_hv_nested.c| 4 ++-- arch

[RFC PATCH v0 0/5] PPC: KVM: pseries: Asynchronous page fault

2021-08-05 Thread Bharata B Rao
. Bharata B Rao (5): powerpc: Define Expropriation interrupt bit to VPA byte offset 0xB9 KVM: PPC: Add support for KVM_REQ_ESN_EXIT KVM: PPC: Book3S: Enable setting SRR1 flags for DSI KVM: PPC: BOOK3S HV: Async PF support pseries: Asynchronous page fault support Documentation/virt/kvm/api.rst

[RFC PATCH v0 1/5] powerpc: Define Expropriation interrupt bit to VPA byte offset 0xB9

2021-08-05 Thread Bharata B Rao
VPA byte offset 0xB9 was named as donate_dedicated_cpu as that was the only used bit. The Expropriation/Subvention support defines a bit in byte offset 0xB9. Define this bit and rename the field in VPA to a generic name. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/lppaca.h | 8

Re: [RFC PATCH v0 0/5] PPC: KVM: pseries: Asynchronous page fault

2021-08-05 Thread Bharata B Rao
On Thu, Aug 05, 2021 at 12:54:34PM +0530, Bharata B Rao wrote: > Hi, > > This series adds asynchronous page fault support for pseries guests > and enables the support for the same in powerpc KVM. This is an > early RFC with details and multiple TODOs listed in patch descriptions.

<    1   2   3   4