From nobody Mon Feb 9 16:45:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=quarantine dis=quarantine) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1642507371; cv=none; d=zohomail.com; s=zohoarc; b=jxPtpg7h6VeNQ9GWEhQ7W991JCyA000pgg+AcND02fK+GsfszTtwn5J9hT8kAT2fbNE4ggF3KrLtEm9BKEt0Ng/7r7YeSwTgtXBsrEX/UkDXOCECAqNlExAJMltjkhqlvOEqK7evrsuayK4WBsM5qwedVnHxqm4hrChNxi4+NV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642507371; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NcmRGZy+w5AeQknLrQ9i8jkt7Fnk+/sozWPtjzwcvn4=; b=LgdcZkmoMUHSiogMP5474MIBBMfNK5yIR3zeYW//pzk4GJ/3cnvo18uA7S1EtlwgN4qgxnCdqlEEWh/g6CHGn/msLBRV/5rjI2md9aSvIJYrSbpoObvHE1YHHdUKXj7r4+uzyhRFQb1eHtMsRnq1IjASi8uEhkiqFkBUoodpR+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1642507371906795.5037351253316; Tue, 18 Jan 2022 04:02:51 -0800 (PST) Received: by mail-wm1-f54.google.com with SMTP id i187-20020a1c3bc4000000b0034d2ed1be2aso3758937wma.1 for ; Tue, 18 Jan 2022 04:02:51 -0800 (PST) Return-Path: Return-Path: Received: from nuc.. (154.red-83-50-83.dynamicip.rima-tde.net. [83.50.83.154]) by smtp.gmail.com with ESMTPSA id o5sm2133194wmc.39.2022.01.18.04.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 04:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NcmRGZy+w5AeQknLrQ9i8jkt7Fnk+/sozWPtjzwcvn4=; b=BUXPn5+k9O6T/sa1a4lmJrLzIg80wNuXg4gTsEOdPcYbo2s1mcLcWB5GXsxe4breGz Tc2eqhTkGtcKWHf1cQagvKtGosb2iOUO2MF4ej+9hnXrJS+4Rma/wpeTg3qz2qskOY0S qbtb2danPSYbH1CduBvib61PyDPkF/zwGEgAIeWeDvosZzBtFxx2Y9Hqt+NRSPsjUMAK /MYtIBzoThspJRyFcc4E9kE6+sfZbJe5HQPVghsCDDvJLPQZg0vU9A73E/l3qr9QpXX7 /7R7MTMZ3DCX645V2B7d9jAMCplTmDtyUbQLUEl8YpIAUiEaY25zk/FTXzAikN2o4W8h /udQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NcmRGZy+w5AeQknLrQ9i8jkt7Fnk+/sozWPtjzwcvn4=; b=d3N1DmO4kn/5fJc+wbXXNR7+WUnqRpVMvwGn2bYZA93bMDyJBLNOVRmhfl0/XjZZj9 FoBfLDSSglT9rzUMt5WlRb93lRZ5aA4IoWBfOGBa6/4ocKF7UbYrGaoEZDad56rWGzDE dpigI6ilub54wIvhx2OraAptNqMQz2VFAmywFvRotFpSXpMJe22Q1jdOMGUPBM407E/Q dH3rNqE32f4BWTiY0gXRi3mZZOJaxymIOMTP1TBT10XbSBOeaC6UBO1QJ5nUK6cODFmp +Cl4gTTl+YvGO+5ZMyu/eIZSoVliv5xykE7hp7VMMj3UwvaLUXuBNvIdHpBftXIipfUF wI8A== X-Gm-Message-State: AOAM533RiSOmxTEhLoR2a3RJ33bI3wJUBTbLMAL/LtLAMeajbn9Hqly9 ygZWBLTx1QHoMbOMVLfq8AU= X-Google-Smtp-Source: ABdhPJxcqCU+73oqEhIAjbPW2oGfth8yFjENXMIMJs5yBlSE5G0AeaQa+wbiUgNPzLMWiUSlccrxwg== X-Received: by 2002:adf:dfcd:: with SMTP id q13mr24365013wrn.487.1642507370197; Tue, 18 Jan 2022 04:02:50 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Xu , David Hildenbrand , Paolo Bonzini , qemu-block@nongnu.org, Richard Henderson , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 04/19] machine: Use host_memory_backend_is_mapped() in machine_consume_memdev() Date: Tue, 18 Jan 2022 13:02:14 +0100 Message-Id: <20220118120229.196337-5-f4bug@amsat.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118120229.196337-1-f4bug@amsat.org> References: <20220118120229.196337-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1642507373800100001 From: David Hildenbrand memory_region_is_mapped() is the wrong check, we actually want to check whether the backend is already marked mapped. For example, memory regions mapped via an alias, such as NVDIMMs, currently don't make memory_region_is_mapped() return "true". As the machine is initialized before any memory devices (and thereby before NVDIMMs are initialized), this isn't a fix but merely a cleanup. Reviewed-by: Richard Henderson Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Xu Signed-off-by: David Hildenbrand Message-Id: <20211102164317.45658-2-david@redhat.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index debcdc0e70a..d856485cb4d 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1091,7 +1091,7 @@ MemoryRegion *machine_consume_memdev(MachineState *ma= chine, { MemoryRegion *ret =3D host_memory_backend_get_memory(backend); =20 - if (memory_region_is_mapped(ret)) { + if (host_memory_backend_is_mapped(backend)) { error_report("memory backend %s can't be used multiple times.", object_get_canonical_path_component(OBJECT(backend))); exit(EXIT_FAILURE); --=20 2.34.1