From nobody Mon Feb 9 12:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1644354532; cv=none; d=zohomail.com; s=zohoarc; b=DzJbiwVOejmd299ZuEAVOf/GPImbMV3LQJsaGNzoUMIdmdalYjTGTT5948GAoh+GqtPncZ3YqCGAr239yyNrNUhJXYINKqwnS0f/3yWS8o7S/0Mf3HHaScPBBi/DVyVALc+sll94/bJRURb6010+qhI+Byh+r7mrmxgyYqqQeLg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644354532; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=om0XV2oCryM431P+Rv/gpC75TuXJHNl3A2Oh1Kcr5Ic=; b=R5qzSBe8LCJF4OYRQ9qdm6Neqw/Jaf3Ghl7welWmYANI39lGDqhd46IXJJMMsS2n51Z7Ng0PTgau3xGwaMK1ZISXsHL3Ug4ZckOmBUM5iy+KlpgIZpxUSOGv2bIIIOfbyVrYN7KOYA5mOcxKsVPPFsgJEYYdOuVaYvin/tS1Lo0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164435453231856.59169608848663; Tue, 8 Feb 2022 13:08:52 -0800 (PST) Received: from localhost ([::1]:44184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHXjG-0006JA-Lr for importer@patchew.org; Tue, 08 Feb 2022 16:08:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWnV-00030z-Ot for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:09 -0500 Received: from [2a00:1450:4864:20::429] (port=35568 helo=mail-wr1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWnT-00066T-15 for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:09 -0500 Received: by mail-wr1-x429.google.com with SMTP id v12so386564wrv.2 for ; Tue, 08 Feb 2022 12:09:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r2sm4098170wmq.24.2022.02.08.12.08.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 12:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=om0XV2oCryM431P+Rv/gpC75TuXJHNl3A2Oh1Kcr5Ic=; b=wq2rRXqcRat9rMwI7X7oUpR8Mi17NY8D6y5y2+1WN1EwKqBSSPPij3RPFVj7IUPQqz G+5PrcDyRroikq4l9swoCT9kYgbXmq+SvzYXvKEz39c17cSziNVNMaKcuu6+w+um3I5/ KQWfuXyfP0M9wllD85WZ9y/W0/j+b4tnwCgQSuB5mqk+lKzNzOHq00X8phESmuMQpedq Vj5TU6KcboCuxBNgNgX9NqgJSoPi02JayxxUTaqXlfWq75UqNjjJar1vVccAWQWNYFX3 cd3ztrkIAaY9M1s6fhz0CDLMoDq7w4yvcNhqloJ7Cz9f2w4hZkGiuTM9HbJmMxY6/ZGL JT7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=om0XV2oCryM431P+Rv/gpC75TuXJHNl3A2Oh1Kcr5Ic=; b=H7qq/jU9WfcuMB4OC612qRLgjemBw4jc9pfcJnIwsAar6a67eed+KNBDdoIRFMYT/K 5wSC50AnZeRrD5Lf7YuaOI5falQgHPJubKS66IjPVPGqJgIYeytxti8aXUk94doSNHoO KZ0V/vUvJqlLlElNemhoWqs8wWISaygNKFOD7C03zpoiGc4syiMl/kMXrTcYq9RaTDzT ocIRa2K7qZhRGFOXjFdyBKpaleKzC4J4/6dhgbfGHjWpxGTLdGtJ19S8K5UaaZp4A810 RfMhGkolHHwt/0s6HnEebbEKXdjEtivxvHBks1mESqRSiVaajnQaNDqCXEAv+/ujKT65 owYg== X-Gm-Message-State: AOAM531V+4aAmycU6AosAiBg34nDuJj7k1oDxaOgsGCoOFf5wqyDjIn4 FBDWXp+YcwGG18F0ttfMjjVidJ30I3Uv5g== X-Google-Smtp-Source: ABdhPJzi7FfmQxx2SF1mjTN35j1trv2eFOS3pbKJiNtGRlZUt2LGDgFgewE4NzjXYKqlBO0Vahknzw== X-Received: by 2002:a5d:4945:: with SMTP id r5mr4763011wrs.450.1644350939339; Tue, 08 Feb 2022 12:08:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 1/5] include: Move qemu_madvise() and related #defines to new qemu/madvise.h Date: Tue, 8 Feb 2022 20:08:52 +0000 Message-Id: <20220208200856.3558249-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208200856.3558249-1-peter.maydell@linaro.org> References: <20220208200856.3558249-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::429 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1644354532806100001 Content-Type: text/plain; charset="utf-8" The function qemu_madvise() and the QEMU_MADV_* constants associated with it are used in only 10 files. Move them out of osdep.h to a new qemu/madvise.h header that is included where it is needed. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/madvise.h | 95 ++++++++++++++++++++++++++++++++++++++ include/qemu/osdep.h | 82 -------------------------------- backends/hostmem-file.c | 1 + backends/hostmem.c | 1 + hw/virtio/virtio-balloon.c | 1 + migration/postcopy-ram.c | 1 + migration/qemu-file.c | 1 + migration/ram.c | 1 + softmmu/physmem.c | 1 + tcg/region.c | 1 + util/osdep.c | 1 + util/oslib-posix.c | 1 + 12 files changed, 105 insertions(+), 82 deletions(-) create mode 100644 include/qemu/madvise.h diff --git a/include/qemu/madvise.h b/include/qemu/madvise.h new file mode 100644 index 00000000000..e155f59a0df --- /dev/null +++ b/include/qemu/madvise.h @@ -0,0 +1,95 @@ +/* + * QEMU madvise wrapper functions + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#ifndef QEMU_MADVISE_H +#define QEMU_MADVISE_H + +#define QEMU_MADV_INVALID -1 + +#if defined(CONFIG_MADVISE) + +#define QEMU_MADV_WILLNEED MADV_WILLNEED +#define QEMU_MADV_DONTNEED MADV_DONTNEED +#ifdef MADV_DONTFORK +#define QEMU_MADV_DONTFORK MADV_DONTFORK +#else +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#endif +#ifdef MADV_MERGEABLE +#define QEMU_MADV_MERGEABLE MADV_MERGEABLE +#else +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#endif +#ifdef MADV_UNMERGEABLE +#define QEMU_MADV_UNMERGEABLE MADV_UNMERGEABLE +#else +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#endif +#ifdef MADV_DODUMP +#define QEMU_MADV_DODUMP MADV_DODUMP +#else +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#endif +#ifdef MADV_DONTDUMP +#define QEMU_MADV_DONTDUMP MADV_DONTDUMP +#else +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#endif +#ifdef MADV_HUGEPAGE +#define QEMU_MADV_HUGEPAGE MADV_HUGEPAGE +#else +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#endif +#ifdef MADV_NOHUGEPAGE +#define QEMU_MADV_NOHUGEPAGE MADV_NOHUGEPAGE +#else +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#endif +#ifdef MADV_REMOVE +#define QEMU_MADV_REMOVE MADV_REMOVE +#else +#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED +#endif +#ifdef MADV_POPULATE_WRITE +#define QEMU_MADV_POPULATE_WRITE MADV_POPULATE_WRITE +#else +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID +#endif + +#elif defined(CONFIG_POSIX_MADVISE) + +#define QEMU_MADV_WILLNEED POSIX_MADV_WILLNEED +#define QEMU_MADV_DONTNEED POSIX_MADV_DONTNEED +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID + +#else /* no-op */ + +#define QEMU_MADV_WILLNEED QEMU_MADV_INVALID +#define QEMU_MADV_DONTNEED QEMU_MADV_INVALID +#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID +#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID +#define QEMU_MADV_DODUMP QEMU_MADV_INVALID +#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID +#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID +#define QEMU_MADV_REMOVE QEMU_MADV_INVALID +#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID + +#endif + +int qemu_madvise(void *addr, size_t len, int advice); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index d1660d67fa9..cb74f4571a3 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -425,87 +425,6 @@ static inline void qemu_cleanup_generic_vfree(void *p) #define QEMU_MAP_NORESERVE (1 << 3) =20 =20 -#define QEMU_MADV_INVALID -1 - -#if defined(CONFIG_MADVISE) - -#define QEMU_MADV_WILLNEED MADV_WILLNEED -#define QEMU_MADV_DONTNEED MADV_DONTNEED -#ifdef MADV_DONTFORK -#define QEMU_MADV_DONTFORK MADV_DONTFORK -#else -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#endif -#ifdef MADV_MERGEABLE -#define QEMU_MADV_MERGEABLE MADV_MERGEABLE -#else -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#endif -#ifdef MADV_UNMERGEABLE -#define QEMU_MADV_UNMERGEABLE MADV_UNMERGEABLE -#else -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#endif -#ifdef MADV_DODUMP -#define QEMU_MADV_DODUMP MADV_DODUMP -#else -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#endif -#ifdef MADV_DONTDUMP -#define QEMU_MADV_DONTDUMP MADV_DONTDUMP -#else -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#endif -#ifdef MADV_HUGEPAGE -#define QEMU_MADV_HUGEPAGE MADV_HUGEPAGE -#else -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#endif -#ifdef MADV_NOHUGEPAGE -#define QEMU_MADV_NOHUGEPAGE MADV_NOHUGEPAGE -#else -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#endif -#ifdef MADV_REMOVE -#define QEMU_MADV_REMOVE MADV_REMOVE -#else -#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED -#endif -#ifdef MADV_POPULATE_WRITE -#define QEMU_MADV_POPULATE_WRITE MADV_POPULATE_WRITE -#else -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID -#endif - -#elif defined(CONFIG_POSIX_MADVISE) - -#define QEMU_MADV_WILLNEED POSIX_MADV_WILLNEED -#define QEMU_MADV_DONTNEED POSIX_MADV_DONTNEED -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_REMOVE QEMU_MADV_DONTNEED -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID - -#else /* no-op */ - -#define QEMU_MADV_WILLNEED QEMU_MADV_INVALID -#define QEMU_MADV_DONTNEED QEMU_MADV_INVALID -#define QEMU_MADV_DONTFORK QEMU_MADV_INVALID -#define QEMU_MADV_MERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_UNMERGEABLE QEMU_MADV_INVALID -#define QEMU_MADV_DODUMP QEMU_MADV_INVALID -#define QEMU_MADV_DONTDUMP QEMU_MADV_INVALID -#define QEMU_MADV_HUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_NOHUGEPAGE QEMU_MADV_INVALID -#define QEMU_MADV_REMOVE QEMU_MADV_INVALID -#define QEMU_MADV_POPULATE_WRITE QEMU_MADV_INVALID - -#endif =20 #ifdef _WIN32 #define HAVE_CHARDEV_SERIAL 1 @@ -577,7 +496,6 @@ void sigaction_invoke(struct sigaction *action, struct qemu_signalfd_siginfo *info); #endif =20 -int qemu_madvise(void *addr, size_t len, int advice); int qemu_mprotect_rw(void *addr, size_t size); int qemu_mprotect_rwx(void *addr, size_t size); int qemu_mprotect_none(void *addr, size_t size); diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c index cd038024fae..25141283c4a 100644 --- a/backends/hostmem-file.c +++ b/backends/hostmem-file.c @@ -14,6 +14,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qemu/madvise.h" #include "sysemu/hostmem.h" #include "qom/object_interfaces.h" #include "qom/object.h" diff --git a/backends/hostmem.c b/backends/hostmem.c index 4c05862ed5a..b2a5e905e86 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -19,6 +19,7 @@ #include "qemu/config-file.h" #include "qom/object_interfaces.h" #include "qemu/mmap-alloc.h" +#include "qemu/madvise.h" =20 #ifdef CONFIG_NUMA #include diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 9a4f491b54d..e6c1b0aa46f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -17,6 +17,7 @@ #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qemu/madvise.h" #include "hw/virtio/virtio.h" #include "hw/mem/pc-dimm.h" #include "hw/qdev-properties.h" diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index e662dd05ccf..2a2cc5faf8f 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -18,6 +18,7 @@ =20 #include "qemu/osdep.h" #include "qemu/rcu.h" +#include "qemu/madvise.h" #include "exec/target_page.h" #include "migration.h" #include "qemu-file.h" diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 6338d8e2ff5..1479cddad94 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" #include +#include "qemu/madvise.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "migration.h" diff --git a/migration/ram.c b/migration/ram.c index 91ca743ac88..781f0745dc0 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -30,6 +30,7 @@ #include "qemu/cutils.h" #include "qemu/bitops.h" #include "qemu/bitmap.h" +#include "qemu/madvise.h" #include "qemu/main-loop.h" #include "xbzrle.h" #include "ram.h" diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dddf70edf5d..a13289a594a 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -23,6 +23,7 @@ =20 #include "qemu/cutils.h" #include "qemu/cacheflush.h" +#include "qemu/madvise.h" =20 #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" diff --git a/tcg/region.c b/tcg/region.c index 9cc30d49225..c46021d1604 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/madvise.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/util/osdep.c b/util/osdep.c index 42a0a4986ae..1999f42f6fc 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -37,6 +37,7 @@ extern int madvise(char *, size_t, int); #include "qemu/cutils.h" #include "qemu/sockets.h" #include "qemu/error-report.h" +#include "qemu/madvise.h" #include "monitor/monitor.h" =20 static bool fips_enabled =3D false; diff --git a/util/oslib-posix.c b/util/oslib-posix.c index ac0dbc2adc2..f2be7321c59 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -36,6 +36,7 @@ #include "trace.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/madvise.h" #include "qemu/sockets.h" #include "qemu/thread.h" #include --=20 2.25.1 From nobody Mon Feb 9 12:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1644351233; cv=none; d=zohomail.com; s=zohoarc; b=Kv267Ng3buUavpzeQnZ/8vV8HtGRg9dDW5nXA1yYR7BM1ur9onzphPsmlghFInlwyIYKAZ7j+3tqP/4lhGwbXQAbOWw6Cmzql/leIPHbfaZAfFyIpulAAK8UOX9go22RdM4F23M4KCmGQ2E5i9ooKso3a6dUM3cIJ8ZkSvVLvJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644351233; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Kvt1TfUvKKE2DWl3Q8+xXwyGqPqxYFhXR1/NgDzzilg=; b=gdNfOPOat5DlNFQiNI72ThHdQsbpzZuivem/u2sFR1ddfUZKrJTBZNr4gOsdmKcuR6Yfwzm+SXYYEPeGX4pZtgSENpTtGAeBDeEI5/2ldvNiaxhCPKl98IXVjIiakkv4WZAnTX3naTrDVLMO1R1f76Qg0eE7udUmdicOR3mGkt4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644351233120418.3572892288852; Tue, 8 Feb 2022 12:13:53 -0800 (PST) Received: from localhost ([::1]:34188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHWs4-00069a-1k for importer@patchew.org; Tue, 08 Feb 2022 15:13:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWnX-00032E-83 for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:13 -0500 Received: from [2a00:1450:4864:20::435] (port=47095 helo=mail-wr1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWnT-00066b-4b for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:10 -0500 Received: by mail-wr1-x435.google.com with SMTP id q7so277640wrc.13 for ; Tue, 08 Feb 2022 12:09:00 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r2sm4098170wmq.24.2022.02.08.12.08.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 12:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Kvt1TfUvKKE2DWl3Q8+xXwyGqPqxYFhXR1/NgDzzilg=; b=XfRZ9eXJkcIeBR4roww+GdKRs5Wx0H8FCzovdbN4IBRtDg++jFP8cohPRxipRFiZKI C16EA+jC2vf7w4Ni7SxcahAf4p+1gwkM6AfhQ9eG4j/uWMeLtX+LEy1y35eB//so+DlN gxxt7rLqGPSmIjhMHq4MXBbN1wPtK3y4f4/H8J8okFTuPwwN5uiktuP/jYCR0iwJFXAl qPp8j+S55YH1jBrvn10093G3bRO76gh80svjTixvj/1WoQ2Mjv8iUrRLQIfedI2GBMvh 4PCdk1w+dJjtvDJ+4GoSH5qaqXNiwiE6flie3uq1l7PxnKZkaxB3hsSJCn4TkXs3+kq+ HhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kvt1TfUvKKE2DWl3Q8+xXwyGqPqxYFhXR1/NgDzzilg=; b=wxK6QqzjBtrXjuYUUe8dNY3+72tRxGf/YWCjkOo/7zdwoDiSg3TsoF19NwA25Uk1WX ymjNKeNSWQQBoKt2GFEgMFcYC0eifv7IwIT2Q01S6xYB2t5eLxN2yjPLvM2BbQUpPqPf TMReZ1jYpTToz02diFsm1FJTntsE5uP/76sqftMSzFevYp8bh+3wHxynIAEDwpIxuzkD xRUoIlz/xMB1XK2EvugM26OZ6zcnWbYehrLnkOSVEyIlaP/srH2bX8ujeciswWClbcEj tj0dDegPAiAtk1j3+4k195dwZeyEQeiFxqABOGaG8Q/YMwr57SArz0c2ch+O+pfnYK72 dOCA== X-Gm-Message-State: AOAM531uIA0VmUWncVXCcY10l9MKgI7hxSmkXzKpmozVlo7T41VjiPgs BYwz38MjwZIqhy12FKzAyA8my3sMfYZzpw== X-Google-Smtp-Source: ABdhPJzqVtiLyNewVE+KTcsiieTn1BKuxzlmaZNpfnrxnMlQOzSi7N1D56kFPZenZMCE/bVOVlIYQA== X-Received: by 2002:a05:6000:1869:: with SMTP id d9mr4784644wri.432.1644350939909; Tue, 08 Feb 2022 12:08:59 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/5] include: Move qemu_mprotect_*() to new qemu/mprotect.h Date: Tue, 8 Feb 2022 20:08:53 +0000 Message-Id: <20220208200856.3558249-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208200856.3558249-1-peter.maydell@linaro.org> References: <20220208200856.3558249-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::435 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1644351235685100003 Content-Type: text/plain; charset="utf-8" The qemu_mprotect_*() family of functions are used in very few files; move them from osdep.h to a new qemu/mprotect.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/mprotect.h | 14 ++++++++++++++ include/qemu/osdep.h | 4 ---- tcg/region.c | 1 + util/osdep.c | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 include/qemu/mprotect.h diff --git a/include/qemu/mprotect.h b/include/qemu/mprotect.h new file mode 100644 index 00000000000..1e83d1433ee --- /dev/null +++ b/include/qemu/mprotect.h @@ -0,0 +1,14 @@ +/* + * QEMU mprotect functions + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_MPROTECT_H +#define QEMU_MPROTECT_H + +int qemu_mprotect_rw(void *addr, size_t size); +int qemu_mprotect_rwx(void *addr, size_t size); +int qemu_mprotect_none(void *addr, size_t size); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index cb74f4571a3..2a52933ce0e 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -496,10 +496,6 @@ void sigaction_invoke(struct sigaction *action, struct qemu_signalfd_siginfo *info); #endif =20 -int qemu_mprotect_rw(void *addr, size_t size); -int qemu_mprotect_rwx(void *addr, size_t size); -int qemu_mprotect_none(void *addr, size_t size); - /* * Don't introduce new usage of this function, prefer the following * qemu_open/qemu_create that take an "Error **errp" diff --git a/tcg/region.c b/tcg/region.c index c46021d1604..7b4e65a52e8 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu/madvise.h" +#include "qemu/mprotect.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/util/osdep.c b/util/osdep.c index 1999f42f6fc..72b678ca2e3 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -38,6 +38,7 @@ extern int madvise(char *, size_t, int); #include "qemu/sockets.h" #include "qemu/error-report.h" #include "qemu/madvise.h" +#include "qemu/mprotect.h" #include "monitor/monitor.h" =20 static bool fips_enabled =3D false; --=20 2.25.1 From nobody Mon Feb 9 12:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1644351231; cv=none; d=zohomail.com; s=zohoarc; b=RLieqlEk0gausSUtEvhftcqcppsAgdvtICOp5XW0NJ7jkzzDqnTZbTcU92bpukW5KnQnzTOctt7KQL3RbPdAST+brUnOceTDyhRNrMA3squK6lexjIwZXGf2EyQ+EM0fo0zP73SZ8bdpZrNxtn6Celb+OPmu7DWpTVvg73MAsXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644351231; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PrbYqH6sR5gz/Fz8Pqq4CFLsp5TPR2lRR6F+G57Ib0U=; b=EGmWxefDY9D0e9rFHKxOMD+XlSpAj+91+NB1eMPm+R+rIUoFiiZE5ynxGp3SAi3FNNp6kIiKTjVmVYXiXjuLp/yZFdwFJFmfMy+UayArwcMWUxaIjywtEHBPqT1Bpv2trJlvxrKsGQ4oRuSkXhcUsVoIdVLs6GSrkWOycsZ1QEE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644351231523607.9115941942217; Tue, 8 Feb 2022 12:13:51 -0800 (PST) Received: from localhost ([::1]:33904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHWs1-0005yA-UJ for importer@patchew.org; Tue, 08 Feb 2022 15:13:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWnY-00032K-6g for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:13 -0500 Received: from [2a00:1450:4864:20::42a] (port=41535 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWnT-00066f-3t for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:11 -0500 Received: by mail-wr1-x42a.google.com with SMTP id k1so336047wrd.8 for ; Tue, 08 Feb 2022 12:09:01 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r2sm4098170wmq.24.2022.02.08.12.09.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 12:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=PrbYqH6sR5gz/Fz8Pqq4CFLsp5TPR2lRR6F+G57Ib0U=; b=xYFevFOPEzZ2XneBLARpjsj9i8smYzoSqvvQJ21OSJH7kD2AEEY0mEGcguKWcd+l76 8sU8blbrJCrNCKUYwNCWyd8YVOuT4uc3buNb/EkQlyMW2C0kmXgWeGvLn30ChVGvUqbi IR5ZkherU6UDaku1tFdv+FdcbLf+IDUbaqW1RCh5zCGiOKuD7/BwUYmlBWz/PknxyJ7x z2/hqqpADDr/sOLgGlPUw4pSAoQjjWudxOzhTEPN8AXIo+vtjFxdvZEZ2fE0DZbokQ6U 8AkSy5bAj+a5RBzBa5vxQbSzdhGCl8houc+kLj9MpxhQIWsPSDInEuRv+n+GrERjdnzy TLhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PrbYqH6sR5gz/Fz8Pqq4CFLsp5TPR2lRR6F+G57Ib0U=; b=e80hu5wH5GoY7cewPbHfwzWtjgmRyF/XoPR3hEzaiGmoHsX/tclvfuNIROap4iFeqD j/oqNsoD9qNnSpn/xh/1fVcn+98YaQGgYdpZYF8j7O+b11uLI9cXNBXKAoNYXGcYtWQw /tMzUmSCCjTNn7epMHjdF1Ag2jj3uMZ/MWI/b94/s5HY6S//i8HhGa4sTSaL3+A6o1Cg sCWVKwbGbP64s0YX2+0rw0NoKGqwKtDgkFv3oqjvqI05v+AP3Z7hbmA0eHeq0XfiX/BG 9KBp9DBUK1NVLFiFcT0jRoU3yaVIM/+Rq1GJp+oUcxqFBwuU1OhgGF1PXibOV38R0wBe /Oig== X-Gm-Message-State: AOAM531eN32epTcxcpcezMeZvcwuqoGr3tQl1av6095hXOKG63XSCpV/ fMKMx/MvHc+LaEOn92gQTu0TtcMdQIA0Bw== X-Google-Smtp-Source: ABdhPJxtH4VyRHcmh7M0lQ9vHNirjSFtv/qPZsrBtFtJFbNaes5BRMF8e76dd76PRJnch+RtLTeY+w== X-Received: by 2002:adf:fecf:: with SMTP id q15mr4713762wrs.104.1644350940655; Tue, 08 Feb 2022 12:09:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 3/5] include: Move QEMU_MAP_* constants to mmap-alloc.h Date: Tue, 8 Feb 2022 20:08:54 +0000 Message-Id: <20220208200856.3558249-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208200856.3558249-1-peter.maydell@linaro.org> References: <20220208200856.3558249-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1644351233852100001 Content-Type: text/plain; charset="utf-8" The QEMU_MAP_* constants are used only as arguments to the qemu_ram_mmap() function. Move them to mmap-alloc.h, where that function's prototype is defined. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/mmap-alloc.h | 23 +++++++++++++++++++++++ include/qemu/osdep.h | 25 ------------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h index 90d0eee7053..5076695cc81 100644 --- a/include/qemu/mmap-alloc.h +++ b/include/qemu/mmap-alloc.h @@ -35,4 +35,27 @@ void *qemu_ram_mmap(int fd, =20 void qemu_ram_munmap(int fd, void *ptr, size_t size); =20 +/* + * Abstraction of PROT_ and MAP_ flags as passed to mmap(), for example, + * consumed by qemu_ram_mmap(). + */ + +/* Map PROT_READ instead of PROT_READ | PROT_WRITE. */ +#define QEMU_MAP_READONLY (1 << 0) + +/* Use MAP_SHARED instead of MAP_PRIVATE. */ +#define QEMU_MAP_SHARED (1 << 1) + +/* + * Use MAP_SYNC | MAP_SHARED_VALIDATE if supported. Ignored without + * QEMU_MAP_SHARED. If mapping fails, warn and fallback to !QEMU_MAP_SYNC. + */ +#define QEMU_MAP_SYNC (1 << 2) + +/* + * Use MAP_NORESERVE to skip reservation of swap space (or huge pages if + * applicable). Bail out if not supported/effective. + */ +#define QEMU_MAP_NORESERVE (1 << 3) + #endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 2a52933ce0e..0715d6b4509 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -401,31 +401,6 @@ static inline void qemu_cleanup_generic_vfree(void *p) */ #define QEMU_AUTO_VFREE __attribute__((cleanup(qemu_cleanup_generic_vfree)= )) =20 -/* - * Abstraction of PROT_ and MAP_ flags as passed to mmap(), for example, - * consumed by qemu_ram_mmap(). - */ - -/* Map PROT_READ instead of PROT_READ | PROT_WRITE. */ -#define QEMU_MAP_READONLY (1 << 0) - -/* Use MAP_SHARED instead of MAP_PRIVATE. */ -#define QEMU_MAP_SHARED (1 << 1) - -/* - * Use MAP_SYNC | MAP_SHARED_VALIDATE if supported. Ignored without - * QEMU_MAP_SHARED. If mapping fails, warn and fallback to !QEMU_MAP_SYNC. - */ -#define QEMU_MAP_SYNC (1 << 2) - -/* - * Use MAP_NORESERVE to skip reservation of swap space (or huge pages if - * applicable). Bail out if not supported/effective. - */ -#define QEMU_MAP_NORESERVE (1 << 3) - - - #ifdef _WIN32 #define HAVE_CHARDEV_SERIAL 1 #elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \ --=20 2.25.1 From nobody Mon Feb 9 12:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1644352885; cv=none; d=zohomail.com; s=zohoarc; b=R0apvpLIEcWLUzL3MEYpT4z//IFkNOxeFTT2ZyYWvjFlk+9XRj/PnjRKm3abw83whw9oyivmAKYpBip7SzKV5B8QrYsu6YPPGNLrAVPNVOZX45Dl8SRYmCpDcXah1XGa2qTJz+ERjVR5pqh/wGzBxeLEK2yysybDXpz77OQOz4U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644352885; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ETqgvEp+BK5IeQcaommUlEe8fKOhJ00KVNdgTbqltH8=; b=bKii56eqanz6dGJc4iW4NJd7EahL23C+6tO16rY/kqGba192s9iZxcIb/h82nv/zXPIY5I6FATioFUT+DNTUL17PeSLGlRVJ6VaTboe/89s0HW2HbFtEBKMVWetiiuc0e14KqgihuN1lwzYh4G5piKGLRgjmvJOVR8JcED7hG0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644352885207412.1623065490661; Tue, 8 Feb 2022 12:41:25 -0800 (PST) Received: from localhost ([::1]:38020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHXIi-00055d-5g for importer@patchew.org; Tue, 08 Feb 2022 15:41:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWna-00033B-5R for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:18 -0500 Received: from [2a00:1450:4864:20::32e] (port=54789 helo=mail-wm1-x32e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWnT-00066j-5X for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:12 -0500 Received: by mail-wm1-x32e.google.com with SMTP id c192so47564wma.4 for ; Tue, 08 Feb 2022 12:09:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r2sm4098170wmq.24.2022.02.08.12.09.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 12:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ETqgvEp+BK5IeQcaommUlEe8fKOhJ00KVNdgTbqltH8=; b=U1VpaWHhRQNMbt1U6lyGf2VMPrnhc7HKy3/HXFDyPRLDCCvck1COXPz4picyc/6I5i oxUL64BXGVvUz0UoSi+8VyNXiKvd4Rtdqu+zg0ryXqD4zECjWEweAPstt2IPNBtxejpP LqErd5ngjHAMXCdi6TaR2tQNBH37BWVQH9X52vMw2i+L24V+g0oh2bCqmiCexq5UyTF/ Pxg3V3voL1cYQa7uM0MM8xlYb72IR+VbMDEYnCvqLK9SMtLYvwTZuVVnyQhhXO19G6cL Ih55fv+UOMgo6DwOaNmATOw8lObSuoGXrmepMUW3rdRkM4cfig6kPP0iaR2XQG3GCkJ5 BSpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ETqgvEp+BK5IeQcaommUlEe8fKOhJ00KVNdgTbqltH8=; b=1aH2WQUxEIucEubPb66J9P6tdF/wUTz03/g28kCDOTI1UGKd5aYL9TjHBPn4hV9UvE ZJgbLSqvNaY4aohZS4fC1nylQaCcsf464Zvl0uZtVNnx3TLW3CCkA7Zy/KAokG9VtHRS 90lhOPGJyhXW+5Gui2QcKjdpOPXa00bRKkqVUfCfLGwWVRWkXXQZtiPtDv7GOvf44tMQ obDvLH+luunk9va+jff4lsjKj8T6e4XuFGp2ChvU9zYeYyt5SVVv5NKcCG5XCN6GC64s /tXdWXCaorwcHaOx+JplcBJrjYf6fK9g/EMQwzeIUTDaBUBfpdSy02dy/h0tlkjO4LbN nggA== X-Gm-Message-State: AOAM532mVqma78uGv3p2muHZX82CfyVTYANkpooGoberKbszinUoTKMV tNgHD6u5iI/oX9qRjotq1AZGJD/PJpGs2w== X-Google-Smtp-Source: ABdhPJz9jMpb2BOJE5cXPc7WJBGVbogPcti26APqZcSNzEkx3cohu9a5YM43ejVmQ9gs2lcD9IFvVg== X-Received: by 2002:a05:600c:3488:: with SMTP id a8mr2400179wmq.173.1644350941348; Tue, 08 Feb 2022 12:09:01 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 4/5] include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h Date: Tue, 8 Feb 2022 20:08:55 +0000 Message-Id: <20220208200856.3558249-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208200856.3558249-1-peter.maydell@linaro.org> References: <20220208200856.3558249-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32e (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1644352887781100001 Content-Type: text/plain; charset="utf-8" The qemu_icache_linesize, qemu_icache_linesize_log, qemu_dcache_linesize, and qemu_dcache_linesize_log variables are not used in many files. Move them out of osdep.h to a new qemu/cacheinfo.h, and document them. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/cacheinfo.h | 21 +++++++++++++++++++++ include/qemu/osdep.h | 5 ----- accel/tcg/translate-all.c | 1 + plugins/loader.c | 1 + tcg/region.c | 1 + tcg/tcg.c | 1 + util/atomic64.c | 1 + util/cacheflush.c | 1 + util/cacheinfo.c | 1 + 9 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 include/qemu/cacheinfo.h diff --git a/include/qemu/cacheinfo.h b/include/qemu/cacheinfo.h new file mode 100644 index 00000000000..019a157ea08 --- /dev/null +++ b/include/qemu/cacheinfo.h @@ -0,0 +1,21 @@ +/* + * QEMU host cacheinfo information + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_CACHEINFO_H +#define QEMU_CACHEINFO_H + +/* + * These variables represent our best guess at the host icache and + * dcache sizes, expressed both as the size in bytes and as the + * base-2 log of the size in bytes. They are initialized at startup + * (via an attribute 'constructor' function). + */ +extern int qemu_icache_linesize; +extern int qemu_icache_linesize_log; +extern int qemu_dcache_linesize; +extern int qemu_dcache_linesize_log; + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 0715d6b4509..e36f62a254e 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -616,11 +616,6 @@ pid_t qemu_fork(Error **errp); extern uintptr_t qemu_real_host_page_size; extern intptr_t qemu_real_host_page_mask; =20 -extern int qemu_icache_linesize; -extern int qemu_icache_linesize_log; -extern int qemu_dcache_linesize; -extern int qemu_dcache_linesize_log; - /* * After using getopt or getopt_long, if you need to parse another set * of options, then you must reset optind. Unfortunately the way to diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index bd71db59a9a..5971cd53ab9 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -51,6 +51,7 @@ #include "qemu/qemu-print.h" #include "qemu/timer.h" #include "qemu/main-loop.h" +#include "qemu/cacheinfo.h" #include "exec/log.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h" diff --git a/plugins/loader.c b/plugins/loader.c index a4ec2816922..4883b0a1cbc 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -24,6 +24,7 @@ #include "qemu/rcu_queue.h" #include "qemu/qht.h" #include "qemu/bitmap.h" +#include "qemu/cacheinfo.h" #include "qemu/xxhash.h" #include "qemu/plugin.h" #include "hw/core/cpu.h" diff --git a/tcg/region.c b/tcg/region.c index 7b4e65a52e8..72afb357389 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -26,6 +26,7 @@ #include "qemu/units.h" #include "qemu/madvise.h" #include "qemu/mprotect.h" +#include "qemu/cacheinfo.h" #include "qapi/error.h" #include "exec/exec-all.h" #include "tcg/tcg.h" diff --git a/tcg/tcg.c b/tcg/tcg.c index 5d2f0d8b103..528277d1d3c 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -36,6 +36,7 @@ #include "qemu/qemu-print.h" #include "qemu/timer.h" #include "qemu/cacheflush.h" +#include "qemu/cacheinfo.h" =20 /* Note: the long term plan is to reduce the dependencies on the QEMU CPU definitions. Currently they are used for qemu_ld/st diff --git a/util/atomic64.c b/util/atomic64.c index 93037d5b116..db2c7f0fd0e 100644 --- a/util/atomic64.c +++ b/util/atomic64.c @@ -7,6 +7,7 @@ #include "qemu/osdep.h" #include "qemu/atomic.h" #include "qemu/thread.h" +#include "qemu/cacehinfo.h" =20 #ifdef CONFIG_ATOMIC64 #error This file must only be compiled if !CONFIG_ATOMIC64 diff --git a/util/cacheflush.c b/util/cacheflush.c index 933355b0c99..4b57186d89c 100644 --- a/util/cacheflush.c +++ b/util/cacheflush.c @@ -7,6 +7,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cacheflush.h" +#include "qemu/cacheinfo.h" #include "qemu/bitops.h" =20 =20 diff --git a/util/cacheinfo.c b/util/cacheinfo.c index b182f0b6936..ab1644d490f 100644 --- a/util/cacheinfo.c +++ b/util/cacheinfo.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/host-utils.h" #include "qemu/atomic.h" +#include "qemu/cacheinfo.h" =20 int qemu_icache_linesize =3D 0; int qemu_icache_linesize_log; --=20 2.25.1 From nobody Mon Feb 9 12:11:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1644352538; cv=none; d=zohomail.com; s=zohoarc; b=Z12mgigIH7XoBj3tSqjB95ZH77W4q+2/ALpVqxRavyrHbUSF58yS35PBs0r5VQJgw8UX/OqWuhIZIF3cL52lCgoXCqzoFICjGC4jp5+7GrQHOXIwdFTun1MNBl2Kid2ulpYTJD4jwIFg2CabmyDhv54/aD8vnoC6B6awFTFdIg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644352538; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D31fWlApiNdJKj9pWF83rHnBapTQ9Q4E45VDFHt714s=; b=EZ5rwlrkfQmBOVmuXTtTVinjECy+7YlbdRG8zdIluMqQM/FJYSKGgg6ThN5RtEl8NglgBFsPXM+Es8lNdDvVhVOXnMG1+d+Am1E7dKIVuWnoCRJser/qyBaqM/FiXHkzpUdLdxkwXBgShOlQAAUeK3xtFhbWsZk1JL+J0pRtKt4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1644352538701693.495618883568; Tue, 8 Feb 2022 12:35:38 -0800 (PST) Received: from localhost ([::1]:60346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHXD6-0000nr-SU for importer@patchew.org; Tue, 08 Feb 2022 15:35:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHWna-00033C-5t for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:18 -0500 Received: from [2a00:1450:4864:20::336] (port=51049 helo=mail-wm1-x336.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHWnT-00066o-3y for qemu-devel@nongnu.org; Tue, 08 Feb 2022 15:09:12 -0500 Received: by mail-wm1-x336.google.com with SMTP id m26so87662wms.0 for ; Tue, 08 Feb 2022 12:09:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r2sm4098170wmq.24.2022.02.08.12.09.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 12:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=D31fWlApiNdJKj9pWF83rHnBapTQ9Q4E45VDFHt714s=; b=bGpHLsp+PvLEoDTGev5zrlJZ2jVx0RLw7r85mieSasWgGYUlL+goHvW+mC/gWUuljc 1L4Skdq7GNw6/DfYcTX/mV4yCJFQ4YQIbMWStMB0w0GUGfy+3glkAjHndnAKctVxPHqO 7iCZ2UR1LnlVSSzcvBQVOb5rrFs/l3eZnonmXkDlod89+DmP6Us/2l72JgCkv1OPklkI KbLUFBZi76t0t58RcRM9pfS+KZDDo5/2gENs9fipLqEwVOl6mYMwznL8xm7yoUiEbLBN c26yvHCH6tFFPW6wEQD7DwBH+91C1UndBsD1CCetk22pVLdkLMpAzkiJPMt+21DgPG4f c03w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D31fWlApiNdJKj9pWF83rHnBapTQ9Q4E45VDFHt714s=; b=w3qlj1Qf8bk85wHfQf02ghT5ZZlKcu3cyF0tJSudLVFKKtSFCpuZecpE/gZGb0lOaw GFzJzHkqay9zx33sOXQ1zPigUOwkeiq0IdHSMWOD02Ve/uYxowscgtoIJLiJpYAlTKX8 Eewjwku4MIhI1zRiuFPmexneTtQbhdKnrkz3KlzGUGEDT4WZDZ+cvx1tRkdVHrfsV6d0 J5zPUuN/e7+GtNHXYLiMyDjIOSCxKibNugO8B6hfUN6I/mkMHZPlg3asZ4/J+siJE/gB Qms505Dc3MmrDXlRyOoHhQvrdRDboroo/m+giesFL6ChxicK8bzYGQBp0xBEcKpKuE2Z 2OHA== X-Gm-Message-State: AOAM530DjLxKkJa9tGQVMU5ELxVa8UZKwEK6wmJNqD0CrZ1x+4I8zmYs pOj5oWCFi4iu4bvVj3i1nlTovK5VBdXiqQ== X-Google-Smtp-Source: ABdhPJyEYj80E9ulI7MMV0bOj5640Ob4yeL0ZlZhxH93/IG0nMb5hCQYJd2M1Bb5jKWYh5I8zyNVdg== X-Received: by 2002:a05:600c:ac6:: with SMTP id c6mr2456726wmr.65.1644350942010; Tue, 08 Feb 2022 12:09:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 5/5] include: Move hardware version declarations to new qemu/hw-version.h Date: Tue, 8 Feb 2022 20:08:56 +0000 Message-Id: <20220208200856.3558249-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220208200856.3558249-1-peter.maydell@linaro.org> References: <20220208200856.3558249-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::336 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1644352540944100001 Content-Type: text/plain; charset="utf-8" The "hardware version" machinery (qemu_set_hw_version(), qemu_hw_version(), and the QEMU_HW_VERSION define) is used by fewer than 10 files. Move it out from osdep.h into a new qemu/hw-version.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/qemu/hw-version.h | 27 +++++++++++++++++++++++++++ include/qemu/osdep.h | 16 ---------------- hw/arm/nseries.c | 1 + hw/ide/core.c | 1 + hw/scsi/megasas.c | 1 + hw/scsi/scsi-bus.c | 1 + hw/scsi/scsi-disk.c | 1 + softmmu/vl.c | 1 + target/i386/cpu.c | 1 + target/s390x/cpu_models.c | 1 + util/osdep.c | 1 + 11 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 include/qemu/hw-version.h diff --git a/include/qemu/hw-version.h b/include/qemu/hw-version.h new file mode 100644 index 00000000000..730a8c904d9 --- /dev/null +++ b/include/qemu/hw-version.h @@ -0,0 +1,27 @@ +/* + * QEMU "hardware version" machinery + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_HW_VERSION_H +#define QEMU_HW_VERSION_H + +/* + * Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default + * instead of QEMU_VERSION, so setting hw_version on MachineClass + * is no longer mandatory. + * + * Do NOT change this string, or it will break compatibility on all + * machine classes that don't set hw_version. + */ +#define QEMU_HW_VERSION "2.5+" + +/* QEMU "hardware version" setting. Used to replace code that exposed + * QEMU_VERSION to guests in the past and need to keep compatibility. + * Do not use qemu_hw_version() in new code. + */ +void qemu_set_hw_version(const char *); +const char *qemu_hw_version(void); + +#endif diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index e36f62a254e..650ba1aa505 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -534,22 +534,6 @@ static inline void qemu_timersub(const struct timeval = *val1, =20 void qemu_set_cloexec(int fd); =20 -/* Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default - * instead of QEMU_VERSION, so setting hw_version on MachineClass - * is no longer mandatory. - * - * Do NOT change this string, or it will break compatibility on all - * machine classes that don't set hw_version. - */ -#define QEMU_HW_VERSION "2.5+" - -/* QEMU "hardware version" setting. Used to replace code that exposed - * QEMU_VERSION to guests in the past and need to keep compatibility. - * Do not use qemu_hw_version() in new code. - */ -void qemu_set_hw_version(const char *); -const char *qemu_hw_version(void); - void fips_set_state(bool requested); bool fips_get_state(void); =20 diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index af3164c5519..9c1cafae86b 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -24,6 +24,7 @@ #include "chardev/char.h" #include "qemu/cutils.h" #include "qemu/bswap.h" +#include "qemu/hw-version.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" diff --git a/hw/ide/core.c b/hw/ide/core.c index e28f8aad611..33463d9b8f2 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/timer.h" +#include "qemu/hw-version.h" #include "sysemu/sysemu.h" #include "sysemu/blockdev.h" #include "sysemu/dma.h" diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index cd43945827c..d5dfb412bac 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -28,6 +28,7 @@ #include "hw/pci/msix.h" #include "qemu/iov.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "hw/scsi/scsi.h" #include "scsi/constants.h" #include "trace.h" diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 4057e04ce89..b2e2bc3c96c 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -3,6 +3,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" +#include "qemu/hw-version.h" #include "hw/qdev-properties.h" #include "hw/scsi/scsi.h" #include "migration/qemu-file-types.h" diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 9c0dc7b9468..3666b8d9468 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -25,6 +25,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "hw/scsi/scsi.h" #include "migration/qemu-file-types.h" #include "migration/vmstate.h" diff --git a/softmmu/vl.c b/softmmu/vl.c index 5e1b35ba489..1fe028800fd 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -36,6 +36,7 @@ #include "qemu-version.h" #include "qemu/cutils.h" #include "qemu/help_option.h" +#include "qemu/hw-version.h" #include "qemu/uuid.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" diff --git a/target/i386/cpu.c b/target/i386/cpu.c index aa9e6368004..c9954df4a74 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -21,6 +21,7 @@ #include "qemu/units.h" #include "qemu/cutils.h" #include "qemu/qemu-print.h" +#include "qemu/hw-version.h" #include "cpu.h" #include "tcg/helper-tcg.h" #include "sysemu/reset.h" diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 11e06cc51fa..17ae771939b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -19,6 +19,7 @@ #include "qapi/error.h" #include "qapi/visitor.h" #include "qemu/module.h" +#include "qemu/hw-version.h" #include "qemu/qemu-print.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" diff --git a/util/osdep.c b/util/osdep.c index 72b678ca2e3..7c4deda6feb 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -39,6 +39,7 @@ extern int madvise(char *, size_t, int); #include "qemu/error-report.h" #include "qemu/madvise.h" #include "qemu/mprotect.h" +#include "qemu/hw-version.h" #include "monitor/monitor.h" =20 static bool fips_enabled =3D false; --=20 2.25.1