]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Have ____kvm_emulate_hypercall() read the GPRs
authorBinbin Wu <binbin.wu@linux.intel.com>
Sat, 22 Feb 2025 01:42:17 +0000 (09:42 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Mar 2025 18:20:54 +0000 (14:20 -0400)
commit6162b37357d039614ee0e9ff53c000e4de081536
tree4d380cbd06861d7971f568b16e172a00f73697de
parent484612f1a7d7386cec8fc9a3fa9dd45dd39e8b6d
KVM: x86: Have ____kvm_emulate_hypercall() read the GPRs

Have ____kvm_emulate_hypercall() read the GPRs instead of passing them
in via the macro.

When emulating KVM hypercalls via TDVMCALL, TDX will marshall registers of
TDVMCALL ABI into KVM's x86 registers to match the definition of KVM
hypercall ABI _before_ ____kvm_emulate_hypercall() gets called.  Therefore,
____kvm_emulate_hypercall() can just read registers internally based on KVM
hypercall ABI, and those registers can be removed from the
__kvm_emulate_hypercall() macro.

Also, op_64_bit can be determined inside ____kvm_emulate_hypercall(),
remove it from the __kvm_emulate_hypercall() macro as well.

No functional change intended.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Message-ID: <20250222014225.897298-2-binbin.wu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h