From nobody Wed Dec 17 00:23:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 153974317618774.53752658489918; Tue, 16 Oct 2018 19:26:16 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EB2C7CBB6; Wed, 17 Oct 2018 02:26:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6029360490; Wed, 17 Oct 2018 02:26:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 294054CA94; Wed, 17 Oct 2018 02:26:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9H2NP67022739 for ; Tue, 16 Oct 2018 22:23:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 156D179B52; Wed, 17 Oct 2018 02:23:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C40371D5B for ; Wed, 17 Oct 2018 02:23:22 +0000 (UTC) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AD33C058CB9 for ; Wed, 17 Oct 2018 02:23:21 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 19:23:21 -0700 Received: from zly-optiplex-9020.bj.intel.com ([10.238.135.151]) by FMSMGA003.fm.intel.com with ESMTP; 16 Oct 2018 19:23:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,389,1534834800"; d="scan'208";a="88901805" From: Luyao Zhong To: libvir-list@redhat.com Date: Wed, 17 Oct 2018 10:21:43 +0800 Message-Id: <1539742905-15644-2-git-send-email-luyao.zhong@intel.com> In-Reply-To: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> References: <1539742905-15644-1-git-send-email-luyao.zhong@intel.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 17 Oct 2018 02:23:21 +0000 (UTC) for IP:'192.55.52.115' DOMAIN:'mga14.intel.com' HELO:'mga14.intel.com' FROM:'luyao.zhong@intel.com' RCPT:'' X-RedHat-Spam-Score: -5.001 (RCVD_IN_DNSWL_HI, SPF_PASS) 192.55.52.115 mga14.intel.com 192.55.52.115 mga14.intel.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Luyao Zhong , Zhong@redhat.com Subject: [libvirt] [RFC 1/3] xml: introduce more config elements for NVDIMM memory X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 Oct 2018 02:26:14 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In order to align with QEMU ,four more parameters about NVDIMM will be introduced into Libvirt xml. 1.alignsize The 'alignsize' option allows users to specify the proper alignment. When mmap(2) the backend files, QEMU uses the host page size by default as the alignment of mapping address. However, some backends may require alignments different from the pagesize. For example, mmap a device DAX on NVDIMM maybe 2M-aligned. 2.pmem The 'pmem' option allows users to specify whether the backend storage of memory-backend-file is a real persistent memory that can be accessed in SNIA NVM Programming Model. If the vNVDIMM backend is in host persistent memory , and 'pmem' is 'on' and QEMU is built with libpmem, qemu will guarantee the persistence of its own writes to the vNVDIMM backend. 3.persistence The 'persistence' option allows users to set platform-supported features about NVDIMM data persistence of a guest. It has two values, 'mem-ctrl' means the platform supports flushing dirty data from the memory controller to the NVDIMMs in the event of power loss, 'cpu' means The platform supports flushing dirty data from the CPU cache to the NVDIMMs in the event of power loss, which contains what 'mem-ctrl' means. 4.unarmed The 'unarmed' option allows users to mark vNVDIMM read-only. Only one type of vNVDIMM backends can guarantee the guest write persistence, which is the device DAX on the real NVDIMM device (e.g., /dev/dax0.0). When using other types of backends, it's suggested to set 'unarmed' option to 'on', so the guest Linux NVDIMM driver will mark such vNVDIMM device as read-only. For more details, see https://github.com/qemu/qemu/blob/master/docs/nvdimm.txt Signed-off-by: Zhong,Luyao --- docs/formatdomain.html.in | 98 ++++++++++++++++++++++++++++++++++++---= ---- docs/schemas/domaincommon.rng | 31 ++++++++++++-- 2 files changed, 111 insertions(+), 18 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8189959..9dec984 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8258,6 +8258,8 @@ qemu-kvm -net nic,model=3D? /dev/null <memory model=3D'nvdimm'> <source> <path>/tmp/nvdimm</path> + <alignsize unit=3D'KiB'>2048</alignsize> + <pmem>on</pmem> </source> <target> <size unit=3D'KiB'>524288</size> @@ -8265,6 +8267,8 @@ qemu-kvm -net nic,model=3D? /dev/null <label> <size unit=3D'KiB'>128</size> </label> + <persistence>cpu</persistence> + <unarmed>on</unarmed> </target> </memory> </devices> @@ -8339,10 +8343,38 @@ qemu-kvm -net nic,model=3D? /dev/null =20

- For model nvdimm this element is mandatory and has a - single child element path that represents a path - in the host that backs the nvdimm module in the guest. + For model nvdimm this element is mandatory. The + mandatory child element path represents a path in + the host that backs the nvdimm module in the guest. If + nvdimm is provided, then the following optional + elements can be provided as well:

+ +
+
alignsize
+
+

+ This element can be used to specify a proper alignment. + When mmap(2) the backend files, QEMU uses the host page + size by default as the alignment of mapping address. However, + some backends may require alignments different from the page. + For example, mmap a device DAX on NVDIMM maybe 2M-aligned. +

+
+ +
pmem
+
+

+ This element can be used to specify whether the backend stor= age + of memory-backend-file is a real persistent memory that can = be + accessed in SNIA NVM Programming Model. If the backend is a= real + persistence memory and pmem is set to 'on', QEM= U will + guarantee the persistence of its own writes to the vNVDIMM b= ackend, + but which can work well with libpmem support (QEMU configure= d with + --enable-libpmem). +

+
+
=20
target
@@ -8361,19 +8393,55 @@ qemu-kvm -net nic,model=3D? /dev/null NUMA nodes configured.

- For NVDIMM type devices one can optionally use - label and its subelement size - to configure the size of namespaces label storage - within the NVDIMM module. The size element - has usual meaning described - here. - For QEMU domains the following restrictions apply: + Besides, the following optional elements can be provided as well= for + NVDIMM type devices:

-
    -
  1. the minimum label size is 128KiB,
  2. -
  3. the remaining size (total-size - label-size) has to be align= ed to - 4KiB
  4. -
+ +
+
label
+
+

+ For NVDIMM type devices one can optionally use + label and its subelement size + to configure the size of namespaces label storage + within the NVDIMM module. The size element + has usual meaning described + here. + For QEMU domains the following restrictions apply: +

+
    +
  1. the minimum label size is 128KiB,
  2. +
  3. the remaining size (total-size - label-size) will be ali= gned to + 4KiB as default.
  4. +
+
+ +
persistence
+
+

+ The persistence element can be set to "mem-ctl"= or "cpu", + which indicate platform-supported features about NVDIMM data= persistence. + 'mem-ctrl' means the platform supports flushing dirty data f= rom the memory + controller to the NVDIMMs in the event of power loss, 'cpu' = means The platform + supports flushing dirty data from the CPU cache to the NVDIM= Ms in the event + of power loss, which contains what 'mem-ctrl' means. + ACPI 6.2 Errata A added support for a new Platform Capabilit= ies Structure + in NFIT, so the guest ACPI NFIT will be filled in according = to the persistence + option. +

+
+ +
unarmed
+
+

+ The unarmed element can be used to mark vNVDIMM= read-only + through setting unarmed flag in guest NFIT.Currently the onl= y vNVDIMM backend + can guarantee the guest write persistence is device DAX on L= inux, so it's + suggested to set unarmed to 'on' when using oth= er types of + backends. +

+
+
=20 diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 099a949..cca7869 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5353,9 +5353,21 @@ - - - + + + + + + + + + + + + + + + @@ -5379,6 +5391,19 @@ + + + + mem-ctrl + cpu + + + + + + + + --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list