[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aIPhfNxjTL4LiG6Z@google.com>
Date: Fri, 25 Jul 2025 12:56:44 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Xin Li <xin@...or.com>
Cc: Peter Zijlstra <peterz@...radead.org>, x86@...nel.org, kys@...rosoft.com,
haiyangz@...rosoft.com, wei.liu@...nel.org, decui@...rosoft.com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, pbonzini@...hat.com,
ardb@...nel.org, kees@...nel.org, Arnd Bergmann <arnd@...db.de>,
gregkh@...uxfoundation.org, jpoimboe@...nel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org, linux-efi@...r.kernel.org,
samitolvanen@...gle.com, ojeda@...nel.org
Subject: Re: [PATCH v3 16/16] objtool: Validate kCFI calls
On Fri, Jul 25, 2025, Xin Li wrote:
> On 7/24/2025 1:37 PM, Sean Christopherson wrote:
> > On Mon, Jul 14, 2025, Peter Zijlstra wrote:
> > > --- a/arch/x86/kvm/vmx/vmenter.S
> > > +++ b/arch/x86/kvm/vmx/vmenter.S
> > > @@ -361,6 +361,10 @@ SYM_FUNC_END(vmread_error_trampoline)
> > > .section .text, "ax"
> > > +#ifndef CONFIG_X86_FRED
> > > +
> > > SYM_FUNC_START(vmx_do_interrupt_irqoff)
> > > VMX_DO_EVENT_IRQOFF CALL_NOSPEC _ASM_ARG1
> > > SYM_FUNC_END(vmx_do_interrupt_irqoff)
> > > +
> > > +#endif
> >
> > This can go in the previous patch, "x86/fred: KVM: VMX: Always use FRED for IRQs
> > when CONFIG_X86_FRED=y".
> >
>
> I'm going to test patch 13~15, plus this change in patch 16.
>
> BTW, there is a declaration for vmx_do_interrupt_irqoff() in
> arch/x86/kvm/vmx/vmx.c, so we'd better also do:
>
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -6945,7 +6945,9 @@ void vmx_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64
> *eoi_exit_bitmap)
> vmcs_write64(EOI_EXIT_BITMAP3, eoi_exit_bitmap[3]);
> }
>
> +#ifndef CONFIG_X86_FRED
> void vmx_do_interrupt_irqoff(unsigned long entry);
> +#endif
No, we want to keep the declaration. Unconditionally decaring the symbol allows
KVM to use IS_ENABLED():
if (IS_ENABLED(CONFIG_X86_FRED))
fred_entry_from_kvm(EVENT_TYPE_EXTINT, vector);
Hiding the declaration would require that to be a "proper" #ifdef, which would
be a net negative for readability. The extra declaration won't hurt anything for
CONFIG_X86_FRED=n, as "bad" usage will still fail at link time.
> void vmx_do_nmi_irqoff(void);
>
> static void handle_nm_fault_irqoff(struct kvm_vcpu *vcpu)
Powered by blists - more mailing lists