Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-21 Thread Paolo Bonzini
On 9/21/23 14:11, Nikolay Borisov wrote: +SYM_FUNC_START(asm_fred_entry_from_kvm) +    push %rbp +    mov %rsp, %rbp use FRAME_BEGIN/FRAME_END macros to ommit this code if CONFIG_FRAME_POINTER is disabled. No, the previous stack pointer is used below, so the code might as well use %rbp

Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-21 Thread Nikolay Borisov
On 14.09.23 г. 7:48 ч., Xin Li wrote: In IRQ/NMI induced VM exits, KVM VMX needs to execute the respective handlers, which requires the software to create a FRED stack frame, and use it to invoke the handlers. Add fred_irq_entry_from_kvm() for this job. Export fred_entry_from_kvm() because

RE: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-20 Thread Li, Xin3
> > + /* > > +* Don't check the FRED stack level, the call stack leading to this > > +* helper is effectively constant and shallow (relatively speaking). > > It's more that we don't need to protect from reentrancy. The external > interrupt uses stack level 0 so no adjustment would be

Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-20 Thread Paolo Bonzini
On 9/14/23 06:48, Xin Li wrote: + /* +* Don't check the FRED stack level, the call stack leading to this +* helper is effectively constant and shallow (relatively speaking). It's more that we don't need to protect from reentrancy. The external interrupt uses stack level

[PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-13 Thread Xin Li
In IRQ/NMI induced VM exits, KVM VMX needs to execute the respective handlers, which requires the software to create a FRED stack frame, and use it to invoke the handlers. Add fred_irq_entry_from_kvm() for this job. Export fred_entry_from_kvm() because VMX can be compiled as a module.