[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/nestedhvm: Inline nestedhvm_vcpu_in_guestmode()
- To: Teddy Astie <teddy.astie@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
- Date: Wed, 21 Oct 2026 13:19:04 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- 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=7ngwEiwfSDSxCA3ils7CWgGstjPZkhvt4WCoAa8Lc8g=; b=TWIAejdC6JALQ9NbaklKsv7Os0sFkdNBgYrsFMqw/LKO8pcH3qD8Gp0Uo1f+JdKjYWA555Q6cLyBwSigJDH8QLOu2UgqL5DFlEzLdn23sLLQWR0qqTjzbv1FlhoTPV1RnrupEHjZJTLGwDD8lWT3ZqTtSS/veqv4X9pV2Yh8/Qu9JnFm3LxYR+qzP4wLoPRgY0uk1zkdL+uzpCDv2x2ZHmT1fqAdmEZNGy6xVlxPXVtaPv0hbzBE0MVO3HPRe8zDm+VDjPu/UdSHwgHr0+ZBw3UQkNuee0ObLTaiwelNly5+PCs1xv+nH7MdckoBF0PZ7ZW9vXIxfeKaOIr7oY+5dA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VSAyfd2ZRxwoR/RdzlbdQh3qFS6yt7alRaULT4f/pmbn7B3IlFN3NzwKV3pxqHRhFwn+kmQXAQQJspM+yICeN2q+7mS/0fPAbP/QXDvG8qfyFqaQJGSesm/2S7/ldIMfeDp+KGcuOLkTBzkRnoT7BBGhlFeh7k9PixGGppCw+mO8fHeFDk+BjUA+XIFORqdDtYvODBJ/7Z4n1YM4a5T6NpIlWu20QBSGkbzHcO5LwviGPfuNlyhQ0BoghFv7+ieJpor2w/QblkSjThOkE4bQ9Sf5HQXV5jCTstBh0d8yJtkjo0LqNIT6SNltgpYu2ua8Bmhie5LQrurf2IfpC3Lt0A==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>
- Delivery-date: Wed, 21 Oct 2026 12:19:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10/20/26 5:53 PM, Teddy Astie wrote:
This function just returns vcpu_nestedhvm(v).nv_guestmode and would
be better inlined to improve codegen.
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
xen/arch/x86/hvm/nestedhvm.c | 7 -------
xen/arch/x86/include/asm/hvm/nestedhvm.h | 6 +++++-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c
index bddd77d810..3205277e81 100644
--- a/xen/arch/x86/hvm/nestedhvm.c
+++ b/xen/arch/x86/hvm/nestedhvm.c
@@ -15,13 +15,6 @@
static unsigned long *shadow_io_bitmap[3];
-/* Nested VCPU */
(minor) I think this comment logically applies to the following functions as
well, but since it doesn't add any value I think it's fine to remove it.
-bool
-nestedhvm_vcpu_in_guestmode(struct vcpu *v)
-{
- return vcpu_nestedhvm(v).nv_guestmode;
-}
-
void
nestedhvm_vcpu_reset(struct vcpu *v)
{
diff --git a/xen/arch/x86/include/asm/hvm/nestedhvm.h
b/xen/arch/x86/include/asm/hvm/nestedhvm.h
index ea2c1bc328..9e158bc5ce 100644
--- a/xen/arch/x86/include/asm/hvm/nestedhvm.h
+++ b/xen/arch/x86/include/asm/hvm/nestedhvm.h
@@ -28,11 +28,15 @@ static inline bool nestedhvm_enabled(const struct domain *d)
return IS_ENABLED(CONFIG_HVM) && (d->options &
XEN_DOMCTL_CDF_nested_virt);
}
+static inline bool nestedhvm_vcpu_in_guestmode(struct vcpu *v)
+{
+ return vcpu_nestedhvm(v).nv_guestmode;
+}
+
/* Nested VCPU */
(minor) I think the function should logically go after this comment but again,
it doesn't add any value so should probably just be removed.
Otherwise this looks good to me.
Ross
int nestedhvm_vcpu_initialise(struct vcpu *v);
void nestedhvm_vcpu_destroy(struct vcpu *v);
void nestedhvm_vcpu_reset(struct vcpu *v);
-bool nestedhvm_vcpu_in_guestmode(struct vcpu *v);
#define nestedhvm_vcpu_enter_guestmode(v) \
vcpu_nestedhvm(v).nv_guestmode = 1
#define nestedhvm_vcpu_exit_guestmode(v) \
|