From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH v2 06/11] nvdimm acpi: initialize the resource used by NVDIMM ACPI Date: Fri, 19 Feb 2016 10:08:37 +0200 Message-ID: <20160219100211-mutt-send-email-mst@redhat.com> References: <20160215133722-mutt-send-email-mst@redhat.com> <20160215143234.29320a5f@nial.brq.redhat.com> <56C1F469.2040602@linux.intel.com> <20160215182404.0878474f@nial.brq.redhat.com> <56C21A7D.5040902@linux.intel.com> <20160216120047.5a50eccf@nial.brq.redhat.com> <56C3D522.6090401@linux.intel.com> <20160217192356-mutt-send-email-mst@redhat.com> <56C54298.3000904@linux.intel.com> <20160218110523.058a4716@nial.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Xiao Guangrong , ehabkost@redhat.com, kvm@vger.kernel.org, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net To: Igor Mammedov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45800 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424890AbcBSIIm (ORCPT ); Fri, 19 Feb 2016 03:08:42 -0500 Content-Disposition: inline In-Reply-To: <20160218110523.058a4716@nial.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Feb 18, 2016 at 11:05:23AM +0100, Igor Mammedov wrote: > On Thu, 18 Feb 2016 12:03:36 +0800 > Xiao Guangrong wrote: >=20 > > On 02/18/2016 01:26 AM, Michael S. Tsirkin wrote: > > > On Wed, Feb 17, 2016 at 10:04:18AM +0800, Xiao Guangrong wrote: =20 > > >>>>> As for the rest could that commands go via MMIO that we usual= ly > > >>>>> use for control path? =20 > > >>>> > > >>>> So both input data and output data go through single MMIO, we = need to > > >>>> introduce a protocol to pass these data, that is complex? > > >>>> > > >>>> And is any MMIO we can reuse (more complexer=EF=BC=9F) or we s= hould allocate this > > >>>> MMIO page =EF=BC=88the old question - where to allocated?=EF=BC= =89? =20 > > >>> Maybe you could reuse/extend memhotplug IO interface, > > >>> or alternatively as Michael suggested add a vendor specific PCI= _Config, > > >>> I'd suggest PM device for that (hw/acpi/[piix4.c|ihc9.c]) > > >>> which I like even better since you won't need to care about whi= ch ports > > >>> to allocate at all. =20 > > >> > > >> Well, if Michael does not object, i will do it in the next versi= on. :) =20 > > > > > > Sorry, the thread's so long by now that I'm no longer sure what d= oes "it" refer to. =20 > >=20 > > Never mind i saw you were busy on other loops. > >=20 > > "It" means the suggestion of Igor that "map each label area right a= fter each > > NVDIMM's data memory" > Michael pointed out that putting label right after each NVDIMM > might burn up to 256GB of address space due to DIMM's alignment for 2= 56 NVDIMMs. > However if address for each label is picked with pc_dimm_get_free_add= r() > and label's MemoryRegion alignment is default 2MB then all labels > would be allocated close to each other within a single 1GB range. >=20 > That would burn only 1GB for 500 labels which is more than possible 2= 56 NVDIMMs. I thought about it, once we support hotplug, this means that one will have to pre-declare how much is needed so QEMU can mark the correct memory reserved, that would be nasty. Maybe we always pre-reserve 1Gbyt= e. Okay but next time we need something, do we steal another Gigabyte? It seems too much, I'll think it over on the weekend. Really, most other devices manage to get by with 4K chunks just fine, I don't see why do we are so special and need to steal gigabytes of physically contigious phy ranges. > Assuming labels are mapped before storage MemoryRegion is mapped, lay= out with 1Gb hugepage backend CLI > -device nvdimm,size=3D1G -device nvdimm,size=3D1G -device nvdimm,si= ze=3D1G > would look like: >=20 > 0 2M 4M 1G 2G 3G 4G > L1 | L2 | L3 ... | NV1 | NV2 | NV3 | >=20 > > so we do not emulate it in QEMU and is good for the performance > > of label these are the points i like. However it also brings comple= xity/limitation for > > later DSM commands supports since both dsm input & output need to g= o through single MMIO. > >=20 > > Your idea? > >=20