[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][PATCH v2 2/4] x86: hvm: compat: introduce is_hcall_compat() helper
- To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jason Andryuk <jason.andryuk@xxxxxxx>
- Date: Tue, 2 Dec 2025 13:41:31 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PGdfIf//6+hO4yhMhimeGAXBM65bie/zdIJ3sjiYyZk=; b=rWrQkHa73meROdafXQDfGeM1RUskaaQqUrTDvJogc9NiSpzKXKO7dU2RXPoxL/AGJuXchHavfPREMkVyxB9tus4mYf7z354hJK4RTNns0UcHEB5BSx+qVfQlM9Taey4ECGdbFF0kZ9ef6/kCnC9lq7t9rzD7e5YdWV5TbvZjSQLBUvUKv4yLNNRxkgtBqjPMCDHuO1ySeJ5XyHpAOvptoW87kF638Rj3S8alHbsyQBuShz0/1cfhSKbkohLIe8P5h3R39BMghuey1Hc6KCG9BWzEOwLwvyEEcWLWebNejpoC1hWUHz57awLeh1Uj9cwSnj1z7SVGmOnhbvNJwukTow==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iqIPMoiv0Tnv/h5ooOBJspOpYmFghCW47ZHj0fCwfzGJb9EWsMPXok+BqxNvPnqRW24Bl4NC2eVZ3jQVHBoNaHQhOPAJQ7DHPrkVbnJE6168jb7tT50VAdVGEfQ6jRjpbrp5g8v1MMXMEpFfSk5HiAkKvUtjTZ58SxEaj26zCELSov+J/JKvhpCvHelkWwksrj2GpxV6bG+B2bPkoaAM2hqrEsXyoNJliSJujfv0gNlV6rSAOAmUexnhTh3JGZX/c55yjYHA3sgaiyHEFbyd9M2yJdMbeJfVSTzDAp2PCfsaIsURNbEgxqCQAdcsMGfYyo7IHgFvwIQIVj2ZrEb/Rg==
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
- Delivery-date: Tue, 02 Dec 2025 18:41:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2025-11-19 14:30, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Introduce is_hcall_compat() helper and use it instead of direct access to
struct vcpu->hcall_compat field in preparation for making HVM COMPAT code
optional. The vcpu->hcall_compat field is under CONFIG_COMPAT ifdefs
already.
Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 02bdc256ce37..ed6fdeeda9f9 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -311,6 +311,15 @@ struct vcpu
#endif
};
+static inline bool is_hcall_compat(void)
+{
+#ifdef CONFIG_COMPAT
+ return current->hcall_compat;
+#else
+ return false;
+#endif /* CONFIG_COMPAT */
+}
+
is_hcall_compat() matches the hcall_compat field, so I am okay with this.
Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
However, is_compat_hcall() might be a slightly better name for the
helper. For me at least, I think of these as "compat hypercalls", so
that ordering reads a little more naturally for me. It's not a big
deal, but I figured I'd mention it in case others have an opinion.
Thanks,
Jason
|