[PATCH 0/2] KVM: x86: Cleanup kvm_get_dr() usage

Sean Christopherson posted 2 patches 1 year, 12 months ago
arch/x86/include/asm/kvm_host.h |  2 +-
arch/x86/kvm/emulate.c          | 17 ++++-------------
arch/x86/kvm/kvm_emulate.h      |  2 +-
arch/x86/kvm/smm.c              | 15 ++++-----------
arch/x86/kvm/svm/svm.c          |  7 ++-----
arch/x86/kvm/vmx/nested.c       |  2 +-
arch/x86/kvm/vmx/vmx.c          |  5 +----
arch/x86/kvm/x86.c              | 20 +++++++-------------
8 files changed, 21 insertions(+), 49 deletions(-)
[PATCH 0/2] KVM: x86: Cleanup kvm_get_dr() usage
Posted by Sean Christopherson 1 year, 12 months ago
Make kvm_get_dr() use an actual return instead of a void return with an
output, which led to a _lot_ of ugly code, and then open code all direct
reads to DR6 and DR7, as KVM has a goofy mix of some flows open coding
reads and some flows bouncing through kvm_get_dr().

Sean Christopherson (2):
  KVM: x86: Make kvm_get_dr() return a value, not use an out parameter
  KVM: x86: Open code all direct reads to guest DR6 and DR7

 arch/x86/include/asm/kvm_host.h |  2 +-
 arch/x86/kvm/emulate.c          | 17 ++++-------------
 arch/x86/kvm/kvm_emulate.h      |  2 +-
 arch/x86/kvm/smm.c              | 15 ++++-----------
 arch/x86/kvm/svm/svm.c          |  7 ++-----
 arch/x86/kvm/vmx/nested.c       |  2 +-
 arch/x86/kvm/vmx/vmx.c          |  5 +----
 arch/x86/kvm/x86.c              | 20 +++++++-------------
 8 files changed, 21 insertions(+), 49 deletions(-)


base-commit: 873eef46b33c86be414d60bd00390e64fc0f006f
-- 
2.43.0.687.g38aa6559b0-goog
Re: [PATCH 0/2] KVM: x86: Cleanup kvm_get_dr() usage
Posted by Sean Christopherson 1 year, 11 months ago
On Fri, 09 Feb 2024 14:07:50 -0800, Sean Christopherson wrote:
> Make kvm_get_dr() use an actual return instead of a void return with an
> output, which led to a _lot_ of ugly code, and then open code all direct
> reads to DR6 and DR7, as KVM has a goofy mix of some flows open coding
> reads and some flows bouncing through kvm_get_dr().
> 
> Sean Christopherson (2):
>   KVM: x86: Make kvm_get_dr() return a value, not use an out parameter
>   KVM: x86: Open code all direct reads to guest DR6 and DR7
> 
> [...]

Applied to kvm-x86 misc, thanks!

[1/2] KVM: x86: Make kvm_get_dr() return a value, not use an out parameter
      https://github.com/kvm-x86/linux/commit/fc5375dd8c06
[2/2] KVM: x86: Open code all direct reads to guest DR6 and DR7
      https://github.com/kvm-x86/linux/commit/2a5f091ce1c9

--
https://github.com/kvm-x86/linux/tree/next