Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Juergen Gross via Virtualization
On 16.03.23 21:14, Peter Zijlstra wrote: On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: +DEFINE_PARAVIRT_ASM(pv_native_irq_disable, "cli", .text); +DEFINE_PARAVIRT_ASM(pv_native_irq_enable, "sti", .text); +DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .text); per

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Peter Zijlstra
On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: > +DEFINE_PARAVIRT_ASM(pv_native_irq_disable, "cli", .text); > +DEFINE_PARAVIRT_ASM(pv_native_irq_enable, "sti", .text); > +DEFINE_PARAVIRT_ASM(pv_native_read_cr2, "mov %cr2, %rax", .text); per these v, the above ^ should be in

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-16 Thread Borislav Petkov
On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: > All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler > functions, as those functions calls are hidden from gcc. In case the > kernel is compiled with "-fzero-call-used-regs" the compiler will > clobber caller-saved

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-12 Thread Borislav Petkov
On Fri, Mar 10, 2023 at 07:24:17AM +0100, Juergen Gross wrote: > The "normal" cases not using alternatives should rather be switched to > static calls. Or that. > Whether it is possible to mix a static call with alternatives needs to > be evaluated. I'd prefer not to mix them. Either should be

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-09 Thread Juergen Gross via Virtualization
On 09.03.23 14:39, Borislav Petkov wrote: On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler functions, as those functions calls are hidden from gcc. In case the kernel is compiled with "-fzero-call-used-regs"

Re: [PATCH] x86/paravirt: convert simple paravirt functions to asm

2023-03-09 Thread Borislav Petkov
On Wed, Mar 08, 2023 at 04:42:10PM +0100, Juergen Gross wrote: > All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler > functions, as those functions calls are hidden from gcc. In case the > kernel is compiled with "-fzero-call-used-regs" the compiler will > clobber caller-saved