[XEN][PATCH] x86: hvm: hypercall: use define instead of const in hvm_hypercall()

Grygorii Strashko posted 1 patch 1 day, 17 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250912094702.1654772-1-grygorii._5Fstrashko@epam.com
xen/arch/x86/hvm/hypercall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[XEN][PATCH] x86: hvm: hypercall: use define instead of const in hvm_hypercall()
Posted by Grygorii Strashko 1 day, 17 hours ago
From: Grygorii Strashko <grygorii_strashko@epam.com>

Use define X86_MODE_64BIT instead of constant in hvm_hypercall() for "mode"
conditional check to improve code readability.

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
---
 xen/arch/x86/hvm/hypercall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 6f8dfdff4ac6..b254b3e2f7d6 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -155,7 +155,7 @@ int hvm_hypercall(struct cpu_user_regs *regs)
 
     curr->hcall_preempted = false;
 
-    if ( mode == 8 )
+    if ( mode == X86_MODE_64BIT )
     {
         HVM_DBG_LOG(DBG_LEVEL_HCALL, "hcall%lu(%lx, %lx, %lx, %lx, %lx)",
                     eax, regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8);
-- 
2.34.1
Re: [XEN][PATCH] x86: hvm: hypercall: use define instead of const in hvm_hypercall()
Posted by Andrew Cooper 1 day, 17 hours ago
On 12/09/2025 10:47 am, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
>
> Use define X86_MODE_64BIT instead of constant in hvm_hypercall() for "mode"
> conditional check to improve code readability.
>
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

but this really needs to wait for 4.22 at this juncture.

~Andrew