Message ID | 20180723122413.797031305@linuxfoundation.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | None | expand |
On Mon, 2018-07-23 at 14:41 +0200, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Nick Desaulniers <ndesaulniers@google.com> > > commit d0a8d9378d16eb3c69bd8e6d23779fbdbee3a8c7 upstream. > > native_save_fl() is marked static inline, but by using it as > a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined. > > paravirt's use of native_save_fl() also requires that no GPRs other than > %rax are clobbered. [...] Shouldn't native_restore_fl() be changed similarly? You added an out- of-line definition, but it doesn't seem like it will actually be used. Ben.
On Fri, Aug 24, 2018 at 4:08 PM Ben Hutchings <ben.hutchings@codethink.co.uk> wrote: > > On Mon, 2018-07-23 at 14:41 +0200, Greg Kroah-Hartman wrote: > > 4.4-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Nick Desaulniers <ndesaulniers@google.com> > > > > commit d0a8d9378d16eb3c69bd8e6d23779fbdbee3a8c7 upstream. > > > > native_save_fl() is marked static inline, but by using it as > > a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined. > > > > paravirt's use of native_save_fl() also requires that no GPRs other than > > %rax are clobbered. > [...] > > Shouldn't native_restore_fl() be changed similarly? You added an out- > of-line definition, but it doesn't seem like it will actually be used. > Good catch, will send a patch with your reported by. Thank you for the report.
--- a/arch/x86/include/asm/irqflags.h +++ b/arch/x86/include/asm/irqflags.h @@ -8,7 +8,7 @@ * Interrupt control: */ -static inline unsigned long native_save_fl(void) +extern inline unsigned long native_save_fl(void) { unsigned long flags; --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -41,6 +41,7 @@ obj-y += alternative.o i8253.o pci-nom obj-y += tsc.o tsc_msr.o io_delay.o rtc.o obj-y += pci-iommu_table.o obj-y += resource.o +obj-y += irqflags.o obj-y += process.o obj-y += fpu/ --- /dev/null +++ b/arch/x86/kernel/irqflags.S @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <asm/asm.h> +#include <asm-generic/export.h> +#include <linux/linkage.h> + +/* + * unsigned long native_save_fl(void) + */ +ENTRY(native_save_fl) + pushf + pop %_ASM_AX + ret +ENDPROC(native_save_fl) +EXPORT_SYMBOL(native_save_fl) + +/* + * void native_restore_fl(unsigned long flags) + * %eax/%rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_ARG1 + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)