From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Blake Date: Mon, 03 May 2021 18:27:22 +0000 Subject: Re: [PATCH v4 3/3] nvdimm: Enable sync-dax device property for nvdimm Message-Id: List-Id: References: <161966810162.652.13723419108625443430.stgit@17be908f7c1c> <161966813983.652.5749368609701495826.stgit@17be908f7c1c> In-Reply-To: <161966813983.652.5749368609701495826.stgit@17be908f7c1c> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Shivaprasad G Bhat , david@gibson.dropbear.id.au, groug@kaod.org, qemu-ppc@nongnu.org, ehabkost@redhat.com, marcel.apfelbaum@gmail.com, mst@redhat.com, imammedo@redhat.com, xiaoguangrong.eric@gmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org, richard.henderson@linaro.org, pbonzini@redhat.com, stefanha@redhat.com, haozhong.zhang@intel.com, shameerali.kolothum.thodi@huawei.com, kwangwoo.lee@sk.com, armbru@redhat.com Cc: qemu-devel@nongnu.org, aneesh.kumar@linux.ibm.com, linux-nvdimm@lists.01.org, kvm-ppc@vger.kernel.org, shivaprasadbhat@gmail.com, bharata@linux.vnet.ibm.com On 4/28/21 10:49 PM, Shivaprasad G Bhat wrote: > The patch adds the 'sync-dax' property to the nvdimm device. > > When the sync-dax is 'direct' indicates the backend is synchronous DAX > capable and no explicit flush requests are required. When the mode is > set to 'writeback' it indicates the backend is not synhronous DAX synchronous > capable and explicit flushes to Hypervisor are required. > > On PPC where the flush requests from guest can be honoured by the qemu, s/the qemu/qemu/ > the 'writeback' mode is supported and set as the default. The device > tree property "hcall-flush-required" is added to the nvdimm node which > makes the guest to issue H_SCM_FLUSH hcalls to request for flushes s/to issue/issue/ s/request for/request/ > explicitly. This would be the default behaviour without sync-dax > property set for the nvdimm device. For old pSeries machine, the > default is 'unsafe'. > > For non-PPC platforms, the mode is set to 'unsafe' as the default. > > Signed-off-by: Shivaprasad G Bhat > --- > +++ b/qapi/common.json > @@ -197,3 +197,23 @@ > { 'enum': 'GrabToggleKeys', > 'data': [ 'ctrl-ctrl', 'alt-alt', 'shift-shift','meta-meta', 'scrolllock', > 'ctrl-scrolllock' ] } > + > +## > +# @NvdimmSyncModes: > +# > +# Indicates the mode of flush to be used to ensure persistence in case > +# of power failures. > +# > +# @unsafe: This is to indicate, the data on the backend device not be > +# consistent in power failure scenarios. s/This is to indicate, the/This indicates that/ s/device not/device might not/ > +# @direct: This is to indicate the backend device supports synchronous DAX > +# and no explicit flush requests from the guest is required. This indicates the backend device supports synchronous DAX, and no explicit flush requests from the guest are required. > +# @writeback: To be used when the backend device doesn't support synchronous > +# DAX. The hypervisor issues flushes to the disk when requested > +# by the guest. > +# Since: 6.0 6.1 > +# > +## > +{ 'enum': 'NvdimmSyncModes', > + 'data': [ 'unsafe', 'writeback', > + { 'name': 'direct', 'if': 'defined(CONFIG_LIBPMEM)' } ] } > > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org