]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: VMX: Use ASM_INPUT_RM in __vmcs_writel
authorUros Bizjak <ubizjak@gmail.com>
Wed, 11 Feb 2026 10:28:50 +0000 (11:28 +0100)
committerSean Christopherson <seanjc@google.com>
Mon, 2 Mar 2026 22:32:57 +0000 (14:32 -0800)
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@gmail.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patch.msgid.link/20260211102928.100944-2-ubizjak@gmail.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx_ops.h

index 1000d37f5b0c228e2359ee5fc6647559af48a3e2..81784befaaf4989d31dcf8fe0d61018c070a9841 100644 (file)
@@ -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)