[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240813051256.2246612-1-binbin.wu@linux.intel.com>
Date: Tue, 13 Aug 2024 13:12:54 +0800
From: Binbin Wu <binbin.wu@...ux.intel.com>
To: kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: pbonzini@...hat.com,
seanjc@...gle.com,
isaku.yamahata@...el.com,
rick.p.edgecombe@...el.com,
michael.roth@....com,
binbin.wu@...ux.intel.com
Subject: [PATCH v2 0/2] KVM: x86: Check hypercall's exit to userspace generically
Currently in kvm_emulate_hypercall, KVM_HC_MAP_GPA_RANGE is checked
specifically to decide whether a KVM hypercall needs to exit to userspace
or not. Do the check based on the hypercall_exit_enabled field of
struct kvm_arch.
Also use the API is_kvm_hc_exit_enabled() to replace the opencode.
---
v2:
- Check the return value of __kvm_emulate_hypercall() before checking
hypercall_exit_enabled to avoid an invalid KVM hypercall nr.
https://lore.kernel.org/kvm/184d90a8-14a0-494a-9112-365417245911@linux.intel.com/
- Add a warning if a hypercall nr out of the range of hypercall_exit_enabled
can express.
Binbin Wu (2):
KVM: x86: Check hypercall's exit to userspace generically
KVM: x86: Use is_kvm_hc_exit_enabled() instead of opencode
arch/x86/kvm/svm/sev.c | 4 ++--
arch/x86/kvm/x86.c | 6 +++---
arch/x86/kvm/x86.h | 7 +++++++
3 files changed, 12 insertions(+), 5 deletions(-)
base-commit: 332d2c1d713e232e163386c35a3ba0c1b90df83f
--
2.43.2
Powered by blists - more mailing lists