[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 1/4] pc-dimm: add 'reserved-size' to reserve
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC PATCH 1/4] pc-dimm: add 'reserved-size' to reserve address range after the ending address |
Date: |
Fri, 7 Apr 2017 14:46:41 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Thu, Apr 06, 2017 at 06:46:49PM +0800, Haozhong Zhang wrote:
> On 04/06/17 11:24 +0100, Stefan Hajnoczi wrote:
> > On Fri, Mar 31, 2017 at 04:41:44PM +0800, Haozhong Zhang wrote:
> > > If option 'reserved-size=RSVD' is present, QEMU will reserve an
> > > address range of size 'RSVD' after the ending address of pc-dimm
> > > device.
> > >
> > > For the following example,
> > > -object memory-backend-file,id=mem0,size=4G,...
> > > -device nvdimm,id=dimm0,memdev=mem0,reserved-size=4K,...
> >
> > "reserved-size" is not a clear name. I suggest calling the property
> > "num-flush-hints" (default 0). QEMU can calculate the actual size in
> > bytes.
> >
> > -device nvdimm,num-flush-hints=1
> >
> > QEMU will use one flush hint and reserve enough space (e.g. 1 page) for
> > the MMIO region.
> >
>
> Each flush hint can be as small as one cache line size which is also
> the size used in this patch series.
>
> We need to calculate the size of all flush hints in pc_dimm_memory_plug(),
> because when building the flush hint address structure we need to know
> the address of flush hints.
>
> IIUC, pc_dimm_memory_plug() is not specific to x86, so it's better
> take a general way to get the vcpu cache line size in pc_dimm_memory_plug(),
> which seemingly lacks in QEMU (though I believe it should be doable).
>
> To make things simple, I leave the size decision to users, and check
> whether it's large enough when building the flush hint address
> structures in patch 4.
Do you see my concern that "reserved-size" is not a good property?
* How does the user choose a sensible value?
* Why is it called "reserved-size" instead of "flush-hints-size"?
Stefan
signature.asc
Description: PGP signature