KVM: x86: Drop "caching" of always-available GPRs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: x86: Omit caching logic for always-available GPRsarch/ arch/ arch/ +3 more | +105 | 0 replies | |
| 2/3 | KVM: x86: Prevent use of kvm_register_{read,write}() with known GPRsarch/ arch/ arch/ +1 more | +46 | 2 replies | |
| 3/3 | KVM: VMX: Use accessors for GPRs outside of dedicated caching logicarch/ arch/ | +8 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] KVM: x86: Drop "caching" of always-available GPRs
KVM's GPR caching logic is unconditionally emitted for all GPR accesses (that go through the accessors), even when the register being accessed is fixed and always available. This bloats KVM due to the instructions needed to test and set the available/dirty bitmaps, and to conditionally invoke the .cache_reg() callback. The latter is especially painful when compiling with retpolines.
Eliminate the unnecessary overhead by:
- Adding dedicated accessors for every GPR
- Omitting the caching logic for GPRs that are always available
- Preventing use of the unoptimized versions for fixed accesses
The last patch is an opportunistic clean up of VMX, which has gradually acquired a bad habit of sprinkling in direct access to GPRs.
Sean Christopherson (3):
KVM: x86: Omit caching logic for always-available GPRs
KVM: x86: Prevent use of kvm_register_{read,write}() with known GPRs
KVM: VMX: Use accessors for GPRs outside of dedicated caching logic
arch/x86/kvm/cpuid.c | 12 ++--- arch/x86/kvm/hyperv.c | 24 ++++----- arch/x86/kvm/kvm_cache_regs.h | 73 +++++++++++++++++++++++---- arch/x86/kvm/svm.c | 34 ++++++------- arch/x86/kvm/vmx/nested.c | 18 +++---- arch/x86/kvm/vmx/vmx.c | 14 +++--- arch/x86/kvm/x86.c | 93 +++++++++++++++++------------------ 7 files changed, 159 insertions(+), 109 deletions(-)
Signature · 1 line
2.21.0