From patchwork Tue Feb 8 20:08:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 540806 Delivered-To: patch@linaro.org Received: by 2002:ad5:420f:0:0:0:0:0 with SMTP id e15csp794409imo; Tue, 8 Feb 2022 12:39:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHkQdVoH3e1QSikUNGlTJzJWT/maL5fk3QUi6GLbz94sSReC/zVEuwbmKYV/HwWDzC34LR X-Received: by 2002:a81:a391:: with SMTP id a139mr6703059ywh.432.1644352776305; Tue, 08 Feb 2022 12:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644352776; cv=none; d=google.com; s=arc-20160816; b=j7kajBqw+J3STFvQCsftnQ+vGl8f4NojI1joplZSh9Bn7R0o3zLB+oZl5YerPF3y8r J0iO18i3SaHYI75+3A1VUVRFMevurxdIOHXU7eUe+1NOYHvYyYg/Bd4A/afgAQYOOaqB N1ztKIYwj1UkEI5HNdgDPOyAFha3gga0+3wJ9crtfsO/36iZeCocEV4moKTFcmraMef5 l7vxeYQJJHgVNl4aQ6yYus1ViOANLjX10hiK7vKCEE9zoHzOgnMd99+Vv7J+CnbE/CgM oxBzkzInbPBseg+NR517yc8yaqBYjDc1C0ybFFbamjvZuDbWD9WRvFqu/6e1QdQkP9Ih 7ZoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ETqgvEp+BK5IeQcaommUlEe8fKOhJ00KVNdgTbqltH8=; b=nwYOUQP5btU8Y++74QMiS8FIFOFWj4k1sZDV0P0V4Eq1JPF0UbYaCiAvn2k+NFI7qQ ImhKe7Petvprv0KiKNaEof/J7Vnr6bHBO5Kou1VY4Atcy0FaCEhdBbaL5pyxmGO49i+h E+T/osrPJcrffeD1bvIqO0OAsSo0foTTmEZFe+Im9FMcQjNFexVat5SVkNmBQy4o35T0 5MYUBAfrO0VRxchMbHCIRHKkQ6wgxDKbmtqYISsu9Okd4YF07bQxsvg6zaikmzEV3hj0 UJhZsq/z5kKuV0IqntR+MbilEiFPSp7s5eNNuLLavIOLrjB9eme4NdtiGnhuJh3ddf2o 7Rrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U1VpaWHh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c138si3265307ywa.10.2022.02.08.12.39.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Feb 2022 12:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U1VpaWHh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHXGx-0003AW-CX for patch@linaro.org; Tue, 08 Feb 2022 15:39:35 -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) 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-Received: by 2002:a05:600c:3488:: with SMTP id a8mr2400179wmq.173.1644350941348; 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) 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 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32e (failed) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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: 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 later. + * 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; -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" /* 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" #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 @@ #include "qemu/osdep.h" #include "qemu/cacheflush.h" +#include "qemu/cacheinfo.h" #include "qemu/bitops.h" 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" int qemu_icache_linesize = 0; int qemu_icache_linesize_log;