Thread (52 messages) 52 messages, 7 authors, 2025-06-06

Re: [PATCH v2 00/13] objtool: Detect and warn about indirect calls in __nocfi functions

From: Sean Christopherson <seanjc@google.com>
Date: 2025-05-02 19:53:38
Also in: kvm, linux-efi, lkml

On Fri, May 02, 2025, Peter Zijlstra wrote:
On Thu, May 01, 2025 at 11:30:18AM -0700, Sean Christopherson wrote:
quoted
Uh, aren't you making this way more complex than it needs to be? 
Possibly :-)
quoted
IIUC, KVM never
uses the FRED hardware entry points, i.e. the FRED entry tables don't need to be
in place because they'll never be used.  The only bits of code KVM needs is the
__fred_entry_from_kvm() glue.
But __fred_entry_from_kvm() calls into fred_extint(), which then
directly uses the fred sysvec_table[] for dispatch. How would we not
have to set up that table?
I missed that the first time around.  From my self-reply:

 : Hrm, and now I see that fred_extint() relies on fred_install_sysvec(), which makes
 : me quite curious as to why IRQs didn't go sideways.  Oh, because sysvec_table[]
 : is statically defined at compile time except for PV crud.
 : 
 : So yeah, I think my the patches are correct, they just the need a small bit of
 : prep work to support dynamic setup of sysvec_table.
quoted
Lightly tested, but this combo works for IRQs and NMIs on non-FRED hardware.
So the FRED NMI code is significantly different from the IDT NMI code
and I really didn't want to go mixing those.

If we get a nested NMI I don't think it'll behave well.
Ah, because FRED hardwware doesn't have the crazy NMI unblocking behavior, and
the FRED NMI entry code relies on that.

But I don't see why we need to care about NMIs from KVM, while they do bounce
through assembly to create a stack frame, the actual CALL is direct to
asm_exc_nmi_kvm_vmx().  If it's just the unwind hint that's needed, that

The attached patches handle the IRQ case and are passing my testing.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help