[Qemu-devel] [RFC PATCH v0 4/5] spapr: Support hotplug by specifying DRC count

2015-08-02 Thread Bharata B Rao
they match with spapr_hotplug_req_add_by_count(). Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_events.c | 47 ++- hw/ppc/spapr_pci.c | 4 ++-- include/hw/ppc/spapr.h | 8 ++-- 4 files changed, 47 insertions

[Qemu-devel] [RFC PATCH v0 5/5] spapr: Move memory hotplug to RTAS_LOG_V6_HP_ID_DRC_COUNT type

2015-08-02 Thread Bharata B Rao
RTAS_LOG_V6_HP_ID_DRC_COUNT hotplug type for memory so that we generate only one event per hotplug request. Signed-off-by: Bharata B Rao Reviewed-by: Michael Roth --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 13af9be..2426345 100644

Re: [Qemu-devel] [RFC PATCH v0 4/5] spapr: Support hotplug by specifying DRC count

2015-08-03 Thread Bharata B Rao
On Mon, Aug 03, 2015 at 04:55:01PM +1000, David Gibson wrote: > On Mon, Aug 03, 2015 at 11:05:42AM +0530, Bharata B Rao wrote: > > Support hotplug identifier type RTAS_LOG_V6_HP_ID_DRC_COUNT that allows > > hotplugging of DRCs by specifying the DRC count. > > > >

Re: [Qemu-devel] [RFC PATCH v0 3/5] spapr: Revert to memory@XXXX representation for non-hotplugged memory

2015-08-04 Thread Bharata B Rao
On Tue, Aug 04, 2015 at 09:33:56AM -0500, Nathan Fontenot wrote: > On 08/03/2015 12:35 AM, Bharata B Rao wrote: > > Don't represent non-hotluggable memory under drconf node. With this > > we don't have to create DRC objects for them. > > > > The effect of

[Qemu-devel] [RFC PATCH v4 11/11] target-ppc: Enable CPU hotplug for POWER8 CPU family

2015-08-05 Thread Bharata B Rao
Support CPU hotplug on POWER8 by enabling device_add semantics. Signed-off-by: Bharata B Rao --- target-ppc/translate_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index c19d630..62ef687 100644 --- a/target-ppc

[Qemu-devel] [RFC PATCH v4 05/11] xics_kvm: Add cpu_destroy method to XICS

2015-08-05 Thread Bharata B Rao
XICS is setup for each CPU during initialization. Provide a routine to undo the same when CPU is unplugged. This 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| 12

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

2015-08-05 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 and also to correctly fail hotplug attempts beyond max_cpus. Signed-off-by: Bharata B Rao --- exec.c | 19

[Qemu-devel] [RFC PATCH v4 06/11] spapr: Create pseries-2.5 machine

2015-08-05 Thread Bharata B Rao
Add pseries-2.5 machine version. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index dfd808f..1d8a12a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2356,7 +2356,7

[Qemu-devel] [RFC PATCH v4 04/11] cpus: Add a sync version of cpu_remove()

2015-08-05 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 v4 10/11] spapr: CPU hot unplug support

2015-08-05 Thread Bharata B Rao
Support hot removal of CPU for sPAPR guests by sending the hot unplug notification to the guest via EPOW interrupt. Release the vCPU object after CPU hot unplug so that vCPU fd can be parked and reused. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 72

[Qemu-devel] [RFC PATCH v4 07/11] spapr: Enable CPU hotplug for pseries-2.5 and add CPU DRC DT entries

2015-08-05 Thread Bharata B Rao
Start supporting CPU hotplug from pseries-2.5 onwards. Add CPU DRC (Dynamic Resource Connector) device tree entries. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 23 +++ include/hw/ppc/spapr.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/ppc

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

2015-08-05 Thread Bharata B Rao
a new field CPUState.queued, I could have used CPUState.cpu_index to check if the cpu is already dequeued from the list. Since that doesn't work for CONFIG_USER_ONLY, I had to add a new field. Signed-off-by: Bharata B Rao --- exec.c| 11 +++ include/qom/cpu.h | 1 + 2

[Qemu-devel] [RFC PATCH v4 00/11] sPAPR CPU hotplug

2015-08-05 Thread Bharata B Rao
d currently the semantics looks like this: (qemu) device_add POWER8-powerpc64-cpu,id=cpu8 v3: https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg02910.html Bharata B Rao (10): exec: Remove cpu from cpus list during cpu_exec_exit() exec: Do vmstate unregistration from cpu_exec_exit() c

[Qemu-devel] [RFC PATCH v4 09/11] spapr: Support topologies with unfilled cores

2015-08-05 Thread Bharata B Rao
cold-plug the cores. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 74637b3..004a8e1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -94,6 +94,8 @@ #define

[Qemu-devel] [RFC PATCH v4 08/11] spapr: CPU hotplug support

2015-08-05 Thread Bharata B Rao
the core create the threads of the core. Also support cold plugged CPUs that are specified by -device option on cmdline. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 166 +++- hw/ppc/spapr_events.c | 3 + hw/ppc/spapr_rta

[Qemu-devel] [RFC PATCH v4 03/11] cpus: Reclaim vCPU objects

2015-08-05 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 it is

Re: [Qemu-devel] [RFC PATCH v4 05/11] xics_kvm: Add cpu_destroy method to XICS

2015-08-07 Thread Bharata B Rao
On Thu, Aug 06, 2015 at 10:57:11AM +0530, Bharata B Rao wrote: > XICS is setup for each CPU during initialization. Provide a routine > to undo the same when CPU is unplugged. > > This allows reboot of a VM that has undergone CPU hotplug and unplug > to work correctly. > > S

Re: [Qemu-devel] [RFC PATCH v4 00/11] sPAPR CPU hotplug

2015-08-09 Thread Bharata B Rao
On Thu, Aug 06, 2015 at 04:42:05PM +0800, Zhu Guihua wrote: > > On 08/06/2015 01:27 PM, Bharata B Rao wrote: > >Hi, > > > >This is the next version of CPU hotplug support patchset for PowerPC > >sPAPR guests. This is a split-out from the previous version (v3) that

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

2015-08-11 Thread Bharata B Rao
call_32.tbl | 1 + > arch/x86/syscalls/syscall_64.tbl | 1 + > include/linux/syscalls.h | 1 + > kernel/sys_ni.c| 1 + > 6 files changed, 6 insertions(+) > > diff --git a/arch/powerpc/include/asm/systbl.h > b/arch/powerpc/include/as

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

2015-08-11 Thread Bharata B Rao
On Tue, Aug 11, 2015 at 03:48:26PM +0200, Andrea Arcangeli wrote: > Hello Bharata, > > On Tue, Aug 11, 2015 at 03:37:29PM +0530, Bharata B Rao wrote: > > May be it is a bit late to bring this up, but I needed the following fix > > to userfault21 branch of your git tree

Re: [Qemu-devel] [PATCH RFC] pseries: define coldplugged devices as "configured"

2015-08-13 Thread Bharata B Rao
On Thu, Aug 13, 2015 at 02:53:02PM +0200, Laurent Vivier wrote: > When a device is hotplugged, attach() sets "configured" to > false, waiting an action from the OS to configure it and then > to call ibm,configure-connector. On ibm,configure-connector, > the hypervisor sets "configured" to true. >

Re: [Qemu-devel] [PATCH RFC] pseries: define coldplugged devices as "configured"

2015-08-14 Thread Bharata B Rao
On Fri, Aug 14, 2015 at 09:16:08AM +0200, Laurent Vivier wrote: > > > On 14/08/2015 07:20, Bharata B Rao wrote: > > On Thu, Aug 13, 2015 at 02:53:02PM +0200, Laurent Vivier wrote: > >> When a device is hotplugged, attach() sets "configured" to > >&

Re: [Qemu-devel] [PATCH v3 0/3] Bitmap based CPU enumeration

2015-06-03 Thread Bharata B Rao
On Thu, May 28, 2015 at 09:59:38PM -0700, Peter Crosthwaite wrote: > On Thu, May 28, 2015 at 7:27 PM, Bharata B Rao > wrote: > > All the comments have been addressed and the series has been reviewed > > by David, Eduardo and Igor. Can this series be taken in now ? > > >

[Qemu-devel] [PATCH v4 1/8] spapr: Consider max_cpus during xics initialization

2015-06-04 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 | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH v4 0/8] sPAPR CPU hotplug pre-requisites

2015-06-04 Thread Bharata B Rao
those CPUs that are already removed during XICS reset. (8/8) - Removed David Gibson's SoB from some patches as there were some minor changes in them. This series applies against spapr-next branch of David Gibson's tree. Bharata B Rao (8): spapr: Consider max_cpus during xics initial

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

2015-06-04 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 Cc: 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..42f42f5

[Qemu-devel] [PATCH v4 8/8] xics_kvm: Add cpu_destroy method to XICS

2015-06-04 Thread Bharata B Rao
XICS is setup for each CPU during initialization. Provide a routine to undo the same when CPU is unplugged. Also ensure xics reset doesn't set irq for CPUs that are already unplugged. This allows reboot of a VM that has undergone CPU hotplug and unplug to work correctly. Signed-off-by: Bhar

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

2015-06-04 Thread Bharata B Rao
. Signed-off-by: Bharata B Rao --- 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/docs/specs/ppc-spapr

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

2015-06-04 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. While at this, use MSR_EP define instead of using 6 directly. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 54

[Qemu-devel] [PATCH v4 4/8] spapr: Reorganize CPU dt generation code

2015-06-04 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

[Qemu-devel] [PATCH v4 6/8] ppc: Update cpu_model in MachineState

2015-06-04 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 v4 7/8] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled

2015-06-04 Thread Bharata B Rao
hange allows CPU hot removal to work for sPAPR. Signed-off-by: Bharata B Rao --- 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 --- a/hw/intc/xics_kvm.c +++ b/hw

Re: [Qemu-devel] [PATCH v4 4/8] spapr: Reorganize CPU dt generation code

2015-06-05 Thread Bharata B Rao
On Fri, Jun 05, 2015 at 04:09:48PM +1000, Alexey Kardashevskiy wrote: > > > >-ret = fdt_setprop(fdt, offset, "ibm,pft-size", > >- pft_size_prop, sizeof(pft_size_prop)); > > You broke formatting here, above 8 lines should not be in the patch. You mean above 80 char

Re: [Qemu-devel] [PATCH v4 1/8] spapr: Consider max_cpus during xics initialization

2015-06-05 Thread Bharata B Rao
On Fri, Jun 05, 2015 at 03:30:24PM +1000, Alexey Kardashevskiy wrote: > On 06/05/2015 02:25 PM, Bharata B Rao wrote: > >Use max_cpus instead of smp_cpus when intializating xics system. Also > >report max_cpus in ibm,interrupt-server-ranges device tree property of > >inte

Re: [Qemu-devel] [PATCH v4 8/8] xics_kvm: Add cpu_destroy method to XICS

2015-06-05 Thread Bharata B Rao
On Fri, Jun 05, 2015 at 06:09:38PM +1000, Alexey Kardashevskiy wrote: > On 06/05/2015 02:25 PM, Bharata B Rao wrote: > >XICS is setup for each CPU during initialization. Provide a routine > >to undo the same when CPU is unplugged. Also ensure xics reset doesn't set > >irq

[Qemu-devel] [PATCH v4 3/3] ppc: Move cpu_exec_init() call to realize function

2015-06-07 Thread Bharata B Rao
already present in realizefn. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson Reviewed-by: Peter Crosthwaite Acked-by: Paolo Bonzini --- target-ppc/translate_init.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc

[Qemu-devel] [PATCH v4 1/3] cpus: Add Error argument to cpu_exec_init()

2015-06-07 Thread Bharata B Rao
current callers of cpu_exec_init() are from instance_init, use error_abort Error arugment to abort in case of an error. Signed-off-by: Bharata B Rao Reviewed-by: Eduardo Habkost Reviewed-by: Igor Mammedov Reviewed-by: David Gibson Reviewed-by: Peter Crosthwaite Acked-by: Paolo Bonzini

[Qemu-devel] [PATCH v4 0/3] Bitmap based CPU enumeration

2015-06-07 Thread Bharata B Rao
v1: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg01385.html v0: https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg02950.html Bharata B Rao (3): cpus: Add Error argument to cpu_exec_init() cpus: Convert cpu_index into a bitmap ppc: Move cpu_exec_init() call to realize

[Qemu-devel] [PATCH v4 2/3] cpus: Convert cpu_index into a bitmap

2015-06-07 Thread Bharata B Rao
enumeration logic. Signed-off-by: Bharata B Rao Reviewed-by: Eduardo Habkost Reviewed-by: Igor Mammedov Reviewed-by: David Gibson Reviewed-by: Peter Crosthwaite Acked-by: Paolo Bonzini --- exec.c| 55 ++- include/qom/cpu.h | 1

Re: [Qemu-devel] [RFC PATCH v0] numa: API to lookup NUMA node by address

2015-06-07 Thread Bharata B Rao
On Mon, May 25, 2015 at 02:42:40PM -0300, Eduardo Habkost wrote: > On Mon, May 25, 2015 at 01:17:57PM +0530, Bharata B Rao wrote: > > On Thu, May 14, 2015 at 11:39:06AM +0200, Paolo Bonzini wrote: > > > On 13/05/2015 20:06, Eduardo Habkost wrote: > > > > Also, this in

Re: [Qemu-devel] [RFC PATCH v0] numa: API to lookup NUMA node by address

2015-06-10 Thread Bharata B Rao
te: > > > > > > > On Mon, Jun 08, 2015 at 11:51:03AM +0200, Igor Mammedov wrote: > > > > > On Mon, 8 Jun 2015 11:28:18 +0530 > > > > > Bharata B Rao wrote: > > > > > > > > > > > On Mon, May 25, 2015 at

Re: [Qemu-devel] [RFC PATCH v0] numa: API to lookup NUMA node by address

2015-06-11 Thread Bharata B Rao
On Thu, Jun 11, 2015 at 08:56:03AM +0200, Igor Mammedov wrote: > > > > And to make this work, it needs to be aware of NUMA information for > > > > hotplugged memory too. > > > I've checked spapr_populate_drconf_memory() from original series, > > > it needs to be aware at startup about address rang

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

2015-06-12 Thread Bharata B Rao
touch common code. This version is based on the feedback I received for my v0 post: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg01078.html Bharata B Rao (4): pc,pc-dimm: Factor out reusable parts in pc_dimm_plug to a separate routine numa,pc-dimm: Store pc-dimm memory information

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

2015-06-12 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 | 22 ++ 1 file

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

2015-06-12 Thread Bharata B Rao
: Bharata B Rao --- 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 + 5 files changed, 109

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

2015-06-12 Thread Bharata B Rao
node which is needed for memory hotplug. Signed-off-by: Bharata B Rao --- 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 7176364..a6392bc 100644 --- a

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

2015-06-12 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 --- hw/mem/pc-dimm.c | 4 include/sysemu/numa.h | 10 ++ numa.c| 26

Re: [Qemu-devel] [PATCH v2 4/4] target-i386: Call cpu_exec_init() on realize

2015-09-20 Thread Bharata B Rao
On Sat, Sep 19, 2015 at 1:08 AM, Eduardo Habkost wrote: > QOM instance_init functions are not supposed to have any side-effects, > as new objects may be created at any moment for querying property > information (see qmp_device_list_properties()). > > Calling cpu_exec_init() also affects QEMU's abi

[Qemu-devel] [RFC PATCH v0 0/2] spapr: Abort when HTAB size requirement can't be met

2015-09-21 Thread Bharata B Rao
Silently disables memory hotplug - not desirable. This patchset applies against David Gibson's spapr-next. Bharata B Rao (2): spapr: Allocate HTAB from machine init spapr: Abort when HTAB of requested size isn't allocated hw/ppc/spapr.c | 17 - 1 file changed,

[Qemu-devel] [RFC PATCH v0 2/2] spapr: Abort when HTAB of requested size isn't allocated

2015-09-21 Thread Bharata B Rao
in a situation where memory hotplug fails due to less than requested HTAB size. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4692122..66446af 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -

[Qemu-devel] [RFC PATCH v0 1/2] spapr: Allocate HTAB from machine init

2015-09-21 Thread Bharata B Rao
Allocate HTAB from ppc_spapr_init() so that we can abort the guest if requested HTAB size is't allocated by the host. However retain the htab reset call in spapr_reset_htab() so that HTAB gets reset (and not allocated) during machine reset. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c

Re: [Qemu-devel] [RFC PATCH v0 1/2] spapr: Allocate HTAB from machine init

2015-09-23 Thread Bharata B Rao
On Wed, Sep 23, 2015 at 01:28:53PM +1000, David Gibson wrote: > On Tue, Sep 22, 2015 at 09:09:48AM +0530, Bharata B Rao wrote: > > Allocate HTAB from ppc_spapr_init() so that we can abort the guest > > if requested HTAB size is't allocated by the host. However retain the &g

Re: [Qemu-devel] [RFC PATCH v0 2/2] spapr: Abort when HTAB of requested size isn't allocated

2015-09-23 Thread Bharata B Rao
On Wed, Sep 23, 2015 at 01:29:51PM +1000, David Gibson wrote: > On Tue, Sep 22, 2015 at 09:09:49AM +0530, Bharata B Rao wrote: > > Terminate the guest when HTAB of requested size isn't allocated by > > the host. > > > > When memory hotplug is attempted on a gue

Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration

2015-09-23 Thread Bharata B Rao
On Wed, Aug 26, 2015 at 01:24:08PM -0300, Eduardo Habkost wrote: > Applied to the numa tree, with the following changes in the commit > message: > > Subject was changed to: > pc-dimm: Fail realization for invalid nodes in non-NUMA config > to make it shorter. Hmm I don't see it here: https://gi

[Qemu-devel] [RFC PATCH v1 0/2] spapr: Abort when HTAB size requirement can't be met

2015-09-24 Thread Bharata B Rao
alloc_htab() to spapr_reset_htab() where it originally belonged. v0: http://lists.nongnu.org/archive/html/qemu-devel/2015-09/msg05491.html Bharata B Rao (2): spapr: Allocate HTAB from machine init spapr: Abort when HTAB of requested size isn't allocated hw/ppc/spapr.c | 42 +

[Qemu-devel] [RFC PATCH v1 1/2] spapr: Allocate HTAB from machine init

2015-09-24 Thread Bharata B Rao
Allocate HTAB from ppc_spapr_init() so that we can abort the guest if requested HTAB size is't allocated by the host. However retain the htab reset call in spapr_reset_htab() so that HTAB gets reset (and not allocated) during machine reset. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c

[Qemu-devel] [RFC PATCH v1 2/2] spapr: Abort when HTAB of requested size isn't allocated

2015-09-24 Thread Bharata B Rao
in a situation where memory hotplug fails due to less than requested HTAB size. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f6a5c29..3c60df2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -

[Qemu-devel] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense()

2015-09-06 Thread Bharata B Rao
te in entity_sense() by checking the allocation_state of DRC. (*) https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-September/133430.html Signed-off-by: Bharata B Rao Cc: Michael Roth --- hw/ppc/spapr_drc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_dr

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

Re: [Qemu-devel] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense()

2015-09-08 Thread Bharata B Rao
On Tue, Sep 08, 2015 at 05:03:25PM -0500, Michael Roth wrote: > Quoting Michael Roth (2015-09-08 16:03:56) > > Quoting David Gibson (2015-09-07 20:22:50) > > > On Mon, Sep 07, 2015 at 11:37:04AM +0530, Bharata B Rao wrote: > > > > When drmgr is run in the guest to add

Re: [Qemu-devel] [PATCH v2] spapr_drc: don't allow 'empty' DRCs to be unisolated

2015-09-08 Thread Bharata B Rao
by handling things as PAPR defines (13.7 and 13.7.3.1). > > Cc: qemu-...@nongnu.org > Cc: David Gibson > Cc: Bharata B Rao > Signed-off-by: Michael Roth Tested-by: Bharata B Rao

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

2015-09-08 Thread Bharata B Rao
On Fri, Sep 04, 2015 at 03:31:24PM +1000, David Gibson wrote: > On Thu, Aug 06, 2015 at 10:57:07AM +0530, 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()

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

2015-09-08 Thread Bharata B Rao
On Fri, Sep 04, 2015 at 04:03:43PM +1000, David Gibson wrote: > On Thu, Aug 06, 2015 at 10:57:08AM +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 v4 04/11] cpus: Add a sync version of cpu_remove()

2015-09-08 Thread Bharata B Rao
On Fri, Sep 04, 2015 at 04:11:38PM +1000, David Gibson wrote: > On Thu, Aug 06, 2015 at 10:57:10AM +0530, Bharata B Rao wrote: > > 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_

Re: [Qemu-devel] [RFC PATCH v4 08/11] spapr: CPU hotplug support

2015-09-08 Thread Bharata B Rao
On Fri, Sep 04, 2015 at 04:58:38PM +1000, David Gibson wrote: > On Thu, Aug 06, 2015 at 10:57:14AM +0530, Bharata B Rao wrote: > > Support CPU hotplug via device-add command. Set up device tree > > entries for the hotplugged CPU core and use the exising EPOW event > > infra

Re: [Qemu-devel] [RFC PATCH v4 09/11] spapr: Support topologies with unfilled cores

2015-09-08 Thread Bharata B Rao
On Fri, Sep 04, 2015 at 10:44:57AM +0200, Thomas Huth wrote: > On 04/09/15 09:01, David Gibson wrote: > > On Thu, Aug 06, 2015 at 10:57:15AM +0530, Bharata B Rao wrote: > >> QEMU currently supports CPU topologies where there can be cores > >> which are not completely fil

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

2015-09-09 Thread Bharata B Rao
On Wed, Sep 09, 2015 at 03:41:30PM +0800, Zhu Guihua wrote: > > On 09/09/2015 01:52 PM, Bharata B Rao wrote: > >On Fri, Sep 04, 2015 at 03:31:24PM +1000, David Gibson wrote: > >>On Thu, Aug 06, 2015 at 10:57:07AM +0530, Bharata B Rao wrote: > >>>CPUState *cpu g

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

2015-09-10 Thread Bharata B Rao
(cc trimmed since this looks like an issue that is contained within QEMU) On Tue, Sep 08, 2015 at 03:13:56PM +0100, Dr. David Alan Gilbert wrote: > * Bharata B Rao (bhar...@linux.vnet.ibm.com) wrote: > > On Tue, Sep 08, 2015 at 01:46:52PM +0100, Dr. David Alan Gilbert wrote: > > &g

Re: [Qemu-devel] [RFC PATCH] spapr: Reduce creation of LMB DR connectors from O(n^3) to O(n^2)

2015-09-11 Thread Bharata B Rao
2) is still kind of crappy, but it's enough to reduce the startup time > of qemu with maxmem=2T from ~20 minutes to ~4 seconds. > > Signed-off-by: David Gibson > Cc: Bharata B Rao > --- > hw/ppc/spapr_drc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) &

Re: [Qemu-devel] [RFCv2 2/2] spapr: Don't use QOM [*] syntax for DR connectors.

2015-09-13 Thread Bharata B Rao
already know is unique we can > avoid the [*] special behaviour. That lets us reduce the total time for > creating the DR objects from O(n^3) to O(n^2). > > O(n^2) is still kind of crappy, but it's enough to reduce the startup time > of qemu with maxmem=2T from ~20 minutes to ~4

Re: [Qemu-devel] [RFCv2 2/2] spapr: Don't use QOM [*] syntax for DR connectors.

2015-09-13 Thread Bharata B Rao
On Mon, Sep 14, 2015 at 02:14:59PM +1000, David Gibson wrote: > On Mon, Sep 14, 2015 at 09:37:16AM +0530, Bharata B Rao wrote: > > On Mon, Sep 14, 2015 at 11:41:53AM +1000, David Gibson wrote: > > > The dynamic reconfiguration (hotplug) code for the pseries machine type > >

Re: [Qemu-devel] [RFCv2 1/2] spapr: Remove unnecessary owner field from sPAPRDRConnector

2015-09-13 Thread Bharata B Rao
owner object. That means that owner is always the same as the QOM > parent, and so redundant. > > Signed-off-by: David Gibson Tested CPU and memory hotplug with reboot and migration. Tested-by: Bharata B Rao

[Qemu-devel] [RFC PATCH v0 3/3] spapr: Memory hot-unplug support

2015-08-18 Thread Bharata B Rao
Add support to hot remove pc-dimm memory devices. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 114 - hw/ppc/spapr_drc.c | 21 + include/hw/ppc/spapr.h | 2 + 3 files changed, 136 insertions(+), 1 deletion(-) diff

[Qemu-devel] [RFC PATCH v0 1/3] pc-dimm: Add a field to PCDIMMDevice to mark device deletion state

2015-08-18 Thread Bharata B Rao
-by: Bharata B Rao --- include/hw/mem/pc-dimm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index d83bf30..4ca9316 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -56,6 +56,7 @@ typedef struct PCDIMMDevice

[Qemu-devel] [RFC PATCH v0 0/3] sPAPR: Memory hot removal support

2015-08-18 Thread Bharata B Rao
DIMM device which is being unplugged. This causes some churn in the guest when the LMB that didn't belong to the DIMM device was offlined and later brought online again by drmgr when QEMU fails the release of the corresponding DRC object. Bharata B Rao (3): pc-dimm: Add a field to PCDIMMDevic

[Qemu-devel] [RFC PATCH v0 2/3] spapr-rtas: Enable rtas_set_indicator() to return correct error

2015-08-19 Thread Bharata B Rao
Should we change this return value to uint32_t to match with rtas_st() argument ? Signed-off-by: Bharata B Rao --- hw/ppc/spapr_rtas.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index e99e25f..96729b4 100644 ---

[Qemu-devel] [RFC PATCH v0] spapr: Disable memory hotplug when HTAB size is insufficient

2015-08-24 Thread Bharata B Rao
he hotplug. Until the in-kernel memory hotplug is available for PowerKVM, disable memory hotplug when requested hash table size isn't allocated. Signed-off-by: Bharata B Rao Cc: Nathan Fontenot --- Applies against spapr-next branch of David Gibson's tree. hw/ppc/spapr.c | 16

[Qemu-devel] [FIX PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add

2015-08-25 Thread Bharata B Rao
NULL FDT and return failure from configure_connector call. Signed-off-by: Bharata B Rao Cc: Michael Roth --- Not fully sure if RTAS_OUT_HW_ERROR is the right error code here. Should we be using RTAS_OUT_NOT_SUPPORTED instead ? hw/ppc/spapr_rtas.c | 6 ++ 1 file changed, 6 insertions

Re: [Qemu-devel] [RFC PATCH v0 1/3] pc-dimm: Add a field to PCDIMMDevice to mark device deletion state

2015-08-25 Thread Bharata B Rao
On Mon, Aug 24, 2015 at 09:30:35PM -0500, Michael Roth wrote: > Quoting Bharata B Rao (2015-08-19 01:56:09) > > Add a field to PCDIMMDevice to note that the device has been marked > > for removal. This will be used by PowerPC memory hotplug code to > > honour the LMB removal r

Re: [Qemu-devel] [RFC PATCH v0 3/3] spapr: Memory hot-unplug support

2015-08-26 Thread Bharata B Rao
On Mon, Aug 24, 2015 at 09:39:31PM -0500, Michael Roth wrote: > Quoting Bharata B Rao (2015-08-19 01:56:11) > > Add support to hot remove pc-dimm memory devices. > > > > Signed-off-by: Bharata B Rao > > --- > &

Re: [Qemu-devel] [FIX PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add

2015-08-26 Thread Bharata B Rao
On Wed, Aug 26, 2015 at 09:17:09AM -0500, Michael Roth wrote: > Quoting Bharata B Rao (2015-08-25 23:04:11) > > If drmgr is used in the guest to hotplug a device before a device_add > > has been issued via the QEMU monitor, QEMU segfaults in configure_connector > > cal

[Qemu-devel] [FIX v1 PATCH] spapr_rtas: Prevent QEMU crash during hotplug without a prior device_add

2015-08-30 Thread Bharata B Rao
NULL FDT and return failure from configure_connector call. As per PAPR+, an error value of -9003 seems appropriate for this failure. Signed-off-by: Bharata B Rao Cc: Michael Roth --- Changes in v1: - Use error value of -9003 instead of RTAS_OUT_HW_ERROR. v0: http://lists.nongnu.org/archive

Re: [Qemu-devel] [RFC PATCH v0] spapr: Disable memory hotplug when HTAB size is insufficient

2015-09-01 Thread Bharata B Rao
On Mon, Aug 24, 2015 at 09:01:51AM +0530, Bharata B Rao wrote: > The hash table size allocated to guest depends on the maxmem size. > If the host isn't able to allocate the required hash table size but > instead allocates less than the optimal requested size, then it will > not be

Re: [Qemu-devel] [PULL 00/22] QOM CPUState patch queue 2015-07-06

2015-07-06 Thread Bharata B Rao
On Tue, Jul 7, 2015 at 7:55 AM, Peter Crosthwaite wrote: > On Mon, Jul 6, 2015 at 5:24 PM, Andreas Färber wrote: >> Am 07.07.2015 um 01:13 schrieb Andreas Färber: >>> Hello Peter, >>> >>> This is my QOM CPU patch queue. Please pull. >>> >>> Note: For time reasons I did not give this queue as much

Re: [Qemu-devel] [PULL v2 05/22] cpu: Convert cpu_index into a bitmap

2015-07-08 Thread Bharata B Rao
On Wed, Jul 08, 2015 at 09:07:30PM +0200, Andreas Färber wrote: > Am 07.07.2015 um 19:16 schrieb Andreas Färber: > > From: Bharata B Rao > > > > Currently CPUState::cpu_index is monotonically increasing and a newly > > created CPU always gets the next higher index. T

Re: [Qemu-devel] [PULL 5/6] numa: Store boot memory address range in node_info

2015-07-09 Thread Bharata B Rao
On Thu, Jul 09, 2015 at 04:12:09PM +0200, Paolo Bonzini wrote: > > > On 03/07/2015 22:50, Eduardo Habkost wrote: > > From: Bharata B Rao > > > > Store memory address range information of boot memory in address > > range list of numa_info. > > > >

[Qemu-devel] [FIX PATCH] numa: Fix memory leak in numa_set_mem_node_id()

2015-07-09 Thread Bharata B Rao
Fix a memory leak in numa_set_mem_node_id(). Signed-off-by: Bharata B Rao --- numa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/numa.c b/numa.c index 3c80059..402804b 100644 --- a/numa.c +++ b/numa.c @@ -54,7 +54,7 @@ NodeInfo numa_info[MAX_NODES]; void

Re: [Qemu-devel] [PULL v3 05/22] cpu: Convert cpu_index into a bitmap

2015-07-14 Thread Bharata B Rao
On Thu, Jul 09, 2015 at 03:23:55PM +0200, Andreas Färber wrote: > From: Bharata B Rao > > Currently CPUState::cpu_index is monotonically increasing and a newly > created CPU always gets the next higher index. The next available > index is calculated by counting the existing numbe

Re: [Qemu-devel] [PULL v3 05/22] cpu: Convert cpu_index into a bitmap

2015-07-14 Thread Bharata B Rao
On Tue, Jul 14, 2015 at 5:17 PM, Igor Mammedov wrote: > On Tue, 14 Jul 2015 16:08:54 +0530 > Bharata B Rao wrote: > >> On Thu, Jul 09, 2015 at 03:23:55PM +0200, Andreas Färber wrote: >> > From: Bharata B Rao >> > >> > Currently CPUState::cpu_ind

[Qemu-devel] [RFC PATCH v0] spapr: Abort when hash table size requirement isn't met

2015-07-15 Thread Bharata B Rao
t due to which the migration fails. Prevent the above conditions by refusing to start the guest if the QEMU-requested hash table size requiement isn't met by the host. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/ppc

[Qemu-devel] memory hotplug fails with mem-merge option

2015-07-15 Thread Bharata B Rao
Hi, When I use -machine pc,mem-merge=off|on -m 1G,slots=4,maxmem=2G, adding memory-backend-ram object fails like below. Same failure is seen with -machine pseries,mem-merge=on|off. (qemu) object_add memory-backend-ram,id=ram0,size=1G qemu-system-x86_64: util/qemu-option.c:388: qemu_opt_get_bool_

Re: [Qemu-devel] [RFC PATCH v0] spapr: Abort when hash table size requirement isn't met

2015-07-16 Thread Bharata B Rao
On Wed, Jul 15, 2015 at 03:27:13PM +0530, Bharata B Rao wrote: > [This patch addresses an issue which is not prominently seen in mainline, > but seen frequently only in David's spapr-next branch. Though it is possible > to see this issue with mainline too, the current version of

Re: [Qemu-devel] memory hotplug fails with mem-merge option

2015-07-16 Thread Bharata B Rao
On Thu, Jul 16, 2015 at 10:25:09AM +0530, Bharata B Rao wrote: > Hi, > > When I use -machine pc,mem-merge=off|on -m 1G,slots=4,maxmem=2G, adding > memory-backend-ram object fails like below. Same failure is seen with > -machine pseries,mem-merge=on|off. > > (qemu) object_a

Re: [Qemu-devel] memory hotplug fails with mem-merge option

2015-07-17 Thread Bharata B Rao
On Fri, Jul 17, 2015 at 10:26:16AM +0300, Marcel Apfelbaum wrote: > On 07/16/2015 03:24 PM, Igor Mammedov wrote: > >On Thu, 16 Jul 2015 16:00:07 +0530 > >Bharata B Rao wrote: > > > >>On Thu, Jul 16, 2015 at 10:25:09AM +0530, Bharata B Rao wrote: > >>>

[Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration

2015-07-17 Thread Bharata B Rao
pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too. Signed-off-by: Bharata B Rao --- hw/mem/pc-dimm.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[Qemu-devel] [PATCH v2] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory

2014-07-10 Thread Shreyas B. Prabhu
board that uses memory_region_init_ram directly, -mem-path is not supported. Fix this by replacing memory_region_init_ram with memory_region_allocate_system_memory. Signed-off-by: Shreyas B. Prabhu --- Changes in v2: Dropping changes from hw/ppc/spapr.c based on the comment. hw/ppc/e500.c

Re: [Qemu-devel] [PATCH v2] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory

2014-07-10 Thread Shreyas B Prabhu
On Thursday 10 July 2014 05:34 PM, Alexander Graf wrote: > > On 10.07.14 14:01, Shreyas B. Prabhu wrote: >> Commit 0b183fc871:"memory: move mem_path handling to >> memory_region_allocate_system_memory" split memory_region_init_ram and >> memory_region_init_ram

[Qemu-devel] [PATCH] ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory

2014-07-10 Thread Shreyas B. Prabhu
board that uses memory_region_init_ram directly, -mem-path is not supported. Fix this by replacing memory_region_init_ram with memory_region_allocate_system_memory. Signed-off-by: Shreyas B. Prabhu --- hw/ppc/e500.c | 3 +-- hw/ppc/mac_newworld.c | 7 +++ hw/ppc/mac_oldwor

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