From nobody Sat May 18 23:55:05 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=1609262963; cv=none; d=zohomail.com; s=zohoarc; b=aQcQmcOWB9J3TafvhGv/MGoVwMaV5Pi2JfvVrSDWL2ongUeAbxCfsrtYeBQ3URybhkWdMAajhm3RfSjP7G/P7gcgu9sV9vgecz3jvpp3D3/6yNovLVBEf/dmFDrmY1trzsY+aiWbUgGFMcq9W4b8j/QBtTi8mk4q1l0MmQ8zOxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609262963; 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=TbjAVIarQG6POD3GoFQHZuFlOfzLIE9bBaF9h96qeII=; b=K30lnQ1X9XM56teTql95ARo0rI5G156H7J8gy+UQuHbYDxaZllC9w8442xbkExx2Dyh1IT++MB1HsBWW06g73r+VfHKl1ZpNNbcDYrsNMGlngUMzILpKRjBcTnoVi4eiCoypKf+bk29/ZyA2YvkIiUAGPbMiGaCEdDhfqjKuA8U= 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 16092629634061010.2712020351794; Tue, 29 Dec 2020 09:29:23 -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-241-wphRFKUdMAybivLcxKx0Kw-1; Tue, 29 Dec 2020 12:29:19 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1EE0B801817; Tue, 29 Dec 2020 17:29:12 +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 38D9B6E417; Tue, 29 Dec 2020 17:29:11 +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 735EF180954D; Tue, 29 Dec 2020 17:29:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BTHT6Zd022761 for ; Tue, 29 Dec 2020 12:29:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id ABA725D762; Tue, 29 Dec 2020 17:29:06 +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 399A55D6AB; Tue, 29 Dec 2020 17:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609262962; 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=TbjAVIarQG6POD3GoFQHZuFlOfzLIE9bBaF9h96qeII=; b=MVt6trz/SE7lL3gtW7OrmO+iFHX4sL/a1unyovtkgp1RKOIFFayHJnAB5QiZ9rZftQk/aG xh3kUGxe/QEd8jH2YRHKs6eQo6wfl18xMrwPYPii3HqsUfZm4rsflD4I9O6m2mm4r462nI 7rb2730rXz5a8mKdmzqRQlmL5+awpAQ= X-MC-Unique: wphRFKUdMAybivLcxKx0Kw-1 From: Igor Mammedov To: qemu-devel@nongnu.org Subject: [PATCH] Deprecate pmem=on with non-DAX capable backend file Date: Tue, 29 Dec 2020 12:29:00 -0500 Message-Id: <20201229172900.571309-1-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, haozhong.zhang@intel.com, pbonzini@redhat.com, yi.z.zhang@linux.intel.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.13 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- docs/system/deprecated.rst | 14 ++++++++++++++ util/mmap-alloc.c | 3 +++ 2 files changed, 17 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index bacd76d7a5..ba4f6ed2fe 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -327,6 +327,20 @@ 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 not DAX capable or not on a filesystem that support direct mapping of p= ersistent +memory, is not safe and may lead to data loss or corruption in case of hos= t crash. +Using pmem=3Don option with such file will return error, instead of a warn= ing. +Options are to move backing file to NVDIMM storage or modify VM configurat= ion +to set ``pmem=3Doff`` to continue using fake NVDIMM without persistence gu= aranties. + Device options -------------- =20 diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 27dcccd8ec..d226273a98 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("Deprecated using non DAX backing file with" + " pmem=3Don option"); } /* * if map failed with MAP_SHARED_VALIDATE | MAP_SYNC, --=20 2.27.0