From patchwork Wed Mar 12 17:45:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C22DC28B28 for ; Wed, 12 Mar 2025 17:47:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910629.1317301 (Exim 4.92) (envelope-from ) id 1tsQAr-0006hd-5t; Wed, 12 Mar 2025 17:47:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910629.1317301; Wed, 12 Mar 2025 17:47:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAq-0006gd-Ut; Wed, 12 Mar 2025 17:47:20 +0000 Received: by outflank-mailman (input) for mailman id 910629; Wed, 12 Mar 2025 17:47:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAp-0006eC-Nj for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:19 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0ab2f288-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:18 +0100 (CET) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43948f77f1aso488235e9.0 for ; Wed, 12 Mar 2025 10:47:18 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:17 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0ab2f288-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801638; x=1742406438; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZqBQFlJTZsCUlmNgAuNEOWwWaFXwc+Wq2W2eNaP76Wc=; b=WUeZe41NoXlxwUsk1Wgbrrrg+Ruf3OflzildEFWS5v1rI1aUHQQFiHR4pDn8COD4c0 Z0p+wh4gwZAOuRn2whCBdov+TjiY3yxd8C0n10xBQ14hRoh7AcOlNxo7aflc3U5aukeJ yDaq8PUi4CyED3VtZp20iM/P/4qk6WoyZBK1E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801638; x=1742406438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZqBQFlJTZsCUlmNgAuNEOWwWaFXwc+Wq2W2eNaP76Wc=; b=DiCC4XUHkeeNYnwLgb18J+TV9VTQYJyJVJVvagwtnNq4/uOk+4Fg7pkf/ABfmYx070 Rs5Wy2NQR6gsQdW6y4xxT8mIJ/udYi2sCsaAZxJpiqP+vSwTQWeu29fjc0AafKkSxQGA 2uy75SGLteuSm/vY4OiB7w13Yg3vK1bvyT6DVgUYMpT4SNEAE60OZl6AuZ4nUqu52E5D EJPgL3y9WUgHtNGPSm2rFjvuDPdXB0XB6MjTcsD81Z0l4YczM5nU7sxmnwwK8lDUVfOR ihiaf/DAy8cT8Yqv8sMgh6LyBwmuS74KLxd3B60GqMtKa7IHUrT3mzrvvWH2pXuAvtnF fkgw== X-Gm-Message-State: AOJu0YxR+V+uBx4YWTfs4StyycrgUCNwKrW4TqVjjyv6gJMzyFfgiwda YFSIRw90ADduqR7XFVwGv5wAQqMKJj6n9tMlmASlnzVVq0JCY6MU28HklH6eHUhHeQ7NvLY8NxF v X-Gm-Gg: ASbGncvPbpBcdQsVyNuftjS9qLXyHQ11YO6bYVpWk6+SRiQ7eX66Fy4L727r2EcUWVA 9IHKW782odx5qHYFZA6YSTLruv+IMTX3cifQssM7/VE1IkOGGLxLFmsDgRWOAgRsBO++NDbm0Ma 1HlIgwDS51GnM6L0qwE2w7Sc8m4Zc2Uv7IncaioW6LQ3756imiIhAaPcXiyuG6lfENhwPZI7XNa ptmhLbvTtygRydxDYfYYGBH+buXUEKyQCRqVSpeMD0TAEHtrAWXdQ3FbjpDt97RPGYSvOZf5hI0 9WoD+m1cshBWLpYbHEt1Xbajxcg1CupkvRTffLL1X9UEMdP8RQ6iPyj2l1IzajuDR7RZlIxj0ox XGMvbfq0qNgoRXfbP8zhR+na2 X-Google-Smtp-Source: AGHT+IG6WIQbLyBVw6c1o93+Ab+dfGr34YtfYi/4+2Ny4ovDDLsD2cCOH/9AIuJzZw2tSsUE5Y9zaw== X-Received: by 2002:a05:600c:468b:b0:43c:f00b:d581 with SMTP id 5b1f17b1804b1-43cf00bd768mr120761215e9.29.1741801637594; Wed, 12 Mar 2025 10:47:17 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 1/8] xen/elfstructs: Include xen/types.h Date: Wed, 12 Mar 2025 17:45:05 +0000 Message-Id: <20250312174513.4075066-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 elfstructs.h needs the stdint.h types. Two headers arrange this manually, but elf.h and livepatch.h do not, which breaks source files whose headers are properly sorted. elfstructs.h is used by tools too, so limit this to Xen only. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/include/xen/elfstructs.h | 7 ++++++- xen/include/xen/livepatch_elf.h | 1 - xen/include/xen/version.h | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) base-commit: 8e60d47cf0112c145b6b0e454d102b04c857db8c diff --git a/xen/include/xen/elfstructs.h b/xen/include/xen/elfstructs.h index eb6b87a823a8..f64ecec01990 100644 --- a/xen/include/xen/elfstructs.h +++ b/xen/include/xen/elfstructs.h @@ -26,6 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* Outside of Xen, the includer must provide stdint.h or equivalent. */ +#ifdef __XEN__ +#include +#endif + typedef uint32_t Elf32_Addr; /* Unsigned program address */ typedef uint32_t Elf32_Off; /* Unsigned file offset */ typedef uint16_t Elf32_Half; /* Unsigned medium integer */ @@ -45,7 +50,7 @@ typedef uint64_t Elf64_Xword; /* * e_ident[] identification indexes - * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html + * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html */ #define EI_MAG0 0 /* file ID */ #define EI_MAG1 1 /* file ID */ diff --git a/xen/include/xen/livepatch_elf.h b/xen/include/xen/livepatch_elf.h index 842111e14518..a8aafecd34b1 100644 --- a/xen/include/xen/livepatch_elf.h +++ b/xen/include/xen/livepatch_elf.h @@ -5,7 +5,6 @@ #ifndef __XEN_LIVEPATCH_ELF_H__ #define __XEN_LIVEPATCH_ELF_H__ -#include #include /* The following describes an Elf file as consumed by Xen Live Patch. */ diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h index 4856ad1b446d..bc69ec9fb029 100644 --- a/xen/include/xen/version.h +++ b/xen/include/xen/version.h @@ -1,7 +1,6 @@ #ifndef __XEN_VERSION_H__ #define __XEN_VERSION_H__ -#include #include const char *xen_compile_date(void); From patchwork Wed Mar 12 17:45:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BAF3C28B28 for ; Wed, 12 Mar 2025 17:47:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910631.1317321 (Exim 4.92) (envelope-from ) id 1tsQAs-0007Aa-Rk; Wed, 12 Mar 2025 17:47:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910631.1317321; Wed, 12 Mar 2025 17:47:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAs-000795-Hv; Wed, 12 Mar 2025 17:47:22 +0000 Received: by outflank-mailman (input) for mailman id 910631; Wed, 12 Mar 2025 17:47:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAr-0006h8-9U for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:21 +0000 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [2a00:1450:4864:20::430]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0b3c08ac-ff6a-11ef-9898-31a8f345e629; Wed, 12 Mar 2025 18:47:19 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3913958ebf2so89779f8f.3 for ; Wed, 12 Mar 2025 10:47:19 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:18 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0b3c08ac-ff6a-11ef-9898-31a8f345e629 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801638; x=1742406438; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ASh+oxmtGu6mpYhQylcthMaG5UYE6EuOEdO1LTm87Ak=; b=V28NYY3tA4sb5oMuQbTG8UICVeLUCJ61yglzgV/505XvpVEfTtGHIba4gZ2NE6zYSF 6EVHBmj5USnn6zkwHPW6cO/FqcVzK6Ak1SDjunBW51pV57Pb+ov3SGdIsAbKW7GANE/t PNPva5GXpwSc1svZXd7NaQJyXqY9VL8p2kxfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801638; x=1742406438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ASh+oxmtGu6mpYhQylcthMaG5UYE6EuOEdO1LTm87Ak=; b=ZBQCV2pKm+xOoUb1t+bGPETVD4NFR+UKnLAtp+0NpO2rw0+tPwwRXmqfXvNQs+33bz CNuz6Iz5Vjggw4ILQ3DqPRx/YqvgkxUoQKymkLJIUMDSFRM7cYbVMgcmVHbRuR1a0Cot EWSfCjPhcVhM0GLvCRpjJCWitgkjRgVHulF51HdCLOwOJ+Jl2ihNldiplrIWQEXesH8Y g8cjxPZcuSYb9SHudABpmmLsMPM1HZ2Lsj2jjtym62lEtKRxSEgQh2HWyg02lBOtpUTz DMa6lSomgvKxtK8QjDAa3MoHPkhZZTMcKa0L5epbcu/CTnyEN8+qV2Fvh1v0woxv5Si+ 34qw== X-Gm-Message-State: AOJu0YzSyXS2H/HfkLj9mB0IRjIZmmT64pR/9EivGF+yaXaEGR6UMD51 /mkjybq7jn1zauFlvNepmDhXQnp1FbmjhxHtlU4xle3TJMKteZFfj0gS01ZfMrgjpcLX6rubpOM k X-Gm-Gg: ASbGncuv2YEFc+sganGL28egSoMtDhRTOJ0im+nV+8mY8mrF72+folW282EC5YyH8H+ YCjHdY5164zczzFT9iCRChzhvmiz6RzUksEEs4viaiYvgUMm8n3Pvgvh4xFRVzwgsAYZiRXeN35 NJAa1jGxBs8OcfbZnHJsV8i0CfSvFgunpPIyDn4asiOvmy+7utHPFnZ83u0yrGD0hl9gP6bv4/0 Be9kvgsIDLLqsjKklkXAcFxfdUhUJ9RQs9Ufk9PDhChwdSz99N0AbthEExGXy9WLO0IUvTZNrTv JkYJBZmsVkowuMAnv1esPmIcBXU3ruQLpLI6AYOZbVJA93LYjXHuf2Dr7FmqS6XG4ZjVlftPYG9 5Hje836oGU262Mvyt12lgbUdx X-Google-Smtp-Source: AGHT+IE5nDsvP0JO7zeLJ2XUe6p6WZCWTlMmroP6ph36U/2EbdaCZ462o6JeGm2rCf9WGs3fzhBkxQ== X-Received: by 2002:a05:6000:154b:b0:390:f6be:af1d with SMTP id ffacd0b85a97d-3926beec333mr8724474f8f.41.1741801638478; Wed, 12 Mar 2025 10:47:18 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 2/8] xen/livepatch: Fix include hierarchy Date: Wed, 12 Mar 2025 17:45:06 +0000 Message-Id: <20250312174513.4075066-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 xen/livepatch.h includes public/sysctl.h twice, which can be deduplicated, and includes asm/livepatch.h meaning that each livepatch.c does not need to include both. Comment the #else and #endif cases to aid legibility. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/arm32/livepatch.c | 1 - xen/arch/arm/arm64/livepatch.c | 1 - xen/arch/arm/livepatch.c | 1 - xen/arch/x86/livepatch.c | 1 - xen/include/xen/livepatch.h | 10 +++++----- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/arm32/livepatch.c b/xen/arch/arm/arm32/livepatch.c index 134d07a175bb..8541c71d6e2e 100644 --- a/xen/arch/arm/arm32/livepatch.c +++ b/xen/arch/arm/arm32/livepatch.c @@ -9,7 +9,6 @@ #include #include -#include void arch_livepatch_apply(const struct livepatch_func *func, struct livepatch_fstate *state) diff --git a/xen/arch/arm/arm64/livepatch.c b/xen/arch/arm/arm64/livepatch.c index 6efe4ec770d4..01e6db94be67 100644 --- a/xen/arch/arm/arm64/livepatch.c +++ b/xen/arch/arm/arm64/livepatch.c @@ -13,7 +13,6 @@ #include #include #include -#include void arch_livepatch_apply(const struct livepatch_func *func, struct livepatch_fstate *state) diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c index 3805b2974663..2fbb7bce60bb 100644 --- a/xen/arch/arm/livepatch.c +++ b/xen/arch/arm/livepatch.c @@ -11,7 +11,6 @@ #include #include -#include /* Override macros from asm/page.h to make them work with mfn_t */ #undef virt_to_mfn diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c index be40f625d206..bdca355dc6cc 100644 --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @@ -17,7 +17,6 @@ #include #include #include -#include #include static bool has_active_waitqueue(const struct vm_event_domain *ved) diff --git a/xen/include/xen/livepatch.h b/xen/include/xen/livepatch.h index d074a5bebecc..c1e76ef55404 100644 --- a/xen/include/xen/livepatch.h +++ b/xen/include/xen/livepatch.h @@ -14,12 +14,14 @@ struct xen_sysctl_livepatch_op; #include #include /* For -ENOSYS or -EOVERFLOW */ -#include /* For LIVEPATCH_OPAQUE_SIZE */ +#include #ifdef CONFIG_LIVEPATCH #include +#include + /* * We use alternative and exception table code - which by default are __init * only, however we need them during runtime. These macros allows us to build @@ -93,8 +95,6 @@ int arch_livepatch_secure(const void *va, unsigned int pages, enum va_type types void arch_livepatch_init(void); -#include /* For struct livepatch_func. */ -#include int arch_livepatch_verify_func(const struct livepatch_func *func); static inline @@ -143,7 +143,7 @@ struct payload; int revert_payload(struct payload *data); void revert_payload_tail(struct payload *data); -#else +#else /* !CONFIG_LIVEPATCH */ /* * If not compiling with Live Patch certain functionality should stay as @@ -165,7 +165,7 @@ static inline bool is_patch(const void *addr) { return 0; } -#endif /* CONFIG_LIVEPATCH */ +#endif /* !CONFIG_LIVEPATCH */ #endif /* __XEN_LIVEPATCH_H__ */ From patchwork Wed Mar 12 17:45:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 095E0C28B2E for ; Wed, 12 Mar 2025 17:48:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910630.1317314 (Exim 4.92) (envelope-from ) id 1tsQAs-00077H-E7; Wed, 12 Mar 2025 17:47:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910630.1317314; Wed, 12 Mar 2025 17:47:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAs-000778-B8; Wed, 12 Mar 2025 17:47:22 +0000 Received: by outflank-mailman (input) for mailman id 910630; Wed, 12 Mar 2025 17:47:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAr-0006eC-3o for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:21 +0000 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [2a00:1450:4864:20::32c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0bdfa7d0-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:20 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43d07ca6a80so406795e9.1 for ; Wed, 12 Mar 2025 10:47:20 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:19 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0bdfa7d0-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801639; x=1742406439; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sjnR5X/bvG/Rmeh84cSnx/kY2mYzKC0sb4JiHUky2ww=; b=UGjGwvGO3CJPXz+G38z5DEqYsPLyr3u4G1Yj76J6Rjt2JRcbhaP+SAVDUFBHhpLyuW J4j5c4AM7w7N2q/QbjFyb5abIY+0ffBhu3wXXF8GI/7Dim5AV6zRWKL3UwYyHJg+IdVC im2AIFm+Q7SGfNkR7kNxntkjhsDN6FTfYPHgY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801639; x=1742406439; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sjnR5X/bvG/Rmeh84cSnx/kY2mYzKC0sb4JiHUky2ww=; b=fb2bgusWYiuPEGlyE32upsr0wUDKZL00ND91vwEOUiuLAWFqanAR3/iCWBKn3zNnFb H3E004jvPPg2R4zZlVJOxbZog+zzlo/2gESCuhks+/veLC2TYb3YltOjiNT7Gnk+vi57 VcAxifKX+PtxktHpUgcxXYvKW5VcRb/h6UdgJyha9EULMX4MiiTtGbvXOv9UZ+PPbVqL IQmRmtkbtrI1hhGfvJ0wDwJaGBJa52/CirXyUVlwQ9zziCWad4qX4yUE2vmoYbhcZnk5 KekUPrCHpOTePS2n8fs4Fj+sjjQOgY8wHWLcBfQoudyRsEszcUj+k9Fg90YosWsylmvz nwtA== X-Gm-Message-State: AOJu0YyzYVMnf/VjHJqCc0ck5Vh8IxZO71OILyTm9j5+O/hCrZ6nqhga IT61r6wxcuJzfKD1lS5haGBYheaRjJqQPMUfaeDTPud6C+bnOTwWlb5dv/iEuQylxY4/BKIryDm T X-Gm-Gg: ASbGnctrIZyW5KZQWqpwAtugD9gdlj89W1MJOZm6+k1IxoDqJP9XsRAdj8kMMwDZJM5 T0fQi+OPDF3Crndt8c/DurCLjVgWqprDVcR1VZsVmURXRTSaYBqgggxQ5YBqccLt0B0meZ/RAR2 pVGvIqgSSTZbItLnRmxrs0SqqE7E1QxeRDtHqbR3/6YEuNMXp3M0SsFoMmHrj9+5JeaLD7wRzVj WJ5DAWQPAewor02kqXOZI5hUzgGwDVdZwudyry+8lQ/DXywPxcbF1zHWcWTSQI9ivRzQL5gM0Cp vlDAs1iCqYnll5tWioykE0O1gGWQREVUNAlBVlDhMYueuXBJ5ccjkGqejWFpfecs8wkYqZS774E EIPyOaAUUl/MHoYRgH18t3A+S X-Google-Smtp-Source: AGHT+IERj70emN4JXV0Hed5t9quWPL7b6/6L7k1RqZgYBZc+Z+cuxtIHpttWzPQyPqsdoOb8vClk2w== X-Received: by 2002:a05:600c:3b13:b0:43d:b3:f95 with SMTP id 5b1f17b1804b1-43d00b313bemr87216185e9.28.1741801639477; Wed, 12 Mar 2025 10:47:19 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 3/8] xen: Sort includes Date: Wed, 12 Mar 2025 17:45:07 +0000 Message-Id: <20250312174513.4075066-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 ... needing later adjustment. Drop types.h when it's clearly not needed. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/mmu/setup.c | 2 +- xen/arch/x86/alternative.c | 12 ++++++------ xen/arch/x86/livepatch.c | 8 ++++---- xen/common/memory.c | 4 +++- xen/common/page_alloc.c | 5 ++--- xen/include/xen/mm.h | 6 +++--- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c index 30afe9778194..f6119ccacf15 100644 --- a/xen/arch/arm/mmu/setup.c +++ b/xen/arch/arm/mmu/setup.c @@ -12,8 +12,8 @@ #include #include -#include #include +#include /* Override macros from asm/page.h to make them work with mfn_t */ #undef mfn_to_virt diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c index 1ba35cb9ede9..46b04c9cb83d 100644 --- a/xen/arch/x86/alternative.c +++ b/xen/arch/x86/alternative.c @@ -4,18 +4,18 @@ */ #include -#include +#include +#include + +#include #include #include +#include +#include #include -#include -#include #include #include #include -#include -#include -#include #define MAX_PATCH_LEN (255-1) diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c index bdca355dc6cc..5158e91f7e6e 100644 --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @@ -5,14 +5,14 @@ #include #include #include +#include +#include #include #include -#include -#include -#include #include -#include #include +#include +#include #include #include diff --git a/xen/common/memory.c b/xen/common/memory.c index 8ca4e1a8425b..61a94b23abae 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -25,12 +25,14 @@ #include #include #include -#include + #include #include #include #include + #include + #include #ifdef CONFIG_X86 diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 5f9c9305ef37..bc029ea797a2 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -133,7 +133,6 @@ #include #include #include -#include #include #include #include @@ -144,14 +143,14 @@ #include #include -#include #include +#include #ifdef CONFIG_X86 #include #include -#include /* for highmem_start only */ #include +#include #else #define p2m_pod_offline_or_broken_hit(pg) 0 #define p2m_pod_offline_or_broken_replace(pg) BUG_ON(pg) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 16f733281af3..45000cc3f64b 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -63,11 +63,11 @@ #include #include -#include -#include #include -#include +#include #include +#include + #include struct page_info; From patchwork Wed Mar 12 17:45:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013718 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E415C28B2E for ; Wed, 12 Mar 2025 17:47:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910632.1317333 (Exim 4.92) (envelope-from ) id 1tsQAu-0007ZN-3q; Wed, 12 Mar 2025 17:47:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910632.1317333; Wed, 12 Mar 2025 17:47:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAt-0007Xi-US; Wed, 12 Mar 2025 17:47:23 +0000 Received: by outflank-mailman (input) for mailman id 910632; Wed, 12 Mar 2025 17:47:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAs-0006eC-PC for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:22 +0000 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [2a00:1450:4864:20::436]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0cf638c6-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:22 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3913cf69784so106475f8f.1 for ; Wed, 12 Mar 2025 10:47:22 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:21 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0cf638c6-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801641; x=1742406441; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=38l7+vMOhtA3L47Dw/6UyPgylpeRB4oAz9vh/BWRMnE=; b=pA2bxwPdLupGIyG9Lsu+TVxyb9DZrY3+Nic9Lbpn0KqLilcTXVbUUseDzaAasTzR8t vyob1zHuXC63sw9fxv97UPsQW72I9dJSZMSHb3fmbaqTgEPiTcnguwlyn8XD1kQjip36 am6ip4rF50xFStFDmHYeoxdxRIoPeQAfULY0A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801641; x=1742406441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=38l7+vMOhtA3L47Dw/6UyPgylpeRB4oAz9vh/BWRMnE=; b=wqQ88Nsy01RI1r26dphQgb0XhK704LLBiUVXeXJKhOiqKAli5UKrFNF4xM1+H7i+zB 8wAe27FYAqYHDjbBVDXVnSI41eI3Z8rj9UVlKQqgLXboE0j2dcSQcIEdxaXHa1nh6mG9 D9C4vYTLzCDfFxi56QMRFqME/11TLEjGbQOghHKXIeASdAZDkCPvkxC8ecqTqA8Q42WG Kz2toFI6HIHUmYt5kZk4/A1fCphwj+4Qs4RMTH3rJgC6aT76IY2AsQlAINWcFYkIXe3i vSuv6tNkVzbUkGyndRbODd0AhbYRzqw8MSuCVrhPp8vyfBX3nV5nm4pBVnidlp6b/d/3 gCWQ== X-Gm-Message-State: AOJu0YyX2JBbyzIzn6txOa4FSr4cQFGBj2TetvwSNmxDPlEXix+hwO+F B0FuIn9yKmMcg/Npme72o/+fH6ir429Bh0Skvkn4Y3ErGYxJxrveJ/ic4R6ReK9lRDiptThneMH B X-Gm-Gg: ASbGncuQKcttUX2IhSk3D6aYcMYqHoIoMVFpVAuuvhz1vQE9lL9Bj1fWK8HtaJ/SF2d ZRaXYrBTz54mQcFEygedzqJEn35b396YMRsBzamwPsc0fmSNoY6yNutiBZveRgqaZw+NJjRdDMO cQ0PBMlgyZvFqyUkJlc+jxcbrJ5dBNuXa66fIAlpis+WlWU+BA9NFXlFdGFLGfuJl1JLkesvnfT 7LGSV4r0DI9pGmQ4Pp+6RgyAOPdYNSxTi6hiM9/E8AwrBBP+DfFrASB8TW8PniBsoB8+SWVnPhh yIcnqou2S1gzz1o0izqVtG0i+Itkvg/4HPKITcBoKStOsZ7hQeKVJ5p1IDYh5KrRxLhjSOeUyuY 2/ce/ZQTBwPHXzlLgR/tzey/N X-Google-Smtp-Source: AGHT+IE8yNmj/tKBsKKOuHgS2hQbeGbQSp2UYCGc8g9H/+eTe9f2P5rgV91G3sJSSWVZe/syuzTNPg== X-Received: by 2002:a05:6000:4102:b0:391:487f:27e7 with SMTP id ffacd0b85a97d-391487f2b5amr12133945f8f.55.1741801641443; Wed, 12 Mar 2025 10:47:21 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 4/8] xen/common: Split tlk-clock.h out of mm.h Date: Wed, 12 Mar 2025 17:45:09 +0000 Message-Id: <20250312174513.4075066-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 xen/mm.h includes asm/tlbflush.h almost at the end, which creates a horrible tangle. This is in order to provide two common files with an abstraction over the x86-specific TLB clock logic. First, introduce CONFIG_HAS_TLB_CLOCK, selected by x86 only. Next, introduce xen/tlb-clock.h, providing empty stubs, and include this into memory.c and page_alloc.c No functional change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio There is still a mess here with the common vs x86 split, but it's better contained than before. --- xen/arch/x86/Kconfig | 1 + xen/common/Kconfig | 3 +++ xen/common/memory.c | 1 + xen/common/page_alloc.c | 1 + xen/include/xen/mm.h | 27 -------------------- xen/include/xen/tlb-clock.h | 49 +++++++++++++++++++++++++++++++++++++ 6 files changed, 55 insertions(+), 27 deletions(-) create mode 100644 xen/include/xen/tlb-clock.h diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 6e41bc0fb435..e9a166ee3dd0 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -28,6 +28,7 @@ config X86 select HAS_PCI_MSI select HAS_PIRQ select HAS_SCHED_GRANULARITY + select HAS_TLB_CLOCK select HAS_UBSAN select HAS_VMAP select HAS_VPCI if HVM diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 6166327f4d14..dcf7d9d00d0a 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -83,6 +83,9 @@ config HAS_PMAP config HAS_SCHED_GRANULARITY bool +config HAS_TLB_CLOCK + bool + config HAS_UBSAN bool diff --git a/xen/common/memory.c b/xen/common/memory.c index 61a94b23abae..9138fd096696 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index bc029ea797a2..b90c3d7988b4 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -137,6 +137,7 @@ #include #include #include +#include #include #include diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 45000cc3f64b..fff36ff903d6 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -588,33 +588,6 @@ unsigned long get_upper_mfn_bound(void); #include -static inline void accumulate_tlbflush(bool *need_tlbflush, - const struct page_info *page, - uint32_t *tlbflush_timestamp) -{ - if ( page->u.free.need_tlbflush && - page->tlbflush_timestamp <= tlbflush_current_time() && - (!*need_tlbflush || - page->tlbflush_timestamp > *tlbflush_timestamp) ) - { - *need_tlbflush = true; - *tlbflush_timestamp = page->tlbflush_timestamp; - } -} - -static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp) -{ - cpumask_t mask; - - cpumask_copy(&mask, &cpu_online_map); - tlbflush_filter(&mask, tlbflush_timestamp); - if ( !cpumask_empty(&mask) ) - { - perfc_incr(need_flush_tlb_flush); - arch_flush_tlb_mask(&mask); - } -} - enum XENSHARE_flags { SHARE_rw, SHARE_ro, diff --git a/xen/include/xen/tlb-clock.h b/xen/include/xen/tlb-clock.h new file mode 100644 index 000000000000..796c0be7fbef --- /dev/null +++ b/xen/include/xen/tlb-clock.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef XEN_TLB_CLOCK_H +#define XEN_TLB_CLOCK_H + +#include + +#ifdef CONFIG_HAS_TLB_CLOCK + +#include + +#include + +static inline void accumulate_tlbflush( + bool *need_tlbflush, const struct page_info *page, + uint32_t *tlbflush_timestamp) +{ + if ( page->u.free.need_tlbflush && + page->tlbflush_timestamp <= tlbflush_current_time() && + (!*need_tlbflush || + page->tlbflush_timestamp > *tlbflush_timestamp) ) + { + *need_tlbflush = true; + *tlbflush_timestamp = page->tlbflush_timestamp; + } +} + +static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp) +{ + cpumask_t mask; + + cpumask_copy(&mask, &cpu_online_map); + tlbflush_filter(&mask, tlbflush_timestamp); + if ( !cpumask_empty(&mask) ) + { + perfc_incr(need_flush_tlb_flush); + arch_flush_tlb_mask(&mask); + } +} + +#else /* !CONFIG_HAS_TLB_CLOCK */ + +struct page_info; +static inline void accumulate_tlbflush( + bool *need_tlbflush, const struct page_info *page, + uint32_t *tlbflush_timestamp) {} +static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp) {} + +#endif /* !CONFIG_HAS_TLB_CLOCK*/ +#endif /* XEN_TLB_CLOCK_H */ From patchwork Wed Mar 12 17:45:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3737EC28B2E for ; Wed, 12 Mar 2025 17:47:57 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910634.1317346 (Exim 4.92) (envelope-from ) id 1tsQAv-0007pF-A7; Wed, 12 Mar 2025 17:47:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910634.1317346; Wed, 12 Mar 2025 17:47:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAv-0007nh-38; Wed, 12 Mar 2025 17:47:25 +0000 Received: by outflank-mailman (input) for mailman id 910634; Wed, 12 Mar 2025 17:47:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAt-0006eC-PX for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:23 +0000 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [2a00:1450:4864:20::32f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0d80f95d-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:23 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43d0359b1fcso1246365e9.0 for ; Wed, 12 Mar 2025 10:47:23 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:21 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0d80f95d-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801642; x=1742406442; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ZxpY1j+tYKf6h6cwDyqwsZP3HXNRy5CWzq/bv6KU6I=; b=kHq6kx/bMnSVc3AHtqOnznsh1Cm1uCwLN22KrucR9Y0CpTSkzf9xv3J13uo8EGFtxg vn4W7dMESG1Evrd4mKkYTBZKq1pnHhUNkXmAJ5bG/1ZVZLg6jesocSGU14or50DEw4B/ +NNEPV8wK6BhaAsJbPdikbNglMiQyxZozvBF4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801642; x=1742406442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ZxpY1j+tYKf6h6cwDyqwsZP3HXNRy5CWzq/bv6KU6I=; b=Ux7FZ+/sCEKkgAAc6eJHZJAkHRgp7NKN+Ecv5vCbJzktgq35FdfZQUVFxER3riF7RQ o/XlcFpTfXM+OvpNaOgJ8PCyESbyylSChro/406SZQS3mXEGIhj0DoHL/mjdbD+M/C5Q JnQmyPfJND0kmltzmMbfb5VT7j7Y+PanoJmeYLsIWXUAFWnhl87URFSIw7GpNF2f1H7D ok+nbHLWnhOGE5r1TG6hBWG8ov+xcFQQfcBQo5kaKw6t6sb0kIzcj6S+IRnz79ipgKHI emTvHrsd4+R7/RxZYPRKVh4u3kja2mqwoq8Ou3eeOnWkRrzP91CZg08CFiet5v0GkQ03 MRrA== X-Gm-Message-State: AOJu0YyN7RCfk6hs8PJ2WgnGrNOEAdw3hHMRua7xugZSCb10engRV6vS arPs0lDTWzVUoUlpzycDXJFe9F43z8z+VmZE+zXcLqWSUH61zs2vHwbuWGkEW5eLh9jnAEYnPns w X-Gm-Gg: ASbGncteVHRcVWAGSnRZ7OcZsLGbPYaXkoK355jDgPKYkdEd+JhM+YvUMufDXfR5/q5 wzvvrFGHNxVmB2fBqOPYkD7yPDa3c3Ll1QKgJd4s6PnmO87xXqhpzsVYSJj26SmvaKhjALcrrHa ya1XBn92NEN59Fm8NNhM3CQo80nKFMQpMfsPs1qBHz4hMQdtsmM20sOCuZtOJns9oJZ8QoI0Tdf MPJ7BfsA42QW6AiDEva5EVOyNGZwLWKJmzfjzsUcqdLbEyfHShbBQrnoKQxyyMUttMHlX/ZpD3J GR1lxTZPWTTHPXC1aocDeh6n5E38lpo5RDUxYRn3iqE+UhPVPp1H9eVV8GLqxPjBUHqrHPC8nrW wm4Ig5jdpF6LTiCeXiEEJN034iYDz4SBUZ90= X-Google-Smtp-Source: AGHT+IFOZgz21JTkr53wf6nAyfUuR8xGMtR4kI57Y4nBotlAubxbKXRNoHNCn66WKMXoJaECwuxQTA== X-Received: by 2002:a05:600c:512a:b0:439:8878:5029 with SMTP id 5b1f17b1804b1-43d16192475mr4024405e9.2.1741801642295; Wed, 12 Mar 2025 10:47:22 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 5/8] xen/arch: Strip out tlb-clock stubs for non-implementors Date: Wed, 12 Mar 2025 17:45:10 +0000 Message-Id: <20250312174513.4075066-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Now that there's a common stub implementation TLB clocks, there's no need for architectures to provide their own. Repeatedly zeroing page->tlbflush_timestamp is no use, so provide an even more empty common stub for page_set_tlbflush_timestamp(). No practical change. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/include/asm/flushtlb.h | 14 -------------- xen/arch/ppc/include/asm/flushtlb.h | 14 -------------- xen/arch/riscv/include/asm/flushtlb.h | 14 -------------- xen/include/xen/tlb-clock.h | 1 + 4 files changed, 1 insertion(+), 42 deletions(-) diff --git a/xen/arch/arm/include/asm/flushtlb.h b/xen/arch/arm/include/asm/flushtlb.h index e45fb6d97b02..6f69a5bdc8c2 100644 --- a/xen/arch/arm/include/asm/flushtlb.h +++ b/xen/arch/arm/include/asm/flushtlb.h @@ -3,20 +3,6 @@ #include -/* - * Filter the given set of CPUs, removing those that definitely flushed their - * TLB since @page_timestamp. - */ -/* XXX lazy implementation just doesn't clear anything.... */ -static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {} - -#define tlbflush_current_time() (0) - -static inline void page_set_tlbflush_timestamp(struct page_info *page) -{ - page->tlbflush_timestamp = tlbflush_current_time(); -} - #if defined(CONFIG_ARM_32) # include #elif defined(CONFIG_ARM_64) diff --git a/xen/arch/ppc/include/asm/flushtlb.h b/xen/arch/ppc/include/asm/flushtlb.h index afcb74078368..f89037bd4543 100644 --- a/xen/arch/ppc/include/asm/flushtlb.h +++ b/xen/arch/ppc/include/asm/flushtlb.h @@ -4,20 +4,6 @@ #include -/* - * Filter the given set of CPUs, removing those that definitely flushed their - * TLB since @page_timestamp. - */ -/* XXX lazy implementation just doesn't clear anything.... */ -static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {} - -#define tlbflush_current_time() (0) - -static inline void page_set_tlbflush_timestamp(struct page_info *page) -{ - page->tlbflush_timestamp = tlbflush_current_time(); -} - /* Flush specified CPUs' TLBs */ void arch_flush_tlb_mask(const cpumask_t *mask); diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h index 51c8f753c51e..23739a22fb2a 100644 --- a/xen/arch/riscv/include/asm/flushtlb.h +++ b/xen/arch/riscv/include/asm/flushtlb.h @@ -20,20 +20,6 @@ static inline void flush_tlb_range_va(vaddr_t va, size_t size) sbi_remote_sfence_vma(NULL, va, size); } -/* - * Filter the given set of CPUs, removing those that definitely flushed their - * TLB since @page_timestamp. - */ -/* XXX lazy implementation just doesn't clear anything.... */ -static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {} - -#define tlbflush_current_time() (0) - -static inline void page_set_tlbflush_timestamp(struct page_info *page) -{ - BUG_ON("unimplemented"); -} - /* Flush specified CPUs' TLBs */ void arch_flush_tlb_mask(const cpumask_t *mask); diff --git a/xen/include/xen/tlb-clock.h b/xen/include/xen/tlb-clock.h index 796c0be7fbef..467f6d64a6ca 100644 --- a/xen/include/xen/tlb-clock.h +++ b/xen/include/xen/tlb-clock.h @@ -44,6 +44,7 @@ static inline void accumulate_tlbflush( bool *need_tlbflush, const struct page_info *page, uint32_t *tlbflush_timestamp) {} static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp) {} +static inline void page_set_tlbflush_timestamp(struct page_info *page) {} #endif /* !CONFIG_HAS_TLB_CLOCK*/ #endif /* XEN_TLB_CLOCK_H */ From patchwork Wed Mar 12 17:45:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 504CAC28B2E for ; Wed, 12 Mar 2025 17:48:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910635.1317360 (Exim 4.92) (envelope-from ) id 1tsQAw-0008Fi-L3; Wed, 12 Mar 2025 17:47:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910635.1317360; Wed, 12 Mar 2025 17:47:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAw-0008ET-Ei; Wed, 12 Mar 2025 17:47:26 +0000 Received: by outflank-mailman (input) for mailman id 910635; Wed, 12 Mar 2025 17:47:24 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAu-0006eC-Dd for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:24 +0000 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [2a00:1450:4864:20::32a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0df9be76-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:23 +0100 (CET) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43cec5cd73bso414845e9.3 for ; Wed, 12 Mar 2025 10:47:23 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:22 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0df9be76-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801643; x=1742406443; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P9cAeUqPHU2Cwtf0V4Y32o0EVczvwD9P2qTJlu4OoBU=; b=KdhM5aCh5Poc/OFmfPxHKqaQaVpuJPE0/xDVuJTPNmL23Iy/Qw+18Wf8GUxv6SYFv6 ffp8naXpMyw7Xciqpqa8ohRrrU8HjCcL+ubig/PRkR+6s6PqxosccqvF0aYInY4mjue2 lfNzwN9tjtvQgmULG4HK92rloLmht+/+J1fU4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801643; x=1742406443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P9cAeUqPHU2Cwtf0V4Y32o0EVczvwD9P2qTJlu4OoBU=; b=L7pJ9PuGlAPotLGs9Y+SXrNoDzaeDLcTHoctWGn+jh+8yAIDKXg3sYK6z6f2Jt8Zch VCKKloVkPnxLEnrVeTISVjMYS1JFvpdp5jQvVsl/hDRs8WQOUijjxOLGXR/FrDFmrGib VexHATMvIOjexmlmlpc4HcCK7rCJrDth6JIK7Xev81YX4MWbRbR31Y+HK3YhxPpDSTgB Q0MWB2TEFRPOAW7w7UItRMuLmDPalFNVymWQYAMcBpyIKnwheHO8lXIFhXjg8TmPMjvz GfbIXh/hGBAf7tJS3rC7+bbU8yI3IWARIspsnqYRZF6CsmD39gjWqP5DZsFPs17AzSE1 zx4A== X-Gm-Message-State: AOJu0YwOTP0voMABKou3GebLXqJG6hKxdKm81d4fNyPec3KEnygnK3dq dLK0KkQ5nX82bh+0F8r+/0VFsypUpbD89IfZ6hHwPZB/8R/doLIxbjzEIRykpgRPnO8D1TQPbDt + X-Gm-Gg: ASbGncvSfFLo+OWPRES2Hf9gp8HHKflsmgI008S6VXlPVIHMwqW/08DiXkTKtVETV78 mTb6LFNozjzdyfRTeiUzsm9RNnHyxwxgELPpWsdbPAofZjPoi8kWtUxNfYSpiXQ90Ic4gjnhDeC 2AFcakb9OaR5FSjkdW9APgPdZymPLu9dpOInuWdHeyyuK2AliRODgyUXcaBXX0JLBTVS3z34dDh 3YnwDAXEzs3FoWHGDjwZGLMiE3MikXpMwWu2AbAc5cZFhjPKVHuQ/XmTadlbxjmnUbcc1I3gBAP xpHBJz+YyxVrz1AIR2623gcL+0tR3m4F0ZyjTiVMqLRegIP7iVjNRMdPCZ4PVrOmdMGFhXrPFTQ lSp/aYnnnpf0vbycNtGxiSEw0 X-Google-Smtp-Source: AGHT+IG8sZ3w48VKqI38MuoFdpkslJZlClY6x5DWn0JuaiRhb3MT2pkvAQD8ztt52RawpxEzoLhf4g== X-Received: by 2002:a05:600c:1d01:b0:43c:e467:d6ce with SMTP id 5b1f17b1804b1-43ce467d720mr153810085e9.4.1741801643163; Wed, 12 Mar 2025 10:47:23 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 6/8] xen/mm: Exclude flushtlb.h from mm.h for PPC and RISC-V Date: Wed, 12 Mar 2025 17:45:11 +0000 Message-Id: <20250312174513.4075066-8-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 put_page_alloc_ref(), the final function in xen/mm.h uses test_and_clear_bit() which is picked up transitively by all architectures. RISC-V gets it only via flushtlb.h, hence why it notices here. ARM and x86 will be cleaned up in subsequent patches. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/include/xen/mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index fff36ff903d6..154e649db9e4 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -61,6 +61,7 @@ #ifndef __XEN_MM_H__ #define __XEN_MM_H__ +#include #include #include #include @@ -586,7 +587,9 @@ void destroy_ring_for_helper(void **_va, struct page_info *page); /* Return the upper bound of MFNs, including hotplug memory. */ unsigned long get_upper_mfn_bound(void); +#if defined(CONFIG_X86) || defined(CONFIG_ARM) #include +#endif enum XENSHARE_flags { SHARE_rw, From patchwork Wed Mar 12 17:45:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61A1AC28B2E for ; Wed, 12 Mar 2025 17:48:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910637.1317372 (Exim 4.92) (envelope-from ) id 1tsQAx-0000A0-VA; Wed, 12 Mar 2025 17:47:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910637.1317372; Wed, 12 Mar 2025 17:47:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAx-00009A-Nz; Wed, 12 Mar 2025 17:47:27 +0000 Received: by outflank-mailman (input) for mailman id 910637; Wed, 12 Mar 2025 17:47:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAw-0006eC-JD for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:26 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0e90b725-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:25 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3912c09bea5so95411f8f.1 for ; Wed, 12 Mar 2025 10:47:25 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:23 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0e90b725-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801644; x=1742406444; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sMLj39aTFhGq6xn1dDjh3SoXXw78RV2nULsjkmPxH8c=; b=jMTvDCFvHFJXNOY5FYg8OuGsgFVI/SgaCCYxBJa18W52lCpPzQQ9Und3xlkDt1WnHd XzEgbDj/s6aIf41YQrDOBRkykO2v8fZ7HSLvwSde38HpAYF42u2FX6Y/WfxE1K5L9gsV xYk5giWENkdO8fLEPY01KmDyWOEvCwRunQQMM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801644; x=1742406444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sMLj39aTFhGq6xn1dDjh3SoXXw78RV2nULsjkmPxH8c=; b=PTt8cqRBg72Vcvla30XHX8PXW49kOe+yXzGF2ocYb01nNVQEG3bZDOkn4vqLYfC33+ fRdeQRuqAjgjGfthCrmqm+ByqNrMg7e+nwx5K0/OxponnezMnzzRu0fiMGBPRKCdu/Hx r47HkVL67u3nhTBeVpHHz5X7D6Qrzzg9dWopBgyntZ61sqxFA8tVQj6JL4PSuEpo7GEQ eaEMoAWQS/8G9n5RhrvOqOqv6S/EFgzw8KFrThcBuTBoooCU7ZypzsvEpfgl1u0S9WKC mL+p2JrBBsm1M85IPAgV9qu2a9YL3h1jlwDJeoCbck5mrJUaLYQjp+hx3nzCfGCxWsbz EZlQ== X-Gm-Message-State: AOJu0YxHeWKILlkTCegTb1boXs5fDJzZP07nfVWygRjGQseKF/rZek0/ 04laTmbBQ2YByX2nYtbr0kSrgaDSPWnRrBrCdQAJitgpTlFkjlJ1n527ht5+KbQFPfFlaxhGzrP 4 X-Gm-Gg: ASbGnctaR4DsLLUiDSSRO1xtQFPKniUn8lzaYPTD6AOOeOxlIWnwf5nFATdqQBZDx/A uVO8LNDt8CnZ4JzvoPO8Mv10u8TaZ3TDR51lAJd780AGkzO+39UU+ys/7LvUQtjtMLLDVdcMUtB DtY8VnHTprci+3j5VEufaOu9//+YCat6WqynqSvKsNupJ3WmYXYJ0H2mRYUWaMjaCOusVyEPlme oP7cGmknq/1ZZdp0Os9YIRTvwUAX7KHv4YG42inM/xiltEftoBU2wa2z/RpCkJLbE2YkSQF8f6t WWmYgpbbmJXXgwrQK5oeUDtBTvDfoj585bnGiXU+ozK0KdqSXWLbU2tsIsjwsLwersQeenHFJZD gX0eT1MCp2QL5BUrRD518D2NL X-Google-Smtp-Source: AGHT+IG61+gv4GRyGYC0ZSkNJoh2fbS1N8UJczQXoQ9YfaukHazP+50OpE/OkLNZpd99M73Dx+2y+A== X-Received: by 2002:a05:6000:4023:b0:38f:28dc:ec23 with SMTP id ffacd0b85a97d-392641c033fmr6725775f8f.19.1741801644074; Wed, 12 Mar 2025 10:47:24 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 7/8] xen/mm: Exclude flushtlb.h from mm.h for ARM Date: Wed, 12 Mar 2025 17:45:12 +0000 Message-Id: <20250312174513.4075066-9-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 A number of files pick up flushtlb.h transitively through mm.h, while the flushtlb.h hierachy themselves aren't even self-sufficient. Address all of these, and exclude flushtlb.h from mm.h Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/arm/include/asm/arm32/flushtlb.h | 2 ++ xen/arch/arm/include/asm/arm64/flushtlb.h | 2 ++ xen/arch/arm/include/asm/fixmap.h | 2 ++ xen/arch/arm/include/asm/pmap.h | 1 + xen/arch/arm/mmu/domain_page.c | 2 ++ xen/arch/arm/mmu/pt.c | 1 + xen/arch/arm/mmu/setup.c | 1 + xen/arch/arm/traps.c | 1 + xen/include/xen/mm.h | 2 +- 9 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/include/asm/arm32/flushtlb.h b/xen/arch/arm/include/asm/arm32/flushtlb.h index 61c25a318998..510eb649a5c6 100644 --- a/xen/arch/arm/include/asm/arm32/flushtlb.h +++ b/xen/arch/arm/include/asm/arm32/flushtlb.h @@ -1,6 +1,8 @@ #ifndef __ASM_ARM_ARM32_FLUSHTLB_H__ #define __ASM_ARM_ARM32_FLUSHTLB_H__ +#include + /* * Every invalidation operation use the following patterns: * diff --git a/xen/arch/arm/include/asm/arm64/flushtlb.h b/xen/arch/arm/include/asm/arm64/flushtlb.h index 45642201d147..b98c8d14a78f 100644 --- a/xen/arch/arm/include/asm/arm64/flushtlb.h +++ b/xen/arch/arm/include/asm/arm64/flushtlb.h @@ -1,6 +1,8 @@ #ifndef __ASM_ARM_ARM64_FLUSHTLB_H__ #define __ASM_ARM_ARM64_FLUSHTLB_H__ +#include + /* * Every invalidation operation use the following patterns: * diff --git a/xen/arch/arm/include/asm/fixmap.h b/xen/arch/arm/include/asm/fixmap.h index 0cb5d54d1c74..68d82d3d4ea2 100644 --- a/xen/arch/arm/include/asm/fixmap.h +++ b/xen/arch/arm/include/asm/fixmap.h @@ -22,6 +22,8 @@ #ifndef __ASSEMBLY__ +#include + /* * Direct access to xen_fixmap[] should only happen when {set, * clear}_fixmap() is unusable (e.g. where we would end up to diff --git a/xen/arch/arm/include/asm/pmap.h b/xen/arch/arm/include/asm/pmap.h index bca3381796f3..1162e8a6e4d2 100644 --- a/xen/arch/arm/include/asm/pmap.h +++ b/xen/arch/arm/include/asm/pmap.h @@ -4,6 +4,7 @@ #include #include +#include static inline void arch_pmap_map(unsigned int slot, mfn_t mfn) { diff --git a/xen/arch/arm/mmu/domain_page.c b/xen/arch/arm/mmu/domain_page.c index 3a43601623f0..850214925a3b 100644 --- a/xen/arch/arm/mmu/domain_page.c +++ b/xen/arch/arm/mmu/domain_page.c @@ -3,6 +3,8 @@ #include #include +#include + /* Override macros from asm/page.h to make them work with mfn_t */ #undef virt_to_mfn #define virt_to_mfn(va) _mfn(__virt_to_mfn(va)) diff --git a/xen/arch/arm/mmu/pt.c b/xen/arch/arm/mmu/pt.c index da28d669e796..16c73da853e6 100644 --- a/xen/arch/arm/mmu/pt.c +++ b/xen/arch/arm/mmu/pt.c @@ -13,6 +13,7 @@ #include #include +#include #ifdef NDEBUG static inline void diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c index f6119ccacf15..64a06e30e8fb 100644 --- a/xen/arch/arm/mmu/setup.c +++ b/xen/arch/arm/mmu/setup.c @@ -13,6 +13,7 @@ #include #include +#include #include /* Override macros from asm/page.h to make them work with mfn_t */ diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 445e7378dd79..52f267fb11f8 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 154e649db9e4..27e420e302d8 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -587,7 +587,7 @@ void destroy_ring_for_helper(void **_va, struct page_info *page); /* Return the upper bound of MFNs, including hotplug memory. */ unsigned long get_upper_mfn_bound(void); -#if defined(CONFIG_X86) || defined(CONFIG_ARM) +#if defined(CONFIG_X86) #include #endif From patchwork Wed Mar 12 17:45:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 14013724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6AFC3C28B2E for ; Wed, 12 Mar 2025 17:48:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.910638.1317379 (Exim 4.92) (envelope-from ) id 1tsQAy-0000Gg-JR; Wed, 12 Mar 2025 17:47:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 910638.1317379; Wed, 12 Mar 2025 17:47:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAy-0000Ej-5v; Wed, 12 Mar 2025 17:47:28 +0000 Received: by outflank-mailman (input) for mailman id 910638; Wed, 12 Mar 2025 17:47:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tsQAw-0006eC-Td for xen-devel@lists.xenproject.org; Wed, 12 Mar 2025 17:47:26 +0000 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [2a00:1450:4864:20::42d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0f664763-ff6a-11ef-9ab9-95dc52dad729; Wed, 12 Mar 2025 18:47:26 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso76003f8f.2 for ; Wed, 12 Mar 2025 10:47:26 -0700 (PDT) Received: from andrewcoop.eng.citrite.net (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d0a8d0b79sm27333805e9.36.2025.03.12.10.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 10:47:25 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0f664763-ff6a-11ef-9ab9-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1741801645; x=1742406445; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UqUw1lXDWsLoEK2uMTwV0wPaZ1fDYAVfaL5LVQPDWGk=; b=Udv5lQxIf/E6VNrzOGOD7LJB1xLlAp6dMGQeptykmubTUUB1M2MqaeV72foBw8kUp9 +T1LxbwMmgtfLWwieo/oI4N7aJ+iPla9t9H0cgfAcVmApc1Z4LViXO/sxvC8LtbUEnGK Jw4jcHFaKOPfAabUYRgCntY5SqTR1dXCA2UnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741801645; x=1742406445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UqUw1lXDWsLoEK2uMTwV0wPaZ1fDYAVfaL5LVQPDWGk=; b=jt6O1EfLPLbBmr7AYcH/Q/BXC3pjgulKHH3kYSat4uK744I8t/Yv6qHVbR+wCtK4Ex 4QOsX6qnGJiUqFrMIuxmCbWtlgCU2PvTlcZIyCWFuyH25S2fQBj0/HCz/ac1++GyFwRD BJ+J23CoKVBlKO6v5km7QiG3QE+XEeIeTrjw9/auhwr/X3u2CJ58RrUxxOQ4BhnhJkxg Q20wK8o5gZjxtojtntn1qN5NnX8TG7OULo82rY3tT6nflhC8g+QAp9KvnCadtYylV4Lx kHJpNuUJVto9QLMn9oexhPa0tAQ+YQfZdrjc68GAt9Qyar3BaMWhXaKaSdpNKEzTdK6U jWgw== X-Gm-Message-State: AOJu0YwFFqnrmAsi5+wzZbi7axxMVcRzRVW2ipDDgz4gSZXrcpvS9vQm uSIEpPVg7FzIYWzj33ZM1GeVfWFqK1UUKr+WN0hxqwDbvs/LE/OGthsk4QYDwYd+MvgLdKhYeor x X-Gm-Gg: ASbGnctG4PoMBtochY0cCdTHOX4A+H+tmx0tCwknZPH6QVr6tbyIKbJWE+6kZdbVNmO AC3GugXzBRgWJ60VPZZnIyun1dNz8oSEpdSUGBIN0yH5qArv8iUZxneeSC5a/KOzWR3TKpKwGf5 vgn7Y2QFMGoDH7x3DVlsyVViqyBYUent5cqvusn9YKyCc4CYkmQdBZyERoMKzygtpL3DHyvY5Ym 9oJNZSgx1EF5rDgvF9bf8zQlUoLmKeIbatKbaCmBm880CiqfqligaKsJPWVGVYF3wFoquXo8rtX o5Ihdbk9HLNqm30J5VF/Uc4IGAsQL3VidIxJuPFP4V/iOaTWfkTpt3AfLPmlZKt6WLnD6WvHbJ0 DB7mouCqbccwSREIE7gHnaFc7 X-Google-Smtp-Source: AGHT+IFb4jQETQduT8FxNkpfsC/um/PLF27EYcumOcxJs7Qku0Cxj5dl8mD9orNd/ncyb7UKyFKRIQ== X-Received: by 2002:a05:6000:4102:b0:391:42f2:5c7b with SMTP id ffacd0b85a97d-393e1e345f0mr4215659f8f.16.1741801645599; Wed, 12 Mar 2025 10:47:25 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Oleksii Kurochko , Shawn Anastasio Subject: [PATCH 8/8] xen/mm: Exclude flushtlb.h from mm.h for x86 Date: Wed, 12 Mar 2025 17:45:13 +0000 Message-Id: <20250312174513.4075066-10-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250312174513.4075066-1-andrew.cooper3@citrix.com> References: <20250312174513.4075066-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 alternative.c and livepatch.c pick up flushtlb.h transitively through mm.h. Fix these, and finally resolve the TODO in microcode/amd.c Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- xen/arch/x86/alternative.c | 1 + xen/arch/x86/cpu/microcode/amd.c | 2 +- xen/arch/x86/livepatch.c | 1 + xen/include/xen/mm.h | 4 ---- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c index 46b04c9cb83d..d97eda129c32 100644 --- a/xen/arch/x86/alternative.c +++ b/xen/arch/x86/alternative.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c index ee7de5282b2a..d84dc5b0ef1f 100644 --- a/xen/arch/x86/cpu/microcode/amd.c +++ b/xen/arch/x86/cpu/microcode/amd.c @@ -17,9 +17,9 @@ #include #include #include -#include /* TODO: Fix asm/tlbflush.h breakage */ #include +#include #include #include "private.h" diff --git a/xen/arch/x86/livepatch.c b/xen/arch/x86/livepatch.c index 5158e91f7e6e..5c1d16ecf5a8 100644 --- a/xen/arch/x86/livepatch.c +++ b/xen/arch/x86/livepatch.c @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 27e420e302d8..088f77eed5e5 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -587,10 +587,6 @@ void destroy_ring_for_helper(void **_va, struct page_info *page); /* Return the upper bound of MFNs, including hotplug memory. */ unsigned long get_upper_mfn_bound(void); -#if defined(CONFIG_X86) -#include -#endif - enum XENSHARE_flags { SHARE_rw, SHARE_ro,