Re: [Qemu-devel] [RFC PATCH v1 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info

2015-06-15 Thread Bharata B Rao
On Mon, Jun 15, 2015 at 11:17:59AM +0200, Igor Mammedov wrote: > On Fri, 12 Jun 2015 14:30:26 +0530 > Bharata B Rao wrote: > > > Start storing the (start_addr, size, nodeid) of the pc-dimm memory > > in numa_info so that this information can be used to lookup > > node

[Qemu-devel] [PATCH v5 0/7] sPAPR CPU hotplug pre-requisites

2015-06-15 Thread Bharata B Rao
separate patch. - Dropped the last patch "xics_kvm: Add cpu_destroy method to XICS" since it wasn't being used in this series. v4 - http://lists.nongnu.org/archive/html/qemu-devel/2015-06/msg01653.html This series applies against spapr-next branch of David Gibson's tree. Bharat

[Qemu-devel] [PATCH v5 2/7] spapr: Support ibm, lrdr-capacity device tree property

2015-06-15 Thread Bharata B Rao
. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- docs/specs/ppc-spapr-hotplug.txt | 18 ++ hw/ppc/spapr_rtas.c | 16 include/hw/ppc/spapr.h | 2 ++ 3 files changed, 36 insertions(+) diff --git a/docs/specs/ppc-spapr-hotplug.txt b

[Qemu-devel] [PATCH v5 5/7] spapr: Consolidate cpu init code into a routine

2015-06-15 Thread Bharata B Rao
Factor out bits of sPAPR specific CPU initialization code into a separate routine so that it can be called from CPU hotplug path too. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 54 +- 1 file changed, 29 insertions(+), 25 deletions

[Qemu-devel] [PATCH v5 1/7] spapr: Consider max_cpus during xics initialization

2015-06-15 Thread Bharata B Rao
Use max_cpus instead of smp_cpus when intializating xics system. Also report max_cpus in ibm,interrupt-server-ranges device tree property of interrupt controller node. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc

[Qemu-devel] [PATCH v5 3/7] cpus: Add a macro to walk CPUs in reverse

2015-06-15 Thread Bharata B Rao
Add CPU_FOREACH_REVERSE that walks CPUs in reverse. Needed for PowerPC CPU device tree reorganization. Signed-off-by: Bharata B Rao Reviewed-by: Andreas Färber --- include/qom/cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 39f0f19

[Qemu-devel] [PATCH v5 7/7] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled

2015-06-15 Thread Bharata B Rao
hange allows CPU hot removal to work for sPAPR. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/intc/xics_kvm.c| 10 ++ include/hw/ppc/xics.h | 1 + 2 files changed, 11 insertions(+) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index ea886da..d58729c 100644 ---

[Qemu-devel] [PATCH v5 6/7] ppc: Update cpu_model in MachineState

2015-06-15 Thread Bharata B Rao
Keep cpu_model field in MachineState uptodate so that it can be used from the CPU hotplug path. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/ppc/mac_newworld.c | 10 +- hw/ppc/mac_oldworld.c | 7 +++ hw/ppc/ppc440_bamboo.c | 7 +++ hw/ppc/prep.c

[Qemu-devel] [PATCH v5 4/7] spapr: Reorganize CPU dt generation code

2015-06-15 Thread Bharata B Rao
spapr_populate_cpu_dt spapr_fixup_cpu_numa_dt spapr_fixup_cpu_smt_dt ibm,cas path spapr_h_cas_compose_response spapr_fixup_cpu_dt spapr_fixup_cpu_numa_dt spapr_fixup_cpu_smt_dt Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 284

Re: [Qemu-devel] [RFC PATCH v1 3/4] numa: Store boot memory address range in node_info

2015-06-16 Thread Bharata B Rao
On Mon, Jun 15, 2015 at 01:31:20PM -0300, Eduardo Habkost wrote: > On Fri, Jun 12, 2015 at 02:30:27PM +0530, Bharata B Rao wrote: > > Store memory address range information of boot memory in address > > range list of numa_info. > > > > This helps to have a common

[Qemu-devel] [PATCH v2 3/4] numa: Store boot memory address range in node_info

2015-06-18 Thread Bharata B Rao
Store memory address range information of boot memory in address range list of numa_info. This helps to have a common NUMA node lookup by address function that works for both boot time memory and hotplugged memory. Signed-off-by: Bharata B Rao --- numa.c | 17 + 1 file changed

[Qemu-devel] [PATCH v2 1/4] pc, pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate routine

2015-06-18 Thread Bharata B Rao
: Bharata B Rao Reviewed-by: David Gibson --- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 90 +--- hw/mem/pc-dimm.c | 80 ++ include/hw/i386/pc.h | 4 +-- include/hw/mem/pc-dimm.h | 9

[Qemu-devel] [PATCH v2 0/4] Refactoring pc_dimm_plug and NUMA node lookup API

2015-06-18 Thread Bharata B Rao
PowerPC sPAPR guests. Changes in v2: - - Better way to deduce start address of each node as suggested by Eduardo Habkost. v1: https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg03212.html v0: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg01078.html Bharata B Rao (4

[Qemu-devel] [PATCH v2 2/4] numa, pc-dimm: Store pc-dimm memory information in numa_info

2015-06-18 Thread Bharata B Rao
Start storing the (start_addr, size, nodeid) of the pc-dimm memory in numa_info so that this information can be used to lookup node by address. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/mem/pc-dimm.c | 4 include/sysemu/numa.h | 10 ++ numa.c

[Qemu-devel] [PATCH v2 4/4] numa: API to lookup NUMA node by address

2015-06-18 Thread Bharata B Rao
node which is needed for memory hotplug. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- include/sysemu/numa.h | 1 + numa.c| 34 ++ 2 files changed, 35 insertions(+) diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h index

[Qemu-devel] [RFC PATCH v4 1/5] spapr: Initialize hotplug memory address space

2015-06-19 Thread Bharata B Rao
Initialize a hotplug memory region under which all the hotplugged memory is accommodated. Also enable memory hotplug by setting CONFIG_MEM_HOTPLUG. Modelled on i386 memory hotplug. Signed-off-by: Bharata B Rao --- default-configs/ppc64-softmmu.mak | 1 + hw/ppc/spapr.c| 28

[Qemu-devel] [RFC PATCH v4 3/5] spapr: Support ibm, dynamic-reconfiguration-memory

2015-06-19 Thread Bharata B Rao
a SLOF enhancement which is already part of SLOF binary in QEMU. Signed-off-by: Bharata B Rao --- docs/specs/ppc-spapr-hotplug.txt | 48 ++ hw/ppc/spapr.c | 202 ++- hw/ppc/spapr_hcall.c | 51 -- include/hw/ppc

[Qemu-devel] [RFC PATCH v4 2/5] spapr: Add LMB DR connectors

2015-06-19 Thread Bharata B Rao
emory hotplug code. Signed-off-by: Bharata B Rao Signed-off-by: Michael Roth [spapr_drc_reset implementation] --- hw/ppc/spapr.c | 78 ++ include/hw/ppc/spapr.h | 2 ++ 2 files changed, 80 insertions(+) diff --git a/h

[Qemu-devel] [RFC PATCH v4 5/5] spapr: Memory hotplug support

2015-06-19 Thread Bharata B Rao
Make use of pc-dimm infrastructure to support memory hotplug for PowerPC. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c| 126 ++ hw/ppc/spapr_events.c | 8 ++-- 2 files changed, 131 insertions(+), 3 deletions(-) diff --git a/hw/ppc

[Qemu-devel] [RFC PATCH v4 0/5] Memory hotplug for PowerPC sPAPR guests

2015-06-19 Thread Bharata B Rao
utils and ppc64-diag packages in the guest. Bharata B Rao (5): spapr: Initialize hotplug memory address space spapr: Add LMB DR connectors spapr: Support ibm,dynamic-reconfiguration-memory spapr: Make hash table size a factor of maxram_size spapr: Memory hotplug support default-configs/

[Qemu-devel] [RFC PATCH v4 4/5] spapr: Make hash table size a factor of maxram_size

2015-06-19 Thread Bharata B Rao
The hash table size is dependent on ram_size, but since with hotplug the memory can grow till maxram_size. Hence make hash table size dependent on maxram_size. This allows to hotplug huge amounts of memory to the guest. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 2 +- 1 file changed, 1

Re: [Qemu-devel] [RFC PATCH v4 1/5] spapr: Initialize hotplug memory address space

2015-06-23 Thread Bharata B Rao
On Tue, Jun 23, 2015 at 11:33:58AM +1000, David Gibson wrote: > On Fri, Jun 19, 2015 at 03:47:53PM +0530, Bharata B Rao wrote: > > Initialize a hotplug memory region under which all the hotplugged > > memory is accommodated. Also enable memory hotplug by setting > &g

Re: [Qemu-devel] [RFC PATCH v4 2/5] spapr: Add LMB DR connectors

2015-06-23 Thread Bharata B Rao
On Tue, Jun 23, 2015 at 11:32:34AM +1000, David Gibson wrote: > On Fri, Jun 19, 2015 at 03:47:54PM +0530, Bharata B Rao wrote: > > Enable memory hotplug for pseries 2.4 and add LMB DR connectors. > > With memory hotplug, enforce NUMA node memory size and maxmem to be &g

Re: [Qemu-devel] [RFC PATCH v4 3/5] spapr: Support ibm, dynamic-reconfiguration-memory

2015-06-23 Thread Bharata B Rao
On Tue, Jun 23, 2015 at 11:54:29AM +1000, David Gibson wrote: > On Fri, Jun 19, 2015 at 03:47:55PM +0530, Bharata B Rao wrote: > > Parse ibm,architecture.vec table obtained from the guest and enable > > memory node configuration via ibm,dynamic-reconfiguration-memory if guest > &

Re: [Qemu-devel] [RFC PATCH v4 2/5] spapr: Add LMB DR connectors

2015-06-23 Thread Bharata B Rao
On Wed, Jun 24, 2015 at 07:49:31AM +0530, Bharata B Rao wrote: > On Tue, Jun 23, 2015 at 11:32:34AM +1000, David Gibson wrote: > > On Fri, Jun 19, 2015 at 03:47:54PM +0530, Bharata B Rao wrote: > > > Enable memory hotplug for pseries 2.4 and add LMB DR connectors. > &g

Re: [Qemu-devel] [PATCH v2 0/4] Refactoring pc_dimm_plug and NUMA node lookup API

2015-06-23 Thread Bharata B Rao
On Fri, Jun 19, 2015 at 10:40:20AM +0530, Bharata B Rao wrote: > Hi, > > Here is the v2 of the patchset that refactors pc_dimm_plug and adds > an API to lookup NUMA node by address. > > - Refactoring pc_dimm_plug() helps other architectures like PowerPC > to make use of co

[Qemu-devel] VM crashed after migration.

2012-07-13 Thread Ma, Stephen B.
Hello, Sometimes I am seeing my VM crash immediately after it has been migrated to a new host. The VM is running RHEL6.2 with the following devices: The VM has the following devices: [root@vmdev51 ~]# lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA

Re: [Qemu-devel] [PATCH] Fix for qemu crash on assertion error when adding PCI passthru device.

2012-07-18 Thread Ma, Stephen B.
Sorry for taking so long to reply. I am new to this. Should this patch be committed or just dropped -Original Message- From: Jan Kiszka [mailto:jan.kis...@web.de] Sent: Sunday, June 17, 2012 11:25 PM To: Anthony Liguori Cc: Michael S. Tsirkin; 'qemu-devel@nongnu.org'; Ma,

[Qemu-devel] [RFC PATCH 0/2] GlusterFS support in QEMU - v2

2012-07-21 Thread Bharata B Rao
Hi, Here is the v2 patchset for supporting GlusterFS protocol from QEMU. This set of patches enables QEMU to boot VM images from gluster volumes. This is achieved by adding gluster as a new block backend driver in QEMU. Its already possible to boot from VM images on gluster volumes, but this patc

[Qemu-devel] [RFC PATCH 1/2] qemu: Add a config option for GlusterFS as block backend

2012-07-21 Thread Bharata B Rao
qemu: Add a config option for GlusterFS as block backend From: Bharata B Rao Signed-off-by: Bharata B Rao --- configure | 34 ++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 500fe24..03547b9 100755 --- a

[Qemu-devel] [RFC PATCH 2/2] block: gluster as block backend

2012-07-21 Thread Bharata B Rao
block: gluster as block backend From: Bharata B Rao This patch adds gluster as the new block backend in QEMU. This gives QEMU the ability to boot VM images from gluster volumes. Signed-off-by: Bharata B Rao --- block/Makefile.objs |1 block/gluster.c | 483

Re: [Qemu-devel] [RFC PATCH 0/2] GlusterFS support in QEMU - v2

2012-07-21 Thread Bharata B Rao
On Sat, Jul 21, 2012 at 05:52:59PM +0530, Vijay Bellur wrote: > On 07/21/2012 01:59 PM, Bharata B Rao wrote: > >We now > >specify the gluster backed image like this: > > > >-drive file=gluster:server@port:volname:image > > > >- Here 'gluster'

Re: [Qemu-devel] [RFC PATCH 2/2] block: gluster as block backend

2012-07-23 Thread Bharata B Rao
On Sun, Jul 22, 2012 at 04:38:00PM +0100, Stefan Hajnoczi wrote: > On Sat, Jul 21, 2012 at 9:31 AM, Bharata B Rao > wrote: > > +typedef struct GlusterAIOCB { > > +BlockDriverAIOCB common; > > +QEMUIOVector *qiov; > > The qiov field is unused. > > &g

Re: [Qemu-devel] [RFC PATCH 0/2] GlusterFS support in QEMU - v2

2012-07-23 Thread Bharata B Rao
On Sun, Jul 22, 2012 at 03:42:28PM +0100, Stefan Hajnoczi wrote: > On Sat, Jul 21, 2012 at 9:29 AM, Bharata B Rao > wrote: > > -drive file=gluster:server@port:volname:image > > > > - Here 'gluster' is the protocol. > > - 'server@port' specifies

Re: [Qemu-devel] [RFC PATCH 0/2] GlusterFS support in QEMU - v2

2012-07-23 Thread Bharata B Rao
On Mon, Jul 23, 2012 at 08:34:30AM -0600, Eric Blake wrote: > On 07/23/2012 03:20 AM, Stefan Hajnoczi wrote: > >> > >> So without the capability to pass custom options to block drivers, am I > >> forced > >> to keep extending the file= with more and more options ? > >> > >> file=gluster:transport:

[Qemu-devel] [PATCH v3 0/2] GlusterFS support in QEMU - v3

2012-07-24 Thread Bharata B Rao
Hi, This is the v3 of the patchset to support GlusterFS backend from QEMU. Apart from cleanups, the major change in this version is to expose all the gluster configuration options to QEMU user. With this, the gluster specification looks like this: -drive file=gluster:server:[port]:[transport]:vo

[Qemu-devel] [PATCH v3 1/2] qemu: Add a config option for GlusterFS as block backend

2012-07-24 Thread Bharata B Rao
qemu: Add a config option for GlusterFS as block backend From: Bharata B Rao GlusterFS support in QEMU depends on libgfapi, libgfrpc and libgfxdr provided by GlusterFS. Signed-off-by: Bharata B Rao --- configure | 34 ++ 1 files changed, 34 insertions(+), 0

[Qemu-devel] [PATCH v3 2/2] block: Support GlusterFS as a QEMU block backend

2012-07-24 Thread Bharata B Rao
block: Support GlusterFS as a QEMU block backend. From: Bharata B Rao This patch adds gluster as the new block backend in QEMU. This gives QEMU the ability to boot VM images from gluster volumes. Its already possible to boot from VM images on gluster volumes, but this patchset provides the

Re: [Qemu-devel] [PATCH v3 2/2] block: Support GlusterFS as a QEMU block backend

2012-07-27 Thread Bharata B Rao
On Fri, Jul 27, 2012 at 06:44:04PM +, Blue Swirl wrote: > > +struct GlusterOpts { > > static Sure. > > > +bool optional; > > +char defval[10]; > > const char *defval? Sure I could. > > > +char *value; > > +} GlusterOpts[] = { > > +{false, "", NULL }, > > +{false, "",

Re: [Qemu-devel] [PATCH v3 0/2] GlusterFS support in QEMU - v3

2012-07-29 Thread Bharata B Rao
On Wed, Jul 25, 2012 at 11:28:06AM +0530, Bharata B Rao wrote: > Hi, > > This is the v3 of the patchset to support GlusterFS backend from QEMU. I am planning a v4 post to address a few minor cleanups suggested by Blue Swirl. I would like to know if there are any other comments or test

Re: [Qemu-devel] [PATCH v3 0/2] GlusterFS support in QEMU - v3

2012-07-31 Thread Bharata B Rao
On Tue, Jul 31, 2012 at 09:12:53AM +0100, Stefan Hajnoczi wrote: > On Wed, Jul 25, 2012 at 6:58 AM, Bharata B Rao > wrote: > > Apart from cleanups, the major change in this version is to expose all > > the gluster configuration options to QEMU user. With this, the gluster >

Re: [Qemu-devel] [PATCH v3 0/2] GlusterFS support in QEMU - v3

2012-07-31 Thread Bharata B Rao
On Tue, Jul 31, 2012 at 01:56:29PM +0100, Stefan Hajnoczi wrote: > On Tue, Jul 31, 2012 at 1:38 PM, Bharata B Rao > wrote: > > On Tue, Jul 31, 2012 at 09:12:53AM +0100, Stefan Hajnoczi wrote: > >> On Wed, Jul 25, 2012 at 6:58 AM, Bharata B Rao > >> wrote: > &g

[Qemu-devel] [PATCH v4 0/2] GlusterFS support in QEMU - v4

2012-08-01 Thread Bharata B Rao
Hi, This is the v4 of the patchset to support GlusterFS backend from QEMU. Due to difficulties in supporting ipv6 address format in the ealier specification, I switched over to the URI based specification which looks like this: file=gluster://server:[port]/volname/image[?transport=socket] I hav

[Qemu-devel] [PATCH v4 1/2] qemu: Add a config option for GlusterFS as block backend

2012-08-01 Thread Bharata B Rao
qemu: Add a config option for GlusterFS as block backend From: Bharata B Rao GlusterFS support in QEMU depends on libgfapi, libgfrpc and libgfxdr provided by GlusterFS. Signed-off-by: Bharata B Rao --- configure | 34 ++ 1 files changed, 34 insertions(+), 0

[Qemu-devel] [PATCH v4 2/2] block: Support GlusterFS as a QEMU block backend

2012-08-01 Thread Bharata B Rao
block: Support GlusterFS as a QEMU block backend. From: Bharata B Rao This patch adds gluster as the new block backend in QEMU. This gives QEMU the ability to boot VM images from gluster volumes. Its already possible to boot from VM images on gluster volumes, but this patchset provides the

Re: [Qemu-devel] [PATCH v4 2/2] block: Support GlusterFS as a QEMU block backend

2012-08-01 Thread Bharata B Rao
On Wed, Aug 01, 2012 at 06:35:22PM +, Blue Swirl wrote: > > + > > +if (!transport) { > > +uri->transport = strdup("socket"); > > g_strdup Sorry about that, pitfalls of developing the parsing code out of line :( > > +static int qemu_gluster_parseuri(GlusterURI *uri, const char *fi

Re: [Qemu-devel] [PATCH v4 2/2] block: Support GlusterFS as a QEMU block backend

2012-08-03 Thread Bharata B Rao
On Fri, Aug 03, 2012 at 03:57:20PM +, Blue Swirl wrote: > >> > +static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void > >> > *arg) > >> > +{ > >> > +GlusterAIOCB *acb = (GlusterAIOCB *)arg; > >> > +BDRVGlusterState *s = acb->common.bs->opaque; > >> > + > >> > +acb-

Re: [Qemu-devel] [RFC PATCH v0 5/6] qmp, spapr: Show hot-plugged/pluggable CPU slots in the Machine

2016-03-03 Thread Bharata B Rao
On Tue, Mar 01, 2016 at 02:55:02PM +0100, Igor Mammedov wrote: > On Tue, 1 Mar 2016 14:39:51 +0530 > Bharata B Rao wrote: > > > On Mon, Feb 29, 2016 at 11:46:42AM +0100, Igor Mammedov wrote: > > > On Thu, 25 Feb 2016 21:52:41 +0530 > > > Bharata B Rao wrote: >

[Qemu-devel] [RFC PATCH v1 01/10] exec: Remove cpu from cpus list during cpu_exec_exit()

2016-03-03 Thread Bharata B Rao
->cpu_index indicates that we have already dequeued the cpu for CONFIG_USER_ONLY case also. Signed-off-by: Bharata B Rao --- exec.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index c62c439..7c3f747 100644 --- a/exec.c ++

[Qemu-devel] [RFC PATCH v1 00/10] Core based CPU hotplug for PowerPC sPAPR

2016-03-03 Thread Bharata B Rao
ion moves all core removal logic into spapr_cpu_core.c. - Some minor cleanups like use of g_new0 instead of g_malloc0 etc. This patchset is present at: https://github.com/bharata/qemu/commits/spapr-cpu-core Bharata B Rao (9): exec: Remove cpu from cpus list during cpu_exec_exit() exec: Do

[Qemu-devel] [RFC PATCH v1 03/10] cpu: Reclaim vCPU objects

2016-03-03 Thread Bharata B Rao
suggested: https://www.mail-archive.com/kvm@vger.kernel.org/msg102839.html Signed-off-by: Chen Fan Signed-off-by: Gu Zheng Signed-off-by: Zhu Guihua Signed-off-by: Bharata B Rao [- Explicit CPU_REMOVE() from qemu_kvm/tcg_destroy_vcpu() isn't needed as

[Qemu-devel] [RFC PATCH v1 08/10] spapr: CPU hotplug support

2016-03-03 Thread Bharata B Rao
Set up device tree entries for the hotplugged CPU core and use the exising EPOW event infrastructure to send CPU hotplug notification to the guest. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 73 - hw/ppc/spapr_cpu_core.c

[Qemu-devel] [RFC PATCH v1 02/10] exec: Do vmstate unregistration from cpu_exec_exit()

2016-03-03 Thread Bharata B Rao
cpu_exec_init() does vmstate_register and register_savevm for the CPU device. These need to be undone from cpu_exec_exit(). These changes are needed to support CPU hot removal. Signed-off-by: Bharata B Rao --- exec.c | 12 1 file changed, 12 insertions(+) diff --git a/exec.c b

[Qemu-devel] [RFC PATCH v1 04/10] cpu: Add a sync version of cpu_remove()

2016-03-03 Thread Bharata B Rao
This sync API will be used by the CPU hotplug code to wait for the CPU to completely get removed before flagging the failure to the device_add command. Sync version of this call is needed to correctly recover from CPU realization failures when ->plug() handler fails. Signed-off-by: Bharata B

[Qemu-devel] [RFC PATCH v1 09/10] xics, xics_kvm: Handle CPU unplug correctly

2016-03-03 Thread Bharata B Rao
s allows reboot of a VM that has undergone CPU hotplug and unplug to work correctly. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/intc/xics.c| 14 ++ hw/intc/xics_kvm.c| 8 include/hw/ppc/xics.h | 1 + 3 files changed, 19 insertions(+), 4 d

[Qemu-devel] [RFC PATCH v1 05/10] cpu: Abstract CPU core type

2016-03-03 Thread Bharata B Rao
Add an abstract CPU core type that could be used by machines that want to define and hotplug CPUs in core granularity. Signed-off-by: Bharata B Rao --- hw/cpu/Makefile.objs | 1 + hw/cpu/core.c | 44 include/hw/cpu/core.h | 30

[Qemu-devel] [RFC PATCH v1 07/10] spapr: Represent boot CPUs as spapr-cpu-core devices

2016-03-03 Thread Bharata B Rao
l the CPU slots can be obtained by walking these links. Also prevent topologies that have or can result in incomplete cores. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 85 ++--- hw/ppc/spapr_cpu_core.c | 9 ++ include/hw/ppc/sp

[Qemu-devel] [RFC PATCH v1 06/10] spapr: CPU core device

2016-03-03 Thread Bharata B Rao
Add sPAPR specific CPU core device that is based on generic CPU core device. Creating this core device will result in creation of all the CPU thread devices that are part of this core. Signed-off-by: Bharata B Rao --- hw/ppc/Makefile.objs| 1 + hw/ppc/spapr_cpu_core.c

[Qemu-devel] [RFC PATCH v1 10/10] spapr: CPU hot unplug support

2016-03-03 Thread Bharata B Rao
: Bharata B Rao --- hw/ppc/spapr.c | 16 hw/ppc/spapr_cpu_core.c | 84 + include/hw/ppc/spapr.h | 1 + include/hw/ppc/spapr_cpu_core.h | 11 ++ 4 files changed, 112 insertions(+) diff --git a/hw/ppc/spapr.c b/hw

Re: [Qemu-devel] [PATCH v8 6/7] s390x/cpu: Add error handling to cpu creation

2016-03-04 Thread Bharata B Rao
-s390x/cpu.c | 56 > +- > target-s390x/cpu.h | 2 ++ > target-s390x/helper.c | 42 +++-- > 5 files changed, 99 insertions(+), 4 deletions(-) > > diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c > index f00

Re: [Qemu-devel] [RFC PATCH v1 05/10] cpu: Abstract CPU core type

2016-03-04 Thread Bharata B Rao
On Fri, Mar 04, 2016 at 11:38:45AM +0100, Igor Mammedov wrote: > On Fri, 4 Mar 2016 12:24:16 +0530 > Bharata B Rao wrote: > > > Add an abstract CPU core type that could be used by machines that want > > to define and hotplug CPUs in core granularity. > > >

Re: [Qemu-devel] [PATCH v8 6/7] s390x/cpu: Add error handling to cpu creation

2016-03-04 Thread Bharata B Rao
On Fri, Mar 04, 2016 at 12:07:28PM +0100, David Hildenbrand wrote: > > > > cpu_exec_init(cs, &err); > > > if (err != NULL) { > > > error_propagate(errp, err); > > > return; > > > } > > > +scc->next_cpu_id = cs->cpu_index + 1; > > > > It appears that scc->nex

Re: [Qemu-devel] [PATCH v8 6/7] s390x/cpu: Add error handling to cpu creation

2016-03-04 Thread Bharata B Rao
On Fri, Mar 04, 2016 at 05:01:29PM +0530, Bharata B Rao wrote: > On Fri, Mar 04, 2016 at 12:07:28PM +0100, David Hildenbrand wrote: > > > > > > cpu_exec_init(cs, &err); > > > > if (err != NULL) { > > > > er

Re: [Qemu-devel] [RFC PATCH v1 02/10] exec: Do vmstate unregistration from cpu_exec_exit()

2016-03-06 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 01:51:43PM +1100, David Gibson wrote: > On Fri, Mar 04, 2016 at 12:24:13PM +0530, Bharata B Rao wrote: > > cpu_exec_init() does vmstate_register and register_savevm for the CPU > > device. > > These need to be undone from cpu_exec_exit(). These

Re: [Qemu-devel] [RFC PATCH v1 08/10] spapr: CPU hotplug support

2016-03-06 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 02:49:06PM +1100, David Gibson wrote: > On Fri, Mar 04, 2016 at 12:24:19PM +0530, Bharata B Rao wrote: > > Set up device tree entries for the hotplugged CPU core and use the > > exising EPOW event infrastructure to send CPU hotplug notification t

Re: [Qemu-devel] [RFC PATCH v1 05/10] cpu: Abstract CPU core type

2016-03-07 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 02:36:55PM +1100, David Gibson wrote: > On Fri, Mar 04, 2016 at 07:07:20PM +0100, Igor Mammedov wrote: > > On Fri, 4 Mar 2016 16:32:53 +0530 > > Bharata B Rao wrote: > > > > > On Fri, Mar 04, 2016 at 11:38:45AM +0100, Igor Mammedov wrote: >

Re: [Qemu-devel] [PATCH v2 4/5] spapr: check if cpu core is already present

2016-03-08 Thread Bharata B Rao
On Tue, Mar 08, 2016 at 02:18:14PM +0100, Igor Mammedov wrote: > Signed-off-by: Igor Mammedov > --- > replaced link set check removed in previous patch > --- > hw/ppc/spapr.c | 26 ++ > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --g

Re: [Qemu-devel] [PATCH v2 2/5] spapr: convert slot name property to numeric core and links

2016-03-08 Thread Bharata B Rao
/cpu/core.c | 32 +++- > hw/ppc/spapr.c | 39 ++- > hw/ppc/spapr_cpu_core.c | 25 ++--- > include/hw/cpu/core.h | 4 ++-- > 4 files changed, 29 insertions(+), 71 deletions(-) > > diff --git a/hw/cpu/core.c b/h

Re: [Qemu-devel] [RFC PATCH v1 03/10] cpu: Reclaim vCPU objects

2016-03-08 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 08:05:58PM +0100, Thomas Huth wrote: > On 04.03.2016 07:54, Bharata B Rao wrote: > > From: Gu Zheng > > > > In order to deal well with the kvm vcpus (which can not be removed without > > any > > protection), we do not close KVM vcpu fd, j

Re: [Qemu-devel] [RFC PATCH v1 08/10] spapr: CPU hotplug support

2016-03-08 Thread Bharata B Rao
On Wed, Mar 09, 2016 at 01:58:53PM +1100, David Gibson wrote: > On Tue, Mar 08, 2016 at 10:37:08AM +0100, Igor Mammedov wrote: > > On Tue, 8 Mar 2016 15:27:39 +1100 > > David Gibson wrote: > > > > > On Mon, Mar 07, 2016 at 11:59:42AM +0530, Bharata B Rao wrote: >

Re: [Qemu-devel] [RFC PATCH v1 01/10] exec: Remove cpu from cpus list during cpu_exec_exit()

2016-03-08 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 05:23:48PM +0100, Thomas Huth wrote: > On 04.03.2016 07:54, Bharata B Rao wrote: > > CPUState *cpu gets added to the cpus list during cpu_exec_init(). It > > should be removed from cpu_exec_exit(). > > > > cpu_exec_init() is called from generic

Re: [Qemu-devel] [RFC PATCH v1 07/10] spapr: Represent boot CPUs as spapr-cpu-core devices

2016-03-09 Thread Bharata B Rao
On Mon, Mar 07, 2016 at 02:45:09PM +1100, David Gibson wrote: > On Fri, Mar 04, 2016 at 12:24:18PM +0530, Bharata B Rao wrote: > > Initialize boot CPUs as spapr-cpu-core devices and create links from > > machine object to these core devices. These links can be considered > >

Re: [Qemu-devel] [PATCH v2 4/5] spapr: check if cpu core is already present

2016-03-09 Thread Bharata B Rao
On Thu, Mar 10, 2016 at 04:22:43PM +1100, David Gibson wrote: > On Wed, Mar 09, 2016 at 11:07:40AM +0100, Igor Mammedov wrote: > > On Tue, 8 Mar 2016 20:04:12 +0530 > > Bharata B Rao wrote: > > > > > On Tue, Mar 08, 2016 at 02:18:14PM +0100, Igor Mammedov wrot

Re: [Qemu-devel] [PATCH v2 4/5] spapr: check if cpu core is already present

2016-03-10 Thread Bharata B Rao
On Thu, Mar 10, 2016 at 11:39:46AM +0100, Igor Mammedov wrote: > On Thu, 10 Mar 2016 11:32:44 +0530 > Bharata B Rao wrote: > > > On Thu, Mar 10, 2016 at 04:22:43PM +1100, David Gibson wrote: > > > On Wed, Mar 09, 2016 at 11:07:40AM +0100, Igor Mammedov wrote: > >

[Qemu-devel] [RFC PATCH v2 1/9] exec: Remove cpu from cpus list during cpu_exec_exit()

2016-03-10 Thread Bharata B Rao
->cpu_index indicates that we have already dequeued the cpu for CONFIG_USER_ONLY case also. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- exec.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index f09dd4e..49ae

[Qemu-devel] [RFC PATCH v2 0/9] Core based CPU hotplug for PowerPC sPAPR

2016-03-10 Thread Bharata B Rao
This will not be needed when we prevent such attempts from pre_plug handler (9/9). Bharata B Rao (8): exec: Remove cpu from cpus list during cpu_exec_exit() exec: Do vmstate unregistration from cpu_exec_exit() cpu: Add a sync version of cpu_remove() cpu: Abstract CPU core type spapr: CPU c

[Qemu-devel] [RFC PATCH v2 2/9] exec: Do vmstate unregistration from cpu_exec_exit()

2016-03-10 Thread Bharata B Rao
cpu_exec_init() does vmstate_register for the CPU device. This needs to be undone from cpu_exec_exit(). This change is needed to support CPU hot removal. Signed-off-by: Bharata B Rao --- exec.c | 9 + 1 file changed, 9 insertions(+) diff --git a/exec.c b/exec.c index 49ae593..8ddca6b

[Qemu-devel] [RFC PATCH v2 5/9] cpu: Abstract CPU core type

2016-03-10 Thread Bharata B Rao
Add an abstract CPU core type that could be used by machines that want to define and hotplug CPUs in core granularity. Signed-off-by: Bharata B Rao --- hw/cpu/Makefile.objs | 1 + hw/cpu/core.c | 87 +++ include/hw/cpu/core.h | 31

[Qemu-devel] [RFC PATCH v2 3/9] cpu: Reclaim vCPU objects

2016-03-10 Thread Bharata B Rao
suggested: https://www.mail-archive.com/kvm@vger.kernel.org/msg102839.html Signed-off-by: Chen Fan Signed-off-by: Gu Zheng Signed-off-by: Zhu Guihua Signed-off-by: Bharata B Rao [- Explicit CPU_REMOVE() from qemu_kvm/tcg_destroy_vcpu() isn't needed as

[Qemu-devel] [RFC PATCH v2 6/9] spapr: CPU core device

2016-03-10 Thread Bharata B Rao
instead of kvmppc_smt_threads() call here. Signed-off-by: Bharata B Rao --- hw/ppc/Makefile.objs| 1 + hw/ppc/spapr.c | 68 +++--- hw/ppc/spapr_cpu_core.c | 199 include/hw/ppc/spapr.h | 4 + include/hw

[Qemu-devel] [RFC PATCH v2 4/9] cpu: Add a sync version of cpu_remove()

2016-03-10 Thread Bharata B Rao
This sync API will be used by the CPU hotplug code to wait for the CPU to completely get removed before flagging the failure to the device_add command. Sync version of this call is needed to correctly recover from CPU realization failures when ->plug() handler fails. Signed-off-by: Bharata B

[Qemu-devel] [RFC PATCH v2 7/9] spapr: CPU hotplug support

2016-03-10 Thread Bharata B Rao
Set up device tree entries for the hotplugged CPU core and use the exising RTAS event logging infrastructure to send CPU hotplug notification to the guest. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 64 ++ hw/ppc/spapr_cpu_core.c

[Qemu-devel] [RFC PATCH v2 9/9] spapr: CPU hot unplug support

2016-03-10 Thread Bharata B Rao
Remove the CPU core device by removing the underlying CPU thread devices. Hot removal of CPU for sPAPR guests is achieved by sending the hot unplug notification to the guest. Release the vCPU object after CPU hot unplug so that vCPU fd can be parked and reused. Signed-off-by: Bharata B Rao

[Qemu-devel] [RFC PATCH v2 8/9] xics, xics_kvm: Handle CPU unplug correctly

2016-03-10 Thread Bharata B Rao
s allows reboot of a VM that has undergone CPU hotplug and unplug to work correctly. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/intc/xics.c| 14 ++ hw/intc/xics_kvm.c| 8 include/hw/ppc/xics.h | 1 + 3 files changed, 19 insertions(+), 4 d

[Qemu-devel] [RFC PATCH v2 0/2] spapr: Memory hot-unplug support

2016-03-14 Thread Bharata B Rao
et part of PAPR. Changes in v2 - - Use count-indexed hotplug identifier type for LMB removal. v1: https://lists.gnu.org/archive/html/qemu-ppc/2015-10/msg00163.html Bharata B Rao (2): spapr: Add DRC count indexed hotplug identifier type spapr: Memory hot-unplug support hw/ppc/spapr

[Qemu-devel] [RFC PATCH v2 2/2] spapr: Memory hot-unplug support

2016-03-14 Thread Bharata B Rao
Add support to hot remove pc-dimm memory devices. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 93 +- hw/ppc/spapr_drc.c | 18 +++ 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c

[Qemu-devel] [RFC PATCH v2 1/2] spapr: Add DRC count indexed hotplug identifier type

2016-03-14 Thread Bharata B Rao
: Bharata B Rao --- hw/ppc/spapr_events.c | 57 +- include/hw/ppc/spapr.h | 2 ++ 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index 39f4682..5d1d13d 100644 --- a/hw/ppc/spapr_events.c

Re: [Qemu-devel] [PATCH 04/17] ppc: Add number of threads per core to the processor definition

2016-03-15 Thread Bharata B Rao
consistency with the > > HW implementations. > > > > Signed-off-by: Benjamin Herrenschmidt > > --- > > target-ppc/cpu-qom.h| 1 + > > target-ppc/translate_init.c | 11 ++- > > 2 files changed, 11 insertions(+), 1 deletion(-) > &

Re: [Qemu-devel] [RFC PATCH v2 6/9] spapr: CPU core device

2016-03-15 Thread Bharata B Rao
On Mon, Mar 14, 2016 at 11:25:23AM +0100, Igor Mammedov wrote: > On Fri, 11 Mar 2016 10:24:35 +0530 > Bharata B Rao wrote: > > > Add sPAPR specific CPU core device that is based on generic CPU core device. > > Creating this core device will result in creation of all the C

[Qemu-devel] [RFC PATCH v2.1 01/12] exec: Remove cpu from cpus list during cpu_exec_exit()

2016-03-31 Thread Bharata B Rao
->cpu_index indicates that we have already dequeued the cpu for CONFIG_USER_ONLY case also. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson Reviewed-by: Thomas Huth --- exec.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/exec.

[Qemu-devel] [RFC PATCH v2.1 02/12] exec: Do vmstate unregistration from cpu_exec_exit()

2016-03-31 Thread Bharata B Rao
cpu_exec_init() does vmstate_register for the CPU device. This needs to be undone from cpu_exec_exit(). This change is needed to support CPU hot removal. Signed-off-by: Bharata B Rao Reviewed-by: Thomas Huth Reviewed-by: David Gibson --- exec.c | 9 + 1 file changed, 9 insertions

[Qemu-devel] [RFC PATCH v2.1 09/12] spapr: convert boot CPUs into CPU core devices

2016-03-31 Thread Bharata B Rao
xics_system_init() is done in this patch as it makes sense to use the local variable smt introduced in this patch instead of kvmppc_smt_threads() call here. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 73 +++-- hw/ppc/spapr_cpu_core.c

[Qemu-devel] [RFC PATCH v2.1 12/12] spapr: CPU hot unplug support

2016-03-31 Thread Bharata B Rao
Remove the CPU core device by removing the underlying CPU thread devices. Hot removal of CPU for sPAPR guests is achieved by sending the hot unplug notification to the guest. Release the vCPU object after CPU hot unplug so that vCPU fd can be parked and reused. Signed-off-by: Bharata B Rao

[Qemu-devel] [RFC PATCH v2.1 07/12] spapr: Abstract CPU core device

2016-03-31 Thread Bharata B Rao
Add sPAPR specific abastract CPU core device that is based on generic CPU core device. This will serve as base type for all PowerPC CPU specific core devices. Signed-off-by: Bharata B Rao --- hw/ppc/Makefile.objs| 1 + hw/ppc/spapr_cpu_core.c | 30

[Qemu-devel] [RFC PATCH v2.1 11/12] xics, xics_kvm: Handle CPU unplug correctly

2016-03-31 Thread Bharata B Rao
s allows reboot of a VM that has undergone CPU hotplug and unplug to work correctly. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson --- hw/intc/xics.c| 14 ++ hw/intc/xics_kvm.c| 8 include/hw/ppc/xics.h | 1 + 3 files changed, 19 insertions(+), 4 d

[Qemu-devel] [RFC PATCH v2.1 00/12] Core based CPU hotplug for PowerPC sPAPR

2016-03-31 Thread Bharata B Rao
d not for their variants/aliases) yet. I have mostly taken care of all the review comments that I got for v2. Major changes in this version (v2.1) - Semantics change: spapr-cpu-core to POWER8-spapr-cpu-core and likewise - Included Igor's pre_plug patch

[Qemu-devel] [RFC PATCH v2.1 08/12] spapr: Add CPU type specific core devices

2016-03-31 Thread Bharata B Rao
Introduce core devices for each CPU type supported by sPAPR. These core devices are derived from the base spapr-cpu-core device type. TODO: - Add core types for other remaining CPU types - Handle CPU model alias correctly Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 3

[Qemu-devel] [RFC PATCH v2.1 04/12] cpu: Add a sync version of cpu_remove()

2016-03-31 Thread Bharata B Rao
This sync API will be used by the CPU hotplug code to wait for the CPU to completely get removed before flagging the failure to the device_add command. Sync version of this call is needed to correctly recover from CPU realization failures when ->plug() handler fails. Signed-off-by: Bharata B

[Qemu-devel] [RFC PATCH v2.1 03/12] cpu: Reclaim vCPU objects

2016-03-31 Thread Bharata B Rao
suggested: https://www.mail-archive.com/kvm@vger.kernel.org/msg102839.html Signed-off-by: Chen Fan Signed-off-by: Gu Zheng Signed-off-by: Zhu Guihua Signed-off-by: Bharata B Rao [- Explicit CPU_REMOVE() from qemu_kvm/tcg_destroy_vcpu() isn't needed as

[Qemu-devel] [RFC PATCH v2.1 06/12] cpu: Abstract CPU core type

2016-03-31 Thread Bharata B Rao
Add an abstract CPU core type that could be used by machines that want to define and hotplug CPUs in core granularity. Signed-off-by: Bharata B Rao Signed-off-by: Igor Mammedov [Integer core property] Reviewed-by: David Gibson --- hw/cpu/Makefile.objs | 1 + hw/cpu/core.c

<    3   4   5   6   7   8   9   10   11   12   >