Re: [PATCH] pseries: Make CPU hotplug path endian safe

2014-09-05 Thread Bharata B Rao
On Fri, Sep 5, 2014 at 7:38 PM, Nathan Fontenot wrote: > On 09/05/2014 04:16 AM, bharata@gmail.com wrote: >> From: Bharata B Rao >> >> - ibm,rtas-configure-connector should treat the RTAS data as big endian. >> - Treat ibm,ppc-interrupt-server#s

Re: [PATCH v2 2/2] pseries: Fix endian issues in cpu hot-removal

2014-09-14 Thread Bharata B Rao
On Sat, Sep 13, 2014 at 12:41 AM, Thomas Falcon wrote: > When removing a cpu, this patch makes sure that values > gotten from or passed to firmware are in the correct > endian format. > > Signed-off-by: Thomas Falcon > --- > Changes in v2: > > Followed suggestions from Michael Ellerman: >Con

Re: [PATCH] powerpc: use device_online/offline() instead of cpu_up/down()

2014-11-02 Thread Bharata B Rao
On Fri, Oct 31, 2014 at 03:41:34PM -0400, Dan Streetman wrote: > In powerpc pseries platform dlpar operations, Use device_online() and > device_offline() instead of cpu_up() and cpu_down(). > > Calling cpu_up/down directly does not update the cpu device offline > field, which is used to online/off

powerpc,numa: Memory hotplug to memory-less nodes ?

2015-06-21 Thread Bharata B Rao
Hi, While developing memory hotplug support in QEMU for PoweKVM, I realized that guest kernel has specific checks to prevent hot addition of memory to a memory-less node. I am referring to arch/powerpc/mm/numa.c:hot_add_scn_to_nid() which has explicit checks to ensure that it returns a nid that h

Re: powerpc,numa: Memory hotplug to memory-less nodes ?

2015-06-23 Thread Bharata B Rao
So will it be correct to say that memory hotplug to memory-less node isn't supported by PowerPC kernel ? Should I enforce the same in QEMU for PowerKVM ? On Mon, Jun 22, 2015 at 10:18 AM, Bharata B Rao wrote: > Hi, > > While developing memory hotplug support in QEMU for PoweKVM

Re: [RFC v0 PATCH] kvm: powerpc: Allow reuse of vCPU object

2015-03-15 Thread Bharata B Rao
Any feedback on the below patch ? On Mon, Mar 9, 2015 at 11:00 AM, wrote: > From: Bharata B Rao > > Since KVM isn't equipped to handle closure of vcpu fd from userspace(QEMU) > correctly, certain work arounds have to be employed to allow reuse of > vcpu array slot in KVM

[RFC FIX PATCH v0] powerpc,numa: Fix memory_hotplug_max()

2016-04-06 Thread Bharata B Rao
of converting spaces to tabs w/o which checkpatch.pl complains. Signed-off-by: Bharata B Rao --- arch/powerpc/mm/numa.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 669a15e..57d5877 100

Re: [RFC FIX PATCH v0] powerpc,numa: Fix memory_hotplug_max()

2016-04-09 Thread Bharata B Rao
On Fri, Apr 08, 2016 at 12:27:44AM -0500, Nathan Fontenot wrote: > On 04/06/2016 04:44 AM, Bharata B Rao wrote: > > memory_hotplug_max() uses hot_add_drconf_memory_max() to get maxmimum > > addressable memory by referring to ibm,dyanamic-memory property. There > > are th

Re: [RFC FIX PATCH v0] powerpc,numa: Fix memory_hotplug_max()

2016-04-18 Thread Bharata B Rao
On Sat, Apr 09, 2016 at 03:44:31PM +0530, Bharata B Rao wrote: > On Fri, Apr 08, 2016 at 12:27:44AM -0500, Nathan Fontenot wrote: > > On 04/06/2016 04:44 AM, Bharata B Rao wrote: > > > memory_hotplug_max() uses hot_add_drconf_memory_max() to get maxmimum > > > address

[PATCH FIX] powerpc/pseries: Release DRC when configure_connector fails

2015-09-04 Thread Bharata B Rao
From: Bharata B Rao dlpar_cpu_probe() should release the acquired DRC if configure_connector call fails. Signed-off-by: Bharata B Rao Cc: Nathan Fontenot --- arch/powerpc/platforms/pseries/dlpar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms

[FIX PATCH v1] powerpc/pseries: Release DRC when configure_connector fails

2015-09-07 Thread Bharata B Rao
From: Bharata B Rao Commit f32393c943e2 ("powerpc/pseries: Correct cpu affinity for dlpar added cpus") moved dlpar_acquire_drc() call to before dlpar_configure_connector() call in dlpar_cpu_probe(), but missed to release the DRC if dlpar_configure_connector() failed. During CPU h

Re: [FIX] powerpc/pseries: Release DRC when configure_connector fails

2015-09-07 Thread Bharata B Rao
On Mon, Sep 07, 2015 at 07:22:04PM +1000, Michael Ellerman wrote: > On Fri, 2015-04-09 at 10:04:12 UTC, Bharata B Rao wrote: > > From: Bharata B Rao > > > > dlpar_cpu_probe() should release the acquired DRC if configure_connector > > call fails. > > > &g

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-07 Thread Bharata B Rao
On Tue, Sep 08, 2015 at 04:08:06PM +1000, Michael Ellerman wrote: > On Wed, 2015-08-12 at 10:53 +0530, Bharata B Rao wrote: > > On Tue, Aug 11, 2015 at 03:48:26PM +0200, Andrea Arcangeli wrote: > > > Hello Bharata, > > > > > > On Tue, Aug 11, 2015 at 0

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-08 Thread Bharata B Rao
On Tue, Sep 08, 2015 at 09:59:47AM +0100, Dr. David Alan Gilbert wrote: > * Bharata B Rao (bhar...@linux.vnet.ibm.com) wrote: > > In fact I had successfully done postcopy migration of sPAPR guest with > > this setup. > > Interesting - I'd not got that far myself on powe

Re: [Qemu-devel] [PATCH 19/23] userfaultfd: activate syscall

2015-09-08 Thread Bharata B Rao
On Tue, Sep 08, 2015 at 01:46:52PM +0100, Dr. David Alan Gilbert wrote: > * Bharata B Rao (bhar...@linux.vnet.ibm.com) wrote: > > On Tue, Sep 08, 2015 at 09:59:47AM +0100, Dr. David Alan Gilbert wrote: > > > * Bharata B Rao (bhar...@linux.vnet.ibm.com) wrote: > > > &

[PATCH] powerpc/pseries: Provide verbose info about HPT resizing attempt

2019-04-10 Thread Bharata B Rao
shift 25 to 23 Unable to resize hash page table to target order 23: -28 Signed-off-by: Bharata B Rao --- arch/powerpc/platforms/pseries/lpar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c

Re: [PATCH] powerpc/pseries: Provide verbose info about HPT resizing attempt

2019-04-10 Thread Bharata B Rao
On Wed, Apr 10, 2019 at 08:20:53PM +1000, Michael Ellerman wrote: > Bharata B Rao writes: > > > When HPT resizing is attempted in response to memory hotplug, we see > > the following messages from the kernel: > > > > lpar: Attempting to resize HPT to shift 23 > &

Re: [PATCH 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-03-03 Thread Bharata B Rao
On Fri, Feb 28, 2020 at 11:36 AM Leonardo Bras wrote: > > While providing guests, it's desirable to resize it's memory on demand. > > By now, it's possible to do so by creating a guest with a small base > memory, hot-plugging all the rest, and using 'movable_node' kernel > command-line parameter,

Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Bharata B Rao
Hi, We are seeing an increased slab memory consumption on PowerPC guest LPAR (on PowerVM) having an uncommon topology where one NUMA node has no CPUs or any memory and the other node has all the CPUs and memory. Though QEMU prevents such topologies for KVM guest, I hacked QEMU to allow such topolo

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Bharata B Rao
On Tue, Mar 17, 2020 at 02:56:28PM +0530, Bharata B Rao wrote: > Case 1: 2 node NUMA, node0 empty > > # numactl -H > available: 2 nodes (0-1) > node 0 cpus: > node 0 size: 0 MB > node 0 free: 0 MB > node 1 cpus: 0 1 2 3 4 5 6 7 > node 1 s

Re: [PATCH 4/4] powerpc/numa: Set fallback nodes for offline nodes

2020-03-17 Thread Bharata B Rao
This patchset can also fix a related problem that I reported earlier at https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-March/206076.html with an additional change, suggested by Srikar as shown below: On Tue, Mar 17, 2020 at 06:47:53PM +0530, Srikar Dronamraju wrote: > Currently fallback node

Re: Slub: Increased mem consumption on cpu,mem-less node powerpc guest

2020-03-17 Thread Bharata B Rao
On Wed, Mar 18, 2020 at 08:50:44AM +0530, Srikar Dronamraju wrote: > * Vlastimil Babka [2020-03-17 17:45:15]: > > > On 3/17/20 5:25 PM, Srikar Dronamraju wrote: > > > * Vlastimil Babka [2020-03-17 16:56:04]: > > > > > >> > > >> I wonder why do you get a memory leak while Sachin in the same sit

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-18 Thread Bharata B Rao
On Wed, Mar 18, 2020 at 03:42:19PM +0100, Vlastimil Babka wrote: > This is a PowerPC platform with following NUMA topology: > > available: 2 nodes (0-1) > node 0 cpus: > node 0 size: 0 MB > node 0 free: 0 MB > node 1 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 > 25 26 2

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-19 Thread Bharata B Rao
On Thu, Mar 19, 2020 at 02:47:58PM +0100, Vlastimil Babka wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 17dc00e33115..7113b1f9cd77 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -1973,8 +1973,6 @@ static void *get_partial(struct kmem_cache *s, gfp_t > flags, int node, > > if (node =

Re: [RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

2020-03-20 Thread Bharata B Rao
On Fri, Mar 20, 2020 at 09:37:18AM +0100, Vlastimil Babka wrote: > On 3/20/20 4:42 AM, Bharata B Rao wrote: > > On Thu, Mar 19, 2020 at 02:47:58PM +0100, Vlastimil Babka wrote: > >> diff --git a/mm/slub.c b/mm/slub.c > >> index 17dc00e33115..7113b1f9cd77 100644 > &g

Re: [PATCH 2/2] KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN

2020-03-20 Thread Bharata B Rao
gt; > Move the setting of kvm->arch.secure_guest earlier in > kvmppc_h_svm_init_start() so in the return path, UV_RETURN will be called > instead of rfid. > > Cc: Bharata B Rao > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Michael Ellerman > Signed-off-by: Lau

Re: [PATCH 2/2] KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN

2020-03-22 Thread Bharata B Rao
On Fri, Mar 20, 2020 at 03:36:05PM +0100, Laurent Dufour wrote: > Le 20/03/2020 à 12:24, Bharata B Rao a écrit : > > On Fri, Mar 20, 2020 at 11:26:43AM +0100, Laurent Dufour wrote: > > > When the call to UV_REGISTER_MEM_SLOT is failing, for instance because > > > there

Re: [RFC PATCH v2 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-04-02 Thread Bharata B Rao
et your comments on this change, but it's still not > > ready for being merged. > > New flag got approved on the documentation. > Please review this patch. Looks good to me, also tested with PowerKVM guests. Reviewed-by: Bharata B Rao Regards, Bharata. -- http://raobharata.wordpress.com/

Re: [PATCH v3 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-04-03 Thread Bharata B Rao
lag and > marking memblocks as hotplugable memory is enough to get the desirable > behavior. > > This should cause no change if 'movable_node' parameter is not passed > in kernel command-line. > > Signed-off-by: Leonardo Bras > Reviewed-by: Bharata B Rao >

[RFC PATCH v0 1/5] powerpc/pseries/hotplug-memory: Set DRCONF_MEM_HOTREMOVABLE for hot-plugged mem

2020-04-05 Thread Bharata B Rao
In addition to setting DRCONF_MEM_HOTREMOVABLE for boot-time hot-plugged memory, we should set the same too for the memory that gets hot-plugged post-boot. This ensures that correct LMB flags value is reflected in ibm,dynamic-memory-vN property. Signed-off-by: Bharata B Rao --- arch/powerpc

[RFC PATCH v0 0/5] powerpc/mm/radix: Memory unplug fixes

2020-04-05 Thread Bharata B Rao
l.org/linuxppc-dev/f55a7b65a43cc9dc7b22385cf9960f8b11d5ce2e.ca...@linux.ibm.com/T/#t), a few other issues around memory unplug on radix can be fixed. This series is a combination of those fixes. This series works on top of above mentioned Leonardo's patch. Bharata B Rao (5): powerpc/pseri

[RFC PATCH v0 2/5] powerpc/mm/radix: Create separate mappings for hot-plugged memory

2020-04-05 Thread Bharata B Rao
iating hot-plugged memory from the boot time memory is now possible with PAPR extension to LMB flags. (Ref: https://lore.kernel.org/linuxppc-dev/f55a7b65a43cc9dc7b22385cf9960f8b11d5ce2e.ca...@linux.ibm.com/T/#t) Signed-off-by: Bharata B Rao --- arch/powerpc/mm/book3s64/radix_pgtable.c | 15

[RFC PATCH v0 3/5] powerpc/mm/radix: Fix PTE/PMD fragment count for early page table mappings

2020-04-05 Thread Bharata B Rao
M for vmemmap with struct page size being 64B. 1 PUD table for 2G memory (1G mapping) 1 PUD table and 1 PMD table for 2M vmemmap (2M mappings) With default PUD[PMD]_TABLE_SIZE(4K), (1+1+1)*4K=12K With new PAGE_SIZE(64K) table allocations, (1+1+1)*64K=192K Signed-off-by: Bharata B Rao --- arch/po

[RFC PATCH v0 5/5] powerpc/mm/radix: Remove split_kernel_mapping()

2020-04-05 Thread Bharata B Rao
;) Signed-off-by: Bharata B Rao --- arch/powerpc/mm/book3s64/radix_pgtable.c | 93 +--- 1 file changed, 19 insertions(+), 74 deletions(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 0d9ef3277579..56f2c698deac 100644

[RFC PATCH v0 4/5] powerpc/mm/radix: Free PUD table when freeing pagetable

2020-04-05 Thread Bharata B Rao
remove_pagetable() isn't freeing PUD table. This causes memory leak during memory unplug. Fix this. Signed-off-by: Bharata B Rao --- arch/powerpc/mm/book3s64/radix_pgtable.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-10-21 Thread Bharata B Rao
On Fri, Oct 18, 2019 at 8:31 AM Paul Mackerras wrote: > > On Wed, Sep 25, 2019 at 10:36:43AM +0530, Bharata B Rao wrote: > > Manage migration of pages betwen normal and secure memory of secure > > guest by implementing H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > >

Re: [PATCH v9 2/8] KVM: PPC: Move pages between normal and secure memory

2019-10-22 Thread Bharata B Rao
On Wed, Oct 23, 2019 at 03:17:54PM +1100, Paul Mackerras wrote: > On Tue, Oct 22, 2019 at 11:59:35AM +0530, Bharata B Rao wrote: > The mapping of pages in userspace memory, and the mapping of userspace > memory to guest physical space, are two distinct things. The memslots > describe

[PATCH v10 0/8] KVM: PPC: Driver to manage pages of secure guest

2019-11-03 Thread Bharata B Rao
ndencies required by this patchset are in powerpc/next on which this patchset is based upon. Outside of PowerPC code, this needs a change in KSM code as this patchset uses ksm_madvise() which is not exported. Anshuman Khandual (1): KVM: PPC: Ultravisor: Add PPC_UV config option Bharata B Rao (

[PATCH v10 1/8] mm: ksm: Export ksm_madvise()

2019-11-03 Thread Bharata B Rao
KVM PPC module needs ksm_madvise() for supporting secure guests. Guest pages that become secure are represented as device private pages in the host. Such pages shouldn't participate in KSM merging. Signed-off-by: Bharata B Rao --- mm/ksm.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v10 2/8] KVM: PPC: Support for running secure guests

2019-11-03 Thread Bharata B Rao
ma_pages() using UV_PAGE_IN and UV_PAGE_OUT ucalls. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 6 + arch/powerpc/include/asm/kvm_book3s_uvmem.h | 62 ++ arch/powerpc/include/asm/kvm_host.h | 6 + arch/powerpc/include/asm/ultravisor-api.h | 3

[PATCH v10 3/8] KVM: PPC: Shared pages support for secure guests

2019-11-03 Thread Bharata B Rao
the secure page is unmapped from the HV side page tables. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 3 ++ arch/powerpc/kvm/book3s_hv_uvmem.c | 85 -- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH v10 4/8] KVM: PPC: Radix changes for secure guest

2019-11-03 Thread Bharata B Rao
;t do so in case of secure VM. For secure guest, the active secondary page tables are in secure memory and the secondary page tables in HV are freed when guest becomes secure. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_book3s_uvmem.h | 6 arch/powerpc/include/asm/ultra

[PATCH v10 5/8] KVM: PPC: Handle memory plug/unplug to secure VM

2019-11-03 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. In addition, release all the device pages during unplug. Signed-off-by: Bharata B Rao Signed-off-by: Sukadev Bhattiprolu [Added skip_page_out arg to kvmppc_uvmem_drop_pages()] --- arch/powerpc

[PATCH v10 6/8] KVM: PPC: Support reset of secure guest

2019-11-03 Thread Bharata B Rao
sue UV_ESM call once again to switch to secure mode. Signed-off-by: Bharata B Rao Signed-off-by: Sukadev Bhattiprolu [Implementation of uv_svm_terminate() and its call from guest shutdown path] Signed-off-by: Ram Pai [Unpinning of VPA pages] --- Documentation/virt/k

[PATCH v10 7/8] KVM: PPC: Implement H_SVM_INIT_ABORT hcall

2019-11-03 Thread Bharata B Rao
ld be stuck in secure memory. Since the SVM did not go secure, its MSR_S bit will be clear and the VM wont be able to access its pages even to do a clean exit. Based on patches and discussion with Ram Pai and Bharata Rao. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Ram Pai Signed-off-by: Bhar

[PATCH v10 8/8] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-11-03 Thread Bharata B Rao
From: Anshuman Khandual CONFIG_PPC_UV adds support for ultravisor. Signed-off-by: Anshuman Khandual Signed-off-by: Bharata B Rao Signed-off-by: Ram Pai [ Update config help and commit message ] Signed-off-by: Claudio Carvalho Reviewed-by: Sukadev Bhattiprolu --- arch/powerpc/Kconfig | 17

Re: [PATCH v10 0/8] KVM: PPC: Driver to manage pages of secure guest

2019-11-05 Thread Bharata B Rao
On Wed, Nov 06, 2019 at 03:30:58PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:52AM +0530, Bharata B Rao wrote: > > > > Now, all the dependencies required by this patchset are in powerpc/next > > on which this patchset is based upon. > > Can you tell

Re: [PATCH v10 1/8] mm: ksm: Export ksm_madvise()

2019-11-05 Thread Bharata B Rao
On Wed, Nov 06, 2019 at 03:33:29PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:53AM +0530, Bharata B Rao wrote: > > KVM PPC module needs ksm_madvise() for supporting secure guests. > > Guest pages that become secure are represented as device private > > pa

Re: [PATCH v10 3/8] KVM: PPC: Shared pages support for secure guests

2019-11-06 Thread Bharata B Rao
On Wed, Nov 06, 2019 at 03:52:38PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:55AM +0530, Bharata B Rao wrote: > > A secure guest will share some of its pages with hypervisor (Eg. virtio > > bounce buffers etc). Support sharing of pages between hypervisor and

Re: [PATCH v10 3/8] KVM: PPC: Shared pages support for secure guests

2019-11-06 Thread Bharata B Rao
On Wed, Nov 06, 2019 at 01:52:39PM +0530, Bharata B Rao wrote: > > However, since kvmppc_gfn_is_uvmem_pfn() returned true, doesn't that > > mean that pfn here should be a device pfn, and in fact should be the > > same as uvmem_pfn (possibly with some extra bit(s) set)? >

Re: [PATCH v10 4/8] KVM: PPC: Radix changes for secure guest

2019-11-06 Thread Bharata B Rao
On Wed, Nov 06, 2019 at 04:58:23PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:56AM +0530, Bharata B Rao wrote: > > - After the guest becomes secure, when we handle a page fault of a page > > belonging to SVM in HV, send that page to UV via UV_PAGE_IN. > >

Re: [PATCH v10 6/8] KVM: PPC: Support reset of secure guest

2019-11-10 Thread Bharata B Rao
On Mon, Nov 11, 2019 at 04:28:06PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:58AM +0530, Bharata B Rao wrote: > > Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF. > > This ioctl will be issued by QEMU during reset and includes the > >

Re: [PATCH v10 6/8] KVM: PPC: Support reset of secure guest

2019-11-13 Thread Bharata B Rao
On Tue, Nov 12, 2019 at 04:34:34PM +1100, Paul Mackerras wrote: > On Mon, Nov 04, 2019 at 09:47:58AM +0530, Bharata B Rao wrote: > [snip] > > @@ -5442,6 +5471,64 @@ static int kvmhv_store_to_eaddr(struct kvm_vcpu > > *vcpu, ulong *eaddr, void *ptr,

Re: [PATCH v10 1/8] mm: ksm: Export ksm_madvise()

2019-11-15 Thread Bharata B Rao
On Thu, Nov 07, 2019 at 04:45:35PM +1100, Paul Mackerras wrote: > On Wed, Nov 06, 2019 at 12:15:42PM +0530, Bharata B Rao wrote: > > On Wed, Nov 06, 2019 at 03:33:29PM +1100, Paul Mackerras wrote: > > > On Mon, Nov 04, 2019 at 09:47:53AM +0530, Bharata B Rao wrote: > >

[PATCH v11 0/7] KVM: PPC: Driver to manage pages of secure guest

2019-11-24 Thread Bharata B Rao
reset, when we unpin VPA pages, make sure that no vcpu is running and fail the SVM_OFF ioctl if any are running (Paul Mackerras) - Dropped the patch that implemented init_abort hcall as it still has unresolved questions. Anshuman Khandual (1): KVM: PPC: Ultravisor: Add PPC_UV config option Bhar

[PATCH v11 1/7] mm: ksm: Export ksm_madvise()

2019-11-24 Thread Bharata B Rao
ernel module. Signed-off-by: Bharata B Rao Acked-by: Paul Mackerras Cc: Andrea Arcangeli Cc: Hugh Dickins --- mm/ksm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/ksm.c b/mm/ksm.c index dbee2eb4dd05..e45b02ad3f0b 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2478,6 +2478,7 @@ int ksm_ma

[PATCH v11 2/7] KVM: PPC: Support for running secure guests

2019-11-24 Thread Bharata B Rao
ma_pages() using UV_PAGE_IN and UV_PAGE_OUT ucalls. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 6 + arch/powerpc/include/asm/kvm_book3s_uvmem.h | 62 ++ arch/powerpc/include/asm/kvm_host.h | 6 + arch/powerpc/include/asm/ultravisor-api.h | 3

[PATCH v11 3/7] KVM: PPC: Shared pages support for secure guests

2019-11-24 Thread Bharata B Rao
the secure page is unmapped from the HV side page tables. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 3 ++ arch/powerpc/kvm/book3s_hv_uvmem.c | 85 -- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH v11 4/7] KVM: PPC: Radix changes for secure guest

2019-11-24 Thread Bharata B Rao
;t do so in case of secure VM. For secure guest, the active secondary page tables are in secure memory and the secondary page tables in HV are freed when guest becomes secure. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_book3s_uvmem.h | 6 arch/powerpc/include/asm/ultra

[PATCH v11 5/7] KVM: PPC: Handle memory plug/unplug to secure VM

2019-11-24 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. In addition, release all the device pages during unplug. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_book3s_uvmem.h | 6 arch/powerpc/include/asm/ultravisor-api.h | 1 + arch

[PATCH v11 6/7] KVM: PPC: Support reset of secure guest

2019-11-24 Thread Bharata B Rao
can be migrated back to secure side when guest becomes secure again. This is required because pinned pages can't be migrated. - Reinit the partition scoped page tables After these steps, guest is ready to issue UV_ESM call once again to switch to secure mode. Signed-off-by: Bharata

[PATCH v11 7/7] KVM: PPC: Ultravisor: Add PPC_UV config option

2019-11-24 Thread Bharata B Rao
From: Anshuman Khandual CONFIG_PPC_UV adds support for ultravisor. Signed-off-by: Anshuman Khandual Signed-off-by: Bharata B Rao Signed-off-by: Ram Pai [ Update config help and commit message ] Signed-off-by: Claudio Carvalho Reviewed-by: Sukadev Bhattiprolu --- arch/powerpc/Kconfig | 17

Re: [PATCH v11 1/7] mm: ksm: Export ksm_madvise()

2019-11-24 Thread Bharata B Rao
On Mon, Nov 25, 2019 at 08:36:25AM +0530, Bharata B Rao wrote: > On PEF-enabled POWER platforms that support running of secure guests, > secure pages of the guest are represented by device private pages > in the host. Such pages needn't participate in KSM merging. This is >

Re: [PATCH v11 1/7] mm: ksm: Export ksm_madvise()

2019-11-26 Thread Bharata B Rao
On Tue, Nov 26, 2019 at 07:59:49PM -0800, Hugh Dickins wrote: > On Mon, 25 Nov 2019, Bharata B Rao wrote: > > > On PEF-enabled POWER platforms that support running of secure guests, > > secure pages of the guest are represented by device private pages > > in the

Re: [PATCH v11 0/7] KVM: PPC: Driver to manage pages of secure guest

2019-11-27 Thread Bharata B Rao
On Mon, Nov 25, 2019 at 08:36:24AM +0530, Bharata B Rao wrote: > Hi, > > This is the next version of the patchset that adds required support > in the KVM hypervisor to run secure guests on PEF-enabled POWER platforms. > Here is a fix for the issue Hugh identified with the usage

Re: [PATCH v11 0/7] KVM: PPC: Driver to manage pages of secure guest

2019-12-03 Thread Bharata B Rao
On Sun, Dec 01, 2019 at 12:24:50PM -0800, Hugh Dickins wrote: > On Thu, 28 Nov 2019, Bharata B Rao wrote: > > On Mon, Nov 25, 2019 at 08:36:24AM +0530, Bharata B Rao wrote: > > > Hi, > > > > > > This is the next version of the patchset that adds required suppor

Re: [PATCH v3 1/1] powerpc/kernel: Enables memory hot-remove after reboot on pseries guests

2020-04-06 Thread Bharata B Rao
On Mon, Apr 06, 2020 at 12:41:01PM -0300, Leonardo Bras wrote: > Hello Bharata, > > On Fri, 2020-04-03 at 20:08 +0530, Bharata B Rao wrote: > > The patch would be more complete with the following change that ensures > > that DRCONF_MEM_HOTREMOVABLE flag is set for non

Re: [RFC PATCH v0 0/5] powerpc/mm/radix: Memory unplug fixes

2020-04-08 Thread Bharata B Rao
On Mon, Apr 06, 2020 at 09:19:20AM +0530, Bharata B Rao wrote: > Memory unplug has a few bugs which I had attempted to fix ealier > at https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-July/194087.html > > Now with Leonardo's patch for PAPR changes that add a separate flag b

[RFC PATCH v0 0/3] KVMPPC HMM driver to manage secure guest pages

2018-09-23 Thread Bharata B Rao
rds, Bharata. Bharata B Rao (3): kvmppc: HMM backend driver to manage pages of secure guest kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls kvmppc: Handle memory plug/unplug to secure VM arch/powerpc/include/asm/hvcall.h| 9 +- arch/powerpc/include/asm/kvm_host.h | 11 + arch/powe

[RFC PATCH v0 2/3] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2018-09-23 Thread Bharata B Rao
H_SVM_INIT_START: Initiate securing a VM H_SVM_INIT_DONE: Conclude securing a VM During early guest init, these hcalls will be issued by UV. As part of these hcalls, [un]register memslots with UV. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h| 4 ++- arch/powerpc

[RFC PATCH v0 1/3] kvmppc: HMM backend driver to manage pages of secure guest

2018-09-23 Thread Bharata B Rao
HMM driver for KVM PPC to manage page transitions of secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. H_SVM_PAGE_IN: Move the content of a normal page to secure page H_SVM_PAGE_OUT: Move the content of a secure page to normal page Signed-off-by: Bharata B Rao --- arch/powerpc/include

[RFC PATCH v0 3/3] kvmppc: Handle memory plug/unplug to secure VM

2018-09-23 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_ppc.h | 6 -- arch/powerpc/include/asm/ucall-api.h | 5 + arch/powerpc/kvm/book3s.c| 5 +++-- arch/powerpc/kvm

[RFC PATCH v1 0/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-10-21 Thread Bharata B Rao
in v1 = - Moved from global HMM pages hash table to per guest hash - Added support for shared pages (non-secure/normal pages of a secure guest) - Misc cleanups and fixes v0: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg138742.html Bharata B Rao (4): kvmppc: HMM back

[RFC PATCH v1 1/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-10-21 Thread Bharata B Rao
HMM driver for KVM PPC to manage page transitions of secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. H_SVM_PAGE_IN: Move the content of a normal page to secure page H_SVM_PAGE_OUT: Move the content of a secure page to normal page Signed-off-by: Bharata B Rao --- arch/powerpc/include

[RFC PATCH v1 2/4] kvmppc: Add support for shared pages in HMM driver

2018-10-21 Thread Bharata B Rao
A secure guest will share some of its pages with hypervisor (Eg. virtio bounce buffers etc). Support shared pages in HMM driver. Signed-off-by: Bharata B Rao --- arch/powerpc/kvm/book3s_hv_hmm.c | 69 ++-- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git

[RFC PATCH v1 3/4] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2018-10-21 Thread Bharata B Rao
H_SVM_INIT_START: Initiate securing a VM H_SVM_INIT_DONE: Conclude securing a VM During early guest init, these hcalls will be issued by UV. As part of these hcalls, [un]register memslots with UV. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h| 4 ++- arch/powerpc

[RFC PATCH v1 4/4] kvmppc: Handle memory plug/unplug to secure VM

2018-10-21 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_ppc.h | 6 -- arch/powerpc/include/asm/ucall-api.h | 5 + arch/powerpc/kvm/book3s.c| 5 +++-- arch/powerpc/kvm

Re: [RFC PATCH v1 1/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-11-12 Thread Bharata B Rao
On Tue, Oct 30, 2018 at 04:03:00PM +1100, Paul Mackerras wrote: > On Mon, Oct 22, 2018 at 10:48:34AM +0530, Bharata B Rao wrote: > > HMM driver for KVM PPC to manage page transitions of > > secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > > > H_SVM_PAG

Re: [RFC PATCH v1 2/4] kvmppc: Add support for shared pages in HMM driver

2018-11-12 Thread Bharata B Rao
On Tue, Oct 30, 2018 at 04:26:46PM +1100, Paul Mackerras wrote: > On Mon, Oct 22, 2018 at 10:48:35AM +0530, Bharata B Rao wrote: > > A secure guest will share some of its pages with hypervisor (Eg. virtio > > bounce buffers etc). Support shared pages in HMM driver. > > >

Re: [RFC PATCH v1 3/4] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2018-11-12 Thread Bharata B Rao
On Tue, Oct 30, 2018 at 04:29:57PM +1100, Paul Mackerras wrote: > On Mon, Oct 22, 2018 at 10:48:36AM +0530, Bharata B Rao wrote: > > H_SVM_INIT_START: Initiate securing a VM > > H_SVM_INIT_DONE: Conclude securing a VM > > > > During early guest init, these hcalls will b

Re: [RFC PATCH v1 1/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-11-12 Thread Bharata B Rao
On Thu, Nov 01, 2018 at 05:43:39PM +1100, Balbir Singh wrote: > On Mon, Oct 22, 2018 at 10:48:34AM +0530, Bharata B Rao wrote: > > HMM driver for KVM PPC to manage page transitions of > > secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > > > H_SVM_PAGE_IN: M

Re: [RFC PATCH v1 2/4] kvmppc: Add support for shared pages in HMM driver

2018-11-12 Thread Bharata B Rao
On Thu, Nov 01, 2018 at 09:45:52PM +1100, Balbir Singh wrote: > On Mon, Oct 22, 2018 at 10:48:35AM +0530, Bharata B Rao wrote: > > A secure guest will share some of its pages with hypervisor (Eg. virtio > > bounce buffers etc). Support shared pages in HMM driver. > > > &g

Re: [RFC PATCH v1 3/4] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2018-11-12 Thread Bharata B Rao
On Thu, Nov 01, 2018 at 09:49:26PM +1100, Balbir Singh wrote: > On Mon, Oct 22, 2018 at 10:48:36AM +0530, Bharata B Rao wrote: > > H_SVM_INIT_START: Initiate securing a VM > > H_SVM_INIT_DONE: Conclude securing a VM > > > > During early guest init, these hcalls will b

[RFC PATCH v2 0/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-11-20 Thread Bharata B Rao
in v2 = - Removed the HMM PFN hash table as the same information is now being stored in kvm_memory_slot->arch.rmap[] array as suggested by Paul Mackerras. - Addressed the review comments from v1. Bharata B Rao (4): kvmppc: HMM backend driver to manage pages of secure guest

[RFC PATCH v2 2/4] kvmppc: Add support for shared pages in HMM driver

2018-11-20 Thread Bharata B Rao
A secure guest will share some of its pages with hypervisor (Eg. virtio bounce buffers etc). Support shared pages in HMM driver. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 3 ++ arch/powerpc/kvm/book3s_hv_hmm.c | 58 +-- 2 files changed

[RFC PATCH v2 3/4] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2018-11-20 Thread Bharata B Rao
H_SVM_INIT_START: Initiate securing a VM H_SVM_INIT_DONE: Conclude securing a VM During early guest init, these hcalls will be issued by UV. As part of these hcalls, [un]register memslots with UV. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h| 2 ++ arch/powerpc

[RFC PATCH v2 4/4] kvmppc: Handle memory plug/unplug to secure VM

2018-11-20 Thread Bharata B Rao
Register the new memslot with UV during plug and unregister the memslot during unplug. This needs addition of kvm_mr_change argument to kvm_ops->commit_memory_region() Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_ppc.h | 6 -- arch/powerpc/include/asm/ucall-api.h |

[RFC PATCH v2 1/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-11-20 Thread Bharata B Rao
HMM driver for KVM PPC to manage page transitions of secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. H_SVM_PAGE_IN: Move the content of a normal page to secure page H_SVM_PAGE_OUT: Move the content of a secure page to normal page Signed-off-by: Bharata B Rao --- arch/powerpc/include

[RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Bharata B Rao
t the fragment count which is part of struct page. - When PMD or PTE page is freed, check if it comes from memblock allocator and free it appropriately. Reported-by: Srikanth Aithal Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/book3s/64/radix.h | 1 + arch/powerpc/includ

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Bharata B Rao
of PMD (and PGD as well) pages, > > allocate in page size PAGE_SIZE granularity so that we are > > sure that the complete page is available for us to set the > > fragment count which is part of struct page. > > - When PMD or PTE page is freed, check if it comes from membl

Re: [RFC PATCH v0] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-19 Thread Bharata B Rao
On Wed, Jun 19, 2019 at 02:36:54PM +0530, Aneesh Kumar K.V wrote: > Bharata B Rao writes: > > > We hit the following BUG_ON when memory hotplugged before reboot > > is unplugged after reboot: > > > > kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! > &g

[PATCH v1] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-23 Thread Bharata B Rao
ation requirement as early page table allocation is already using PAGE_SIZE PTE tables. So essentially with this change we would use 180 64K pages more for 64T system. Reported-by: Srikanth Aithal Signed-off-by: Bharata B Rao --- v0 - https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-June/192242

Re: [PATCH v4 1/6] kvmppc: HMM backend driver to manage pages of secure guest

2019-07-09 Thread Bharata B Rao
On Mon, Jun 17, 2019 at 03:31:06PM +1000, Paul Mackerras wrote: > On Tue, May 28, 2019 at 12:19:28PM +0530, Bharata B Rao wrote: > > HMM driver for KVM PPC to manage page transitions of > > secure guest via H_SVM_PAGE_IN and H_SVM_PAGE_OUT hcalls. > > > > H_SVM_PAG

Re: [PATCH v4 3/6] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-07-09 Thread Bharata B Rao
On Mon, Jun 17, 2019 at 03:37:56PM +1000, Paul Mackerras wrote: > On Tue, May 28, 2019 at 12:19:30PM +0530, Bharata B Rao wrote: > > H_SVM_INIT_START: Initiate securing a VM > > H_SVM_INIT_DONE: Conclude securing a VM > > > > As part of H_SVM_INIT_START register all ex

Re: [PATCH v4 3/6] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-07-09 Thread Bharata B Rao
On Tue, Jun 18, 2019 at 08:05:26PM -0300, Thiago Jung Bauermann wrote: > > Hello Bharata, > > Bharata B Rao writes: > > > diff --git a/arch/powerpc/include/asm/kvm_book3s_hmm.h > > b/arch/powerpc/include/asm/kvm_book3s_hmm.h > > index 21f3de5f2acb..3e13dab7f

Re: [RFC PATCH v4 6/6] kvmppc: Support reset of secure guest

2019-07-09 Thread Bharata B Rao
On Mon, Jun 17, 2019 at 02:06:32PM +1000, Paul Mackerras wrote: > On Tue, May 28, 2019 at 12:19:33PM +0530, Bharata B Rao wrote: > > Add support for reset of secure guest via a new ioctl KVM_PPC_SVM_OFF. > > This ioctl will be issued by QEMU during reset and in this ioctl, &

[PATCH v5 0/7] kvmppc: HMM driver to manage pages of secure guest

2019-07-09 Thread Bharata B Rao
config option Bharata B Rao (6): kvmppc: HMM backend driver to manage pages of secure guest kvmppc: Shared pages support for secure guests kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls kvmppc: Handle memory plug/unplug to secure VM kvmppc: Radix changes for secure guest kvmppc: Su

[PATCH v5 1/7] kvmppc: HMM backend driver to manage pages of secure guest

2019-07-09 Thread Bharata B Rao
memory available in the platform for running secure guests is created via a HMM device. The movement of pages between normal and secure memory is done by ->alloc_and_copy() callback routine of migrate_vma(). Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 4 + a

[PATCH v5 2/7] kvmppc: Shared pages support for secure guests

2019-07-09 Thread Bharata B Rao
A secure guest will share some of its pages with hypervisor (Eg. virtio bounce buffers etc). Support shared pages in HMM driver. Once a secure page is converted to shared page, HMM driver will stop tracking that page. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/hvcall.h | 3

[PATCH v5 3/7] kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls

2019-07-09 Thread Bharata B Rao
STARTED and transition to secure mode COMPLETED) are recorded in kvm->arch.secure_guest. Setting these states will cause the assembly code that enters the guest to call the UV_RETURN ucall instead of trying to enter the guest directly. Signed-off-by: Bharata B Rao Acked-by: Paul Mackerras --- a

  1   2   3   4   >