On Mon, Apr 13, 2015 at 04:55:52PM +0200, Igor Mammedov wrote: > On Mon, 13 Apr 2015 19:57:05 +0530 > Bharata B Rao <bhar...@linux.vnet.ibm.com> wrote: > > > On Mon, Apr 13, 2015 at 04:04:24PM +0200, Igor Mammedov wrote: > > > On Mon, 13 Apr 2015 08:29:33 +0530 > > > Bharata B Rao <bhar...@linux.vnet.ibm.com> wrote: > > > > > > > On Wed, Mar 25, 2015 at 04:58:18PM +1100, David Gibson wrote: > > > > > On Mon, Mar 23, 2015 at 07:06:02PM +0530, Bharata B Rao wrote: > > > > > > 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 <bhar...@linux.vnet.ibm.com> > > > > > > --- > > > > > > default-configs/ppc64-softmmu.mak | 1 + > > > > > > hw/ppc/spapr.c | 50 > > > > > > +++++++++++++++++++++++++++++++++++++++ > > > > > > include/hw/ppc/spapr.h | 12 ++++++++++ > > > > > > 3 files changed, 63 insertions(+) > > > > > > > > > > > > diff --git a/default-configs/ppc64-softmmu.mak > > > > > > b/default-configs/ppc64-softmmu.mak > > > > > > index 22ef132..16b3011 100644 > > > > > > --- a/default-configs/ppc64-softmmu.mak > > > > > > +++ b/default-configs/ppc64-softmmu.mak > > > > > > @@ -51,3 +51,4 @@ CONFIG_XICS_KVM=$(and > > > > > > $(CONFIG_PSERIES),$(CONFIG_KVM)) > > > > > > # For PReP > > > > > > CONFIG_MC146818RTC=y > > > > > > CONFIG_ISA_TESTDEV=y > > > > > > +CONFIG_MEM_HOTPLUG=y > > > > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > > > > > index 3e56d9e..e43bb49 100644 > > > > > > --- a/hw/ppc/spapr.c > > > > > > +++ b/hw/ppc/spapr.c > > > > > > @@ -125,8 +125,13 @@ struct sPAPRMachineState { > > > > > > > > > > > > /*< public >*/ > > > > > > char *kvm_type; > > > > > > + ram_addr_t hotplug_memory_base; > > > > > > + MemoryRegion hotplug_memory; > > > > > > + bool enforce_aligned_dimm; > > > > > > }; > > > > > > > > > > > > +#define SPAPR_MACHINE_ENFORCE_ALIGNED_DIMM "enforce-aligned-dimm" > > > > > > > > > > What's the rationale for including this option? > > > > > > > > I couldn't see any use, but added it to be similar with x86. May be Igor > > > > can tell us ? > > > at least on x86 KVM requires memory region be aligned (otherwise it would > > > abort) > > > and also performance wise it's better to map regions at offsets aligned at > > > backend page size (especially applicable for hugepages). > > > > > > so region base on x86 is 1Gb aligned to support upto 1Gb hugepages. > > > > My question was specifically about the enforce-aligned-dimm object property > > that has a get method. I was wondering where this property is consumed. All > > I could see is that PCMachineState.enforce_aligned_dimm used/referenced > > directly. > I think that you don't heed it, it was introduce to to keep memory layout > compatible with old machine types that didn't have aligned memhp region. > > Since there is nothing to keep compatible in this target, you can just > drop property and always align region as fit for spapr.
That sounds like a good idea to me. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
pgpDvvhXHRSUb.pgp
Description: PGP signature