[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240419112952.15598-1-wei.w.wang@intel.com>
Date: Fri, 19 Apr 2024 19:29:47 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: seanjc@...gle.com,
pbonzini@...hat.com
Cc: kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Wei Wang <wei.w.wang@...el.com>
Subject: [PATCH v2 0/5] KVM/x86: Enhancements to static calls
This patchset addresses two primary concerns with the current
implementation related to static calls in kvm/x86:
1) It is implemented based on the assumption that static_call() cannot
handle undefined (i.e., NULL) hooks. As Sean pointed out, this is no
longer accurate as static_call() has treated a "NULL" pointer as a NOP
on x86.
2) Its usage is verbose and can lead to code alignment challenges, and the
addition of kvm_x86_ prefix to hooks at the static_call() sites hinders
code readability and navigation.
This patchset aims to rectify the above issues. Patch 4 and 5 are marked
as RFC, as they were not accepted yet at the idea level in the previous
discussions, so present the code changes here and give it one more try,
in case I didn't explain that well. Despite being marked as RFC, they've
gone through my tests (guest launch, a few vPMU tests, live migration
tests) without an issue.
v1->v2 changes:
- Replace static_call_cond() with static_call()
- Rename KVM_X86_SC to KVM_X86_CALL, and updated all the call sites
- Add KVM_PMU_CALL()
- Add patch 4 and 5 to review the idea of removing KVM_X86_OP_OPTIONAL
Wei Wang (5):
KVM: x86: Replace static_call_cond() with static_call()
KVM: x86: Introduce KVM_X86_CALL() to simplify static calls of
kvm_x86_ops
KVM: x86/pmu: Add KVM_PMU_CALL() to simplify static calls of
kvm_pmu_ops
KVM: x86: Remove KVM_X86_OP_OPTIONAL
KVM: x86/pmu: Remove KVM_X86_PMU_OP_OPTIONAL
arch/x86/include/asm/kvm-x86-ops.h | 100 ++++----
arch/x86/include/asm/kvm-x86-pmu-ops.h | 20 +-
arch/x86/include/asm/kvm_host.h | 14 +-
arch/x86/kvm/cpuid.c | 2 +-
arch/x86/kvm/hyperv.c | 6 +-
arch/x86/kvm/irq.c | 2 +-
arch/x86/kvm/kvm_cache_regs.h | 10 +-
arch/x86/kvm/lapic.c | 42 +--
arch/x86/kvm/lapic.h | 2 +-
arch/x86/kvm/mmu.h | 6 +-
arch/x86/kvm/mmu/mmu.c | 4 +-
arch/x86/kvm/mmu/spte.c | 4 +-
arch/x86/kvm/pmu.c | 31 +--
arch/x86/kvm/smm.c | 44 ++--
arch/x86/kvm/trace.h | 12 +-
arch/x86/kvm/x86.c | 342 ++++++++++++-------------
arch/x86/kvm/x86.h | 2 +-
arch/x86/kvm/xen.c | 4 +-
18 files changed, 317 insertions(+), 330 deletions(-)
base-commit: 49ff3b4aec51e3abfc9369997cc603319b02af9a
--
2.27.0
Powered by blists - more mailing lists