From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: [PULL v2 02/15] Deprecate pmem=on with non-DAX capable backend file
Date: Thu, 8 Jul 2021 15:55:39 -0400 [thread overview]
Message-ID: <20210708195552.2730970-3-ehabkost@redhat.com> (raw)
In-Reply-To: <20210708195552.2730970-1-ehabkost@redhat.com>
From: Igor Mammedov <imammedo@redhat.com>
It is not safe to pretend that emulated NVDIMM supports
persistence while backend actually failed to enable it
and used non-persistent mapping as fall back.
Instead of falling-back, QEMU should be more strict and
error out with clear message that it's not supported.
So if user asks for persistence (pmem=on), they should
store backing file on NVDIMM.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210111203332.740815-1-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
docs/system/deprecated.rst | 18 ++++++++++++++++++
util/mmap-alloc.c | 2 ++
2 files changed, 20 insertions(+)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index 70e08baff62..94fb7dbf4e6 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -221,6 +221,24 @@ This machine is deprecated because we have enough AST2500 based OpenPOWER
machines. It can be easily replaced by the ``witherspoon-bmc`` or the
``romulus-bmc`` machines.
+Backend options
+---------------
+
+Using non-persistent backing file with pmem=on (since 6.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+This option is used when ``memory-backend-file`` is consumed by emulated NVDIMM
+device. However enabling ``memory-backend-file.pmem`` option, when backing file
+is (a) not DAX capable or (b) not on a filesystem that support direct mapping
+of persistent memory, is not safe and may lead to data loss or corruption in case
+of host crash.
+Options are:
+
+ - modify VM configuration to set ``pmem=off`` to continue using fake NVDIMM
+ (without persistence guaranties) with backing file on non DAX storage
+ - move backing file to NVDIMM storage and keep ``pmem=on``
+ (to have NVDIMM with persistence guaranties).
+
Device options
--------------
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 838e286ce51..893d864354a 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -225,6 +225,8 @@ static void *mmap_activate(void *ptr, size_t size, int fd,
"crash.\n", file_name);
g_free(proc_link);
g_free(file_name);
+ warn_report("Using non DAX backing file with 'pmem=on' option"
+ " is deprecated");
}
/*
* If mmap failed with MAP_SHARED_VALIDATE | MAP_SYNC, we will try
--
2.31.1
next prev parent reply other threads:[~2021-07-08 20:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 19:55 [PULL v2 00/15] Machine queue, 2021-07-07 Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 01/15] vmbus: Don't make QOM property registration conditional Eduardo Habkost
2021-07-08 19:55 ` Eduardo Habkost [this message]
2021-07-08 19:55 ` [PULL v2 03/15] memory: Introduce RamDiscardManager for RAM memory regions Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 04/15] memory: Helpers to copy/free a MemoryRegionSection Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 05/15] virtio-mem: Factor out traversing unplugged ranges Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 06/15] virtio-mem: Don't report errors when ram_block_discard_range() fails Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 07/15] virtio-mem: Implement RamDiscardManager interface Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 08/15] vfio: Support for RamDiscardManager in the !vIOMMU case Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 09/15] vfio: Query and store the maximum number of possible DMA mappings Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 10/15] vfio: Sanity check maximum number of DMA mappings with RamDiscardManager Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 11/15] vfio: Support for RamDiscardManager in the vIOMMU case Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 12/15] softmmu/physmem: Don't use atomic operations in ram_block_discard_(disable|require) Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 13/15] softmmu/physmem: Extend ram_block_discard_(require|disable) by two discard types Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 14/15] virtio-mem: Require only coordinated discards Eduardo Habkost
2021-07-08 19:55 ` [PULL v2 15/15] vfio: Disable only uncoordinated discards for VFIO_TYPE1 iommus Eduardo Habkost
2021-07-10 15:05 ` [PULL v2 00/15] Machine queue, 2021-07-07 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210708195552.2730970-3-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).