lkml.org 
[lkml]   [2022]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH 5/6] KVM: x86/VMX: add kvm_vmx_reinject_nmi_irq() for NMI/IRQ reinjection
On Thu, Nov 24, 2022, Peter Zijlstra wrote:
> On Wed, Nov 23, 2022 at 08:42:51PM +0000, Sean Christopherson wrote:
> > arch/x86/kvm/kvm_cache_regs.h | 16 +++++------
> > arch/x86/kvm/vmx/vmenter.S | 4 +--
> > arch/x86/kvm/vmx/vmx.c | 51 ++++++++++++++++++-----------------
> > arch/x86/kvm/vmx/vmx.h | 2 +-
> > arch/x86/kvm/x86.h | 6 ++---
> > 5 files changed, 41 insertions(+), 38 deletions(-)
> >
> > diff --git a/arch/x86/kvm/kvm_cache_regs.h b/arch/x86/kvm/kvm_cache_regs.h
> > index c09174f73a34..af9bd0374915 100644
> > --- a/arch/x86/kvm/kvm_cache_regs.h
> > +++ b/arch/x86/kvm/kvm_cache_regs.h
> > @@ -50,26 +50,26 @@ BUILD_KVM_GPR_ACCESSORS(r15, R15)
> > * 1 0 register in vcpu->arch
> > * 1 1 register in vcpu->arch, needs to be stored back
> > */
> > -static inline bool kvm_register_is_available(struct kvm_vcpu *vcpu,
> > - enum kvm_reg reg)
> > +static __always_inline bool kvm_register_is_available(struct kvm_vcpu *vcpu,
> > + enum kvm_reg reg)
> > {
> > return test_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
> > }
> >
> > -static inline bool kvm_register_is_dirty(struct kvm_vcpu *vcpu,
> > - enum kvm_reg reg)
> > +static __always_inline bool kvm_register_is_dirty(struct kvm_vcpu *vcpu,
> > + enum kvm_reg reg)
> > {
> > return test_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
> > }
> >
> > -static inline void kvm_register_mark_available(struct kvm_vcpu *vcpu,
> > - enum kvm_reg reg)
> > +static __always_inline void kvm_register_mark_available(struct kvm_vcpu *vcpu,
> > + enum kvm_reg reg)
> > {
> > __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
> > }
> >
> > -static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
> > - enum kvm_reg reg)
> > +static __always_inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
> > + enum kvm_reg reg)
> > {
> > __set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
> > __set_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
>
> You'll have to consider include/asm-generic/bitops/instrumented-non-atomic.h
> and friend, and the above should probably switch to using:
>
> arch_test_bit(), arch___set_bit() resp.
>
> to avoid the explicit instrumentation.

Well that's just mean. I'll figure out a solution, thanks for the heads up!

\
 
 \ /
  Last update: 2022-11-28 20:07    [W:0.083 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site