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 nf...@linux.vnet.ibm.com wrote: On 09/05/2014 04:16 AM, bharata@gmail.com wrote: From: Bharata B Rao bhar...@linux.vnet.ibm.com - 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-15 Thread Bharata B Rao
On Sat, Sep 13, 2014 at 12:41 AM, Thomas Falcon tlfal...@linux.vnet.ibm.com 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 tlfal...@linux.vnet.ibm.com --- Changes in v2:

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/offline

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, bharata@gmail.com wrote: From: Bharata B Rao bhar...@linux.vnet.ibm.com 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

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

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 bharata@gmail.com wrote: Hi, While developing memory hotplug support in QEMU for PoweKVM

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

2015-09-04 Thread Bharata B Rao
From: Bharata B Rao <bhar...@linux.vnet.ibm.com> dlpar_cpu_probe() should release the acquired DRC if configure_connector call fails. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> Cc: Nathan Fontenot <nf...@linux.vnet.ibm.com> --- arch/powerpc/platforms/pseries/d

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

2015-09-07 Thread Bharata B Rao
From: Bharata B Rao <bhar...@linux.vnet.ibm.com> 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_co

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 <bhar...@linux.vnet.ibm.com> > > > > dlpar_cpu_probe() should release the acquired DRC if configure_connector > >

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

2015-09-08 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 power; I

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: > > > &

Re: [FIX PATCH v2 0/2] Fix powerpc,numa: Fix memory_hotplug_max()

2016-06-13 Thread Bharata B Rao
On Tue, Jun 14, 2016 at 03:19:27PM +1000, Michael Ellerman wrote: > On Tue, 2016-06-14 at 10:16 +0530, Bharata B Rao wrote: > > On Thu, May 12, 2016 at 07:04:13PM +0530, Bharata B Rao wrote: > > > This patchset fixes memory_hotplug_max() routine to return correct >

Re: [FIX PATCH v2 0/2] Fix powerpc,numa: Fix memory_hotplug_max()

2016-06-13 Thread Bharata B Rao
On Thu, May 12, 2016 at 07:04:13PM +0530, Bharata B Rao wrote: > This patchset fixes memory_hotplug_max() routine to return correct > value of maximum hotpluggable address. > > In this version, whitespace fixes are separated into a different patch. > > v2: https://www.mail-ar

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

2016-04-06 Thread Bharata B Rao
ting spaces to tabs w/o which checkpatch.pl complains. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- 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 ind

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 > &g

[FIX PATCH v2 2/2] powerpc,numa: Fix memory_hotplug_max()

2016-05-12 Thread Bharata B Rao
. This patch fixes 1 by using ibm,lrdr-capacity property to return the max addressable memory whenever the property is present. Then it fixes 2 & 3 by fetching the address of the last LMB in ibm,dynamic-memory property. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/

[FIX PATCH v2 0/2] Fix powerpc,numa: Fix memory_hotplug_max()

2016-05-12 Thread Bharata B Rao
This patchset fixes memory_hotplug_max() routine to return correct value of maximum hotpluggable address. In this version, whitespace fixes are separated into a different patch. v2: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg103342.html Bharata B Rao (2): powerpc,numa: Fix

[FIX PATCH v2 1/2] powerpc, numa: Fix whitespace in hot_add_drconf_memory_max()

2016-05-12 Thread Bharata B Rao
Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/mm/numa.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 669a15e..4a87ccb 100644 --- a/arch/powerpc/mm/numa.c +++

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

2016-05-12 Thread Bharata B Rao
ting spaces to tabs w/o which checkpatch.pl complains. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- Changes in v1 - - Return 0 from hot_add_drconf_memory_max() when ibm,dynamic-reconfiguration-memory node isn't available. This restores the existing behaviour

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

Re: [PATCH V3 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-08-17 Thread Bharata B Rao
On Tue, Aug 2, 2016 at 6:12 AM, Michael Bringmann wrote: > Firmware Features: Define new bit flags representing the presence of > new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". > These flags are used to tell the front end processor when the Linux

[FIX PATCH v1] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-08 Thread Bharata B Rao
00bbe0] ret_from_kernel_thread+0x5c/0x7c Fix this by ensuring that of_node_put() is called only from the error path in dlpar_cpu_remove_by_index(). In the normal path, of_node_put() happens as part of dlpar_detach_node(). Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> Cc: Nathan

Re: [FIX PATCH v1] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-13 Thread Bharata B Rao
On Thu, Mar 09, 2017 at 01:34:00PM -0800, Tyrel Datwyler wrote: > On 03/08/2017 08:37 PM, Bharata B Rao wrote: > > The following warning is seen when a CPU is hot unplugged on a PowerKVM > > guest: > > Is this the case with cpus present at boot? What about cpus hotplugged

[FIX PATCH] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-08 Thread Bharata B Rao
00bbe0] ret_from_kernel_thread+0x5c/0x7c Fix this by ensuring that of_node_put() is called only from the error path in dlpar_cpu_remove_by_index(). In the normal path, of_node_put() happens as part of dlpar_detach_node(). Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> Cc: Nathan

[FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest

2017-08-10 Thread Bharata B Rao
LMB size as 16MB. Hence we end up creating separate mappings at much lower granularity than what we can ideally do for pseries machine. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/kernel/prom.c | 1 + arch/powerpc/mm/pgtable-radix.c | 17 ++

Re: [FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest

2017-08-17 Thread Bharata B Rao
On Fri, Aug 11, 2017 at 02:12:04PM +0530, Aneesh Kumar K.V wrote: > Bharata B Rao <bhar...@linux.vnet.ibm.com> writes: > > > For a PowerKVM guest, it is possible to specify a DIMM device in > > addition to the system RAM at boot time. When such a cold plugged DIMM &g

Memory hotplug broken on powerkvm/pseries with CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y

2017-05-19 Thread Bharata B Rao
Hi, Memory hotplug for a pseries guest on PowerKVM fails with the following error when CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y in the guest kernel. (I am on commit b23afd384801) [root@localhost ~]# pseries-hotplug-mem: Attempting to hot-add 4 LMB(s) at index 8020 removing memory fails,

Re: [FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest

2017-09-04 Thread Bharata B Rao
On Fri, Sep 01, 2017 at 09:11:18AM -0500, Nathan Fontenot wrote: > On 09/01/2017 01:53 AM, Bharata B Rao wrote: > > On Thu, Aug 10, 2017 at 02:53:48PM +0530, Bharata B Rao wrote: > >> For a PowerKVM guest, it is possible to specify a DIMM device in > >> addition to

Re: [FIX PATCH v0] powerpc: Fix memory unplug failure on radix guest

2017-09-01 Thread Bharata B Rao
On Thu, Aug 10, 2017 at 02:53:48PM +0530, Bharata B Rao wrote: > For a PowerKVM guest, it is possible to specify a DIMM device in > addition to the system RAM at boot time. When such a cold plugged DIMM > device is removed from a radix guest, we hit the following warning in the >

Re: [PATCH v2 0/8] powerpc: Support ibm,dynamic-memory-v2 property

2017-11-16 Thread Bharata B Rao
On Thu, Nov 16, 2017 at 9:31 PM, Nathan Fontenot <nf...@linux.vnet.ibm.com> wrote: > > > On 11/15/2017 11:37 PM, Bharata B Rao wrote: > > On Fri, Oct 20, 2017 at 6:51 PM, Nathan Fontenot < > nf...@linux.vnet.ibm.com <mailto:nf...@linux.vnet.ibm.com>> wrote:

Re: [PATCH v2 0/8] powerpc: Support ibm,dynamic-memory-v2 property

2017-11-15 Thread Bharata B Rao
On Fri, Oct 20, 2017 at 6:51 PM, Nathan Fontenot wrote: > This patch set provides a set of updates to de-couple the LMB information > provided in the ibm,dynamic-memory device tree property from the device > tree property format. A part of this patch series introduces a

Re: [RFC FIX v1 1/2] powerpc: Discover radix availability before scanning the memory nodes

2018-01-08 Thread Bharata B Rao
On Sat, Jan 06, 2018 at 10:28:00AM +1100, Michael Ellerman wrote: > Bharata B Rao <bhar...@linux.vnet.ibm.com> writes: > > > Currently device tree nodes for memory are scanned before the > > radix feature is discovered in mmu_early_init_devtree(). Move this > > ro

[RFC FIX v1 1/2] powerpc: Discover radix availability before scanning the memory nodes

2018-01-05 Thread Bharata B Rao
Currently device tree nodes for memory are scanned before the radix feature is discovered in mmu_early_init_devtree(). Move this routine ahead of scanning memory nodes so that we know if the guest is radix or not when scanning ibm,dynamic-reconfiguration-memory. Signed-off-by: Bharata B Rao <b

[RFC FIX v1 2/2] powerpc: Fix memory unplug failure on radix guest

2018-01-05 Thread Bharata B Rao
separate mappings at much lower granularity than what we can ideally do for pseries machine. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/kernel/prom.c | 2 ++ arch/powerpc/mm/pgtable-radix.c | 17 ++--- 2 files changed, 16 insertions(+), 3 del

[RFC FIX v1 0/2] powerpc: Fix memory unplug failure for radix guests

2018-01-05 Thread Bharata B Rao
only if the guest is radix. v0: http://patchwork.ozlabs.org/patch/800142/ Bharata B Rao (2): powerpc: Discover radix availability before scanning the memory nodes powerpc: Fix memory unplug failure on radix guest arch/powerpc/kernel/prom.c | 6 -- arch/powerpc/mm/pgtable-radix.c | 17

Re: [RFC] powerpc/mm/pgtable: Split mappings on hot-unplug

2018-02-01 Thread Bharata B Rao
On Fri, Feb 2, 2018 at 8:38 AM, Balbir Singh wrote: > On Thu, Feb 1, 2018 at 11:48 PM, Balbir Singh > wrote: > > This patch splits the a linear mapping if the hot-unplug range > > is smaller than the mapping size. The code detects if the mapping > >

[RFC PATCH v0 2/2] powerpc, drmem: Rename DRMEM_LMB_RESERVED to DRMEM_LMB_ISOLATED

2018-02-21 Thread Bharata B Rao
DRMEM_LMB_RESERVED and DRCONF_MEM_RESERVED operate on the same LMB flags word, rename the former to DRMEM_LMB_ISOLATED. Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/include/asm/drmem.h| 14 - arch/powerpc/mm/drmem.c | 2 +- arch/p

Re: [RFC PATCH v0 1/2] powerpc, drmem: Fix unexpected flag value in ibm, dynamic-memory-v2

2018-02-21 Thread Bharata B Rao
On Wed, Feb 21, 2018 at 10:48:18PM +1100, Michael Ellerman wrote: > Bharata B Rao <bhar...@linux.vnet.ibm.com> writes: > > > Memory addtion and removal by count and indexed-count methods > > temporarily mark the LMBs that are being added/removed by a special > >

Re: [RFC PATCH v0 0/2] ibm,dynamic-memory-v2 fix

2018-02-21 Thread Bharata B Rao
On Wed, Feb 21, 2018 at 11:27:20PM +1100, Balbir Singh wrote: > On Wed, Feb 21, 2018 at 9:36 PM, Bharata B Rao > <bhar...@linux.vnet.ibm.com> wrote: > > Patch 1 fixes a bug that results in unexpected flag bit in > > ibm,dynamic-memory-v2 DT property and wrong number of ent

[RFC PATCH v0 1/2] powerpc, drmem: Fix unexpected flag value in ibm, dynamic-memory-v2

2018-02-21 Thread Bharata B Rao
LMBs should be defined by one entry here. Fix this by always accessing the flags by its accessor method drmem_lmb_flags(). Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/mm/drmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/p

[RFC PATCH v0 0/2] ibm,dynamic-memory-v2 fix

2018-02-21 Thread Bharata B Rao
to even more appropriate name. Bharata B Rao (2): powerpc,drmem: Fix unexpected flag value in ibm,dynamic-memory-v2 powerpc,drmem: Rename DRMEM_LMB_RESERVED to DRMEM_LMB_ISOLATED arch/powerpc/include/asm/drmem.h| 14 - arch/powerpc/mm/drmem.c | 8

Hotplug + Reboot is crashing HPT guest with HPT resizing enabled

2018-02-23 Thread Bharata B Rao
Hi, Rebooting a hash guest after hotplugging memory to it is crashing the guest. This is seen only when HPT resizing is enabled. I see guest crashing at multiple places, but this location is fairly commonly seen: kernel BUG at mm/slub.c:3912! Testing with latest guest kernel and ppc-for-2.12

Re: Hotplug + Reboot is crashing HPT guest with HPT resizing enabled

2018-03-02 Thread Bharata B Rao
On Fri, Mar 2, 2018 at 7:51 AM, David Gibson <da...@gibson.dropbear.id.au> wrote: > On Fri, Feb 23, 2018 at 03:02:40PM +0530, Bharata B Rao wrote: > > Hi, > > > > Rebooting a hash guest after hotplugging memory to it is crashing the > > guest. This is seen only wh

[FIX PATCH] powerpc/pseries: Fix vector5 in ibm architecture vector table

2018-03-06 Thread Bharata B Rao
. Fixes: 02ef6dd8109b5 (powerpc: Enable support for ibm,drc-info devtree property) Fixes: c7a3275e0f9e4 (powerpc/pseries: Revert support for ibm,drc-info devtree property) Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- arch/powerpc/kernel/prom_init.c | 1 - 1 file changed, 1 de

[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

[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 0/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-10-21 Thread Bharata B Rao
ges 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 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

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

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

[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 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 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 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 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 v2 0/4] kvmppc: HMM backend driver to manage pages of secure guest

2018-11-20 Thread Bharata B Rao
ges 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 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 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

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

2019-02-18 Thread Bharata B Rao
On Tue, Feb 19, 2019 at 02:21:40PM +1100, Paul Mackerras wrote: > On Wed, Jan 30, 2019 at 11:37:25AM +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 v3 1/4] kvmppc: HMM backend driver to manage pages of secure guest

2019-01-29 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 v3 0/4] kvmppc: HMM backend driver to manage pages of secure guest

2019-01-29 Thread Bharata B Rao
ppc-dev/2018-November/181669.html Bharata B Rao (4): kvmppc: HMM backend driver to manage pages of secure guest kvmppc: Add support for shared pages in HMM driver kvmppc: H_SVM_INIT_START and H_SVM_INIT_DONE hcalls kvmppc: Handle memory plug/unplug to secure VM arch/powerpc/include/asm/hvcal

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

2019-01-29 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 v3 4/4] kvmppc: Handle memory plug/unplug to secure VM

2019-01-29 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/ucall-api.h| 7 +++ arch/powerpc/include/uapi/asm/uapi_uvcall.h | 1 + arch/powerpc/kvm/book3s_hv.c| 19

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

2019-01-29 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

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

2019-04-10 Thread Bharata B Rao
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 index

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

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

2019-05-28 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

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

2019-05-28 Thread Bharata B Rao
019-January/184731.html 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 gu

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

2019-05-28 Thread Bharata B Rao
. After these steps, guest is ready to issue 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] --- arch/powerpc/include/asm/kvm_host.h

[PATCH v4 2/6] kvmppc: Shared pages support for secure guests

2019-05-28 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

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

2019-05-28 Thread Bharata B Rao
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 existing memslots with the UV. H_SVM_INIT_DONE call by UV informs HV that transition of the guest to secure mode is complete. Signed-off-by: Bharata B Rao --- arch/powerpc

[PATCH v4 4/6] kvmppc: Handle memory plug/unplug to secure VM

2019-05-28 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/ultravisor-api.h | 1 + arch/powerpc/include/asm/ultravisor.h | 7 +++ arch/powerpc/kvm/book3s_hv.c | 19 +++ 3

[RFC PATCH v4 5/6] kvmppc: Radix changes for secure guest

2019-05-28 Thread Bharata B Rao
- 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. - Whenever a page is unmapped on the HV side, inform UV via UV_PAGE_INVAL. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/kvm_host.h | 13

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

2019-06-19 Thread Bharata B Rao
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/include/asm

[PATCH] powerpc/pseries: Switch to GFP_ATOMIC allocations in hotplug interrupt handler

2019-06-12 Thread Bharata B Rao
queue_hotplug_event() gets called from interrupt handler code. Use GFP_ATOMIC allocations instead of GFP_KERNEL. Signed-off-by: Bharata B Rao --- arch/powerpc/platforms/pseries/dlpar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/dlpar.c

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

2019-06-19 Thread Bharata B Rao
d 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 memblock > &

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-24 Thread Bharata B Rao
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.html

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-18 Thread Bharata B Rao
On Thu, May 16, 2019 at 07:44:20PM +0530, srikanth wrote: > Hello, > > On power9 host, performing memory hotunplug from ppc64le guest results in > kernel oops. > > Kernel used : https://github.com/torvalds/linux/tree/v5.1 built using > ppc64le_defconfig for host and ppc64le_guest_defconfig for

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-19 Thread Bharata B Rao
On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: > >> > git bisect points to > >> > > >> > commit 4231aba000f5a4583dd9f67057aadb68c3eca99d > >> > Author: Nicholas Piggin > >> > Date: Fri Jul 27 21:48:17 2018 +1000 > >> > > >> > powerpc/64s: Fix page table fragment refcount

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-19 Thread Bharata B Rao
On Mon, May 20, 2019 at 12:02:23PM +1000, Michael Ellerman wrote: > Bharata B Rao writes: > > On Thu, May 16, 2019 at 07:44:20PM +0530, srikanth wrote: > >> Hello, > >> > >> On power9 host, performing memory hotunplug from ppc64le guest results in > >>

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > Bharata B Rao's on May 20, 2019 3:56 pm: > > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: > >> >> > git bisect points to > >> >> > > >> >> > commit 4231aba000f5a4583dd9f67057aadb68c3eca99d > >> >> > Author:

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: > On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > > Bharata B Rao's on May 20, 2019 3:56 pm: > > > On Mon, May 20, 2019 at 02:48:35PM +1000, Nicholas Piggin wrote: > > &

Re: PROBLEM: Power9: kernel oops on memory hotunplug from ppc64le guest

2019-05-20 Thread Bharata B Rao
On Tue, May 21, 2019 at 12:55:49AM +1000, Nicholas Piggin wrote: > Bharata B Rao's on May 21, 2019 12:29 am: > > On Mon, May 20, 2019 at 01:50:35PM +0530, Bharata B Rao wrote: > >> On Mon, May 20, 2019 at 05:00:21PM +1000, Nicholas Piggin wrote: > >> > Bharata B

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

2019-07-10 Thread Bharata B Rao
On Wed, Jul 10, 2019 at 10:47:34AM -0300, Jason Gunthorpe wrote: > On Tue, Jul 09, 2019 at 01:55:28PM -0500, janani wrote: > > > > +int kvmppc_hmm_init(void) > > > +{ > > > + int ret = 0; > > > + unsigned long size; > > > + > > > + size = kvmppc_get_secmem_size(); > > > + if (!size) { > > > +

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_SV

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

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

2019-07-09 Thread Bharata B Rao
ig 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: Supp

[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

[RFC PATCH v5 5/7] kvmppc: Radix changes for secure guest

2019-07-09 Thread Bharata B Rao
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_host.h | 12 arch/powerpc/include/asm

  1   2   3   4   >