[PATCH 2/2] KVM: VMX: Use ASM_INPUT_RM in __vmcs_writel
From: Uros Bizjak
Date: Wed Feb 11 2026 - 05:29:51 EST
Use the ASM_INPUT_RM macro for VMCS write operation in vmx_ops.h to
work around clang problems with "rm" asm constraint. clang seems to
always chose the memory input, while it is almost always the worst
choice.
Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
Cc: Sean Christopherson <seanjc@xxxxxxxxxx>
Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
---
arch/x86/kvm/vmx/vmx_ops.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx_ops.h b/arch/x86/kvm/vmx/vmx_ops.h
index 1000d37f5b0c..81784befaaf4 100644
--- a/arch/x86/kvm/vmx/vmx_ops.h
+++ b/arch/x86/kvm/vmx/vmx_ops.h
@@ -221,7 +221,7 @@ fault: \
static __always_inline void __vmcs_writel(unsigned long field, unsigned long value)
{
- vmx_asm2(vmwrite, "r"(field), "rm"(value), field, value);
+ vmx_asm2(vmwrite, "r" (field), ASM_INPUT_RM (value), field, value);
}
static __always_inline void vmcs_write16(unsigned long field, u16 value)
--
2.53.0