From nobody Thu Mar 28 21:11:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610397242; cv=none; d=zohomail.com; s=zohoarc; b=mvC/XnbeW191gvAePAk766r+xnaIkh2cPgsrDAJ3Uu6wwCyFZSWHEf1AkCcbIo2NyYBrIA9ysMGFlWayRc6ya43HUh7HLZUtRhpYy1MCcYh+TEm3B4xcihYfs2FNM4ixLMeig068f/K+ahzeJgHm8jV5cxZe94TziezpNZv1UyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610397242; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ZvuYC/PlqY5gmoh/A3aa5lYpn2jvm9KfOXjPjNNvGeA=; b=KlU4HG0wNJOs+PLFn7WB2QDGGnUO9uq9VAHO3754yHSb9pp3p7L/iSMP0u4FaiR27jkaHAtHdYgak8NqA8bk5f8ko50jSDJHCvAD9gLAmw8Z7XQYEg6ZEcbs0KNsEL9I1CpFYI8CElWqc7OuBTzUToFagZ1mmdguJ3WwT/+gfjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1610397242902140.3890733633027; Mon, 11 Jan 2021 12:34:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-qcjYSgaAO62IJ3N6RdV_xQ-1; Mon, 11 Jan 2021 15:33:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4B46D805EF1; Mon, 11 Jan 2021 20:33:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCEDE60BE2; Mon, 11 Jan 2021 20:33:45 +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 0F5C018095C7; Mon, 11 Jan 2021 20:33:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 10BKXcXh019848 for ; Mon, 11 Jan 2021 15:33:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 501E36EF61; Mon, 11 Jan 2021 20:33:38 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77F4A6F13C; Mon, 11 Jan 2021 20:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610397239; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZvuYC/PlqY5gmoh/A3aa5lYpn2jvm9KfOXjPjNNvGeA=; b=cAze/wsFr3TRW6KdOWKGlAPy2mN6aXNvw68NVIo5JR1gebBgzT79pCu+3v0uegxD4zSE+B NwsyQrsJHkA/zJg7gfIlvrMZkShEPJaIWV/AXc/jzILF4KG1pmskuhJLlz53khDTG3WTn3 xBF21px6aMtiLG6uGD/pZ16OYFuyZfE= X-MC-Unique: qcjYSgaAO62IJ3N6RdV_xQ-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH] Deprecate pmem=on with non-DAX capable backend file Date: Mon, 11 Jan 2021 15:33:32 -0500 Message-Id: <20210111203332.740815-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, pbonzini@redhat.com, thuth@redhat.com, philmd@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @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=3Don), they should store backing file on NVDIMM. Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: rephrase deprecation comment andwarning message (Philippe Mathieu-Daud=C3=A9 ) --- docs/system/deprecated.rst | 17 +++++++++++++++++ util/mmap-alloc.c | 3 +++ 2 files changed, 20 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index bacd76d7a5..e79fb02b3a 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -327,6 +327,23 @@ The Raspberry Pi machines come in various models (A, A= +, B, B+). To be able to distinguish which model QEMU is implementing, the ``raspi2`` and ``rasp= i3`` machines have been renamed ``raspi2b`` and ``raspi3b``. =20 +Backend options +--------------- + +Using non-persistent backing file with pmem=3Don (since 6.0) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +This option is used when ``memory-backend-file`` is consumed by emulated N= VDIMM +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 mapp= ing +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=3Doff`` to continue using fake= NVDIMM + (without persistence guaranties) with backing file on non DAX storage + - move backing file to NVDIMM storage and keep ``pmem=3Don`` + (to have NVDIMM with persistence guaranties). + Device options -------------- =20 diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 27dcccd8ec..0388cc3be2 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qemu/mmap-alloc.h" #include "qemu/host-utils.h" +#include "qemu/error-report.h" =20 #define HUGETLBFS_MAGIC 0x958458f6 =20 @@ -166,6 +167,8 @@ void *qemu_ram_mmap(int fd, "crash.\n", file_name); g_free(proc_link); g_free(file_name); + warn_report("Using non DAX backing file with 'pmem=3Don' optio= n" + " is deprecated"); } /* * if map failed with MAP_SHARED_VALIDATE | MAP_SYNC, --=20 2.27.0