Some trivial noinstr fixes
Borislav Petkov
maintainercover Some trivial noinstr fixes
From: Borislav Petkov <[email protected]>
Hi,
here are some trivial noinstr fixes which sprang up from recent clang allmodconfigs.
Thx.
Borislav Petkov (3):
task_stack, x86/cea: Force-inline stack helpers
x86/kvm/svm: Force-inline GHCB accessors
x86/mm: Force-inline __phys_addr_nodebug()
arch/x86/include/asm/cpu_entry_area.h | 2 +- arch/x86/include/asm/page_64.h | 2 +- arch/x86/include/asm/svm.h | 8 ++++---- include/linux/sched/task_stack.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
2.35.1
Borislav Petkov
maintainerPATCH 1/3 task_stack, x86/cea: Force-inline stack helpers
From: Borislav Petkov <[email protected]>
Force-inline two stack helpers to fix the following objtool warnings:
vmlinux.o: warning: objtool: in_task_stack()+0xc: call to task_stack_page() leaves .noinstr.text section vmlinux.o: warning: objtool: in_entry_stack()+0x10: call to cpu_entry_stack() leaves .noinstr.text section
--- arch/x86/include/asm/cpu_entry_area.h | 2 +- include/linux/sched/task_stack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/cpu_entry_area.h +1 -1
@@ -143,7 +143,7 @@ extern void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags);extern struct cpu_entry_area *get_cpu_entry_area (int cpu); -static inline struct entry_stack *cpu_entry_stack (int cpu) +static __always_inline struct entry_stack *cpu_entry_stack(int cpu) {return &get_cpu_entry_area (cpu)->entry_stack_page.stack; }
include/linux/sched/task_stack.h +1 -1
@@ -16,7 +16,7 @@* try_get_task_stack() instead. task_stack_page will return a pointer * that could get freed out from under you. */ -static inline void *task_stack_page (const struct task_struct *task) +static __always_inline void *task_stack_page(const struct task_struct *task) {return task->stack; }
Signature · 1 line
2.35.1
[tip: locking/core] task_stack, x86/cea: Force-inline stack helpers
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: e87f4152e542610d0b4c6c8548964a68a59d2040 Gitweb: https://git.kernel.org/tip/e87f4152e542610d0b4c6c8548964a68a59d2040 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 23 Mar 2022 20:02:41 +01:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Mon, 04 Apr 2022 10:13:07 +02:00
task_stack, x86/cea: Force-inline stack helpers
Force-inline two stack helpers to fix the following objtool warnings:
vmlinux.o: warning: objtool: in_task_stack()+0xc: call to task_stack_page() leaves .noinstr.text section vmlinux.o: warning: objtool: in_entry_stack()+0x10: call to cpu_entry_stack() leaves .noinstr.text section
--- arch/x86/include/asm/cpu_entry_area.h | 2 +- include/linux/sched/task_stack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/cpu_entry_area.h +1 -1
@@ -143,7 +143,7 @@ extern void cea_set_pte(void *cea_vaddr, phys_addr_t pa, pgprot_t flags);extern struct cpu_entry_area *get_cpu_entry_area (int cpu); -static inline struct entry_stack *cpu_entry_stack (int cpu) +static __always_inline struct entry_stack *cpu_entry_stack(int cpu) {return &get_cpu_entry_area (cpu)->entry_stack_page.stack; }
include/linux/sched/task_stack.h +1 -1
@@ -16,7 +16,7 @@* try_get_task_stack() instead. task_stack_page will return a pointer * that could get freed out from under you. */ -static inline void *task_stack_page (const struct task_struct *task) +static __always_inline void *task_stack_page(const struct task_struct *task) {return task->stack; }
Borislav Petkov
maintainerPATCH 2/3 x86/kvm/svm: Force-inline GHCB accessors
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
In order to fix:
vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x4c: call to ghcb_set_sw_exit_code() leaves .noinstr.text section
--- arch/x86/include/asm/svm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/svm.h +4 -4
@@ -436,23 +436,23 @@ struct vmcb { (offsetof(struct vmcb_save_area, field) / sizeof(u64))#define DEFINE_GHCB_ACCESSORS (field) \ - static inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ + static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ { \ return test_bit(GHCB_BITMAP_IDX(field), \ (unsigned long *)&ghcb->save.valid_bitmap); \ } \ \ - static inline u64 ghcb_get_##field(struct ghcb *ghcb) \ + static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \ { \ return ghcb->save.field; \ } \ \ - static inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ + static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ { \ return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \ } \ \ - static inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ + static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ { \ __set_bit(GHCB_BITMAP_IDX(field), \ (unsigned long *)&ghcb->save.valid_bitmap); \
Signature · 1 line
2.35.1
[tip: locking/core] x86/kvm/svm: Force-inline GHCB accessors
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: 6b91ec4ad290a808a894e7d3448eb82d0b8ef8d5 Gitweb: https://git.kernel.org/tip/6b91ec4ad290a808a894e7d3448eb82d0b8ef8d5 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 23 Mar 2022 21:52:44 +01:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Mon, 04 Apr 2022 10:13:20 +02:00
x86/kvm/svm: Force-inline GHCB accessors
In order to fix:
vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x4c: call to ghcb_set_sw_exit_code() leaves .noinstr.text section
--- arch/x86/include/asm/svm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/svm.h +4 -4
@@ -444,23 +444,23 @@ struct vmcb { (offsetof(struct vmcb_save_area, field) / sizeof(u64))#define DEFINE_GHCB_ACCESSORS (field) \ - static inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ + static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ { \ return test_bit(GHCB_BITMAP_IDX(field), \ (unsigned long *)&ghcb->save.valid_bitmap); \ } \ \ - static inline u64 ghcb_get_##field(struct ghcb *ghcb) \ + static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \ { \ return ghcb->save.field; \ } \ \ - static inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ + static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ { \ return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \ } \ \ - static inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ + static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ { \ __set_bit(GHCB_BITMAP_IDX(field), \ (unsigned long *)&ghcb->save.valid_bitmap); \
Borislav Petkov
maintainerPATCH 3/3 x86/mm: Force-inline __phys_addr_nodebug()
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
Fix:
vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x8b: call to __phys_addr_nodebug() leaves .noinstr.text section
--- arch/x86/include/asm/page_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/page_64.h +1 -1
@@ -16,7 +16,7 @@ extern unsigned long page_offset_base;extern unsigned long vmalloc_base;extern unsigned long vmemmap_base; -static inline unsigned long __phys_addr_nodebug (unsigned long x) +static __always_inline unsigned long __phys_addr_nodebug (unsigned long x) {unsigned long y = x - __START_KERNEL_map;
Signature · 1 line
2.35.1
[tip: locking/core] x86/mm: Force-inline __phys_addr_nodebug()
The following commit has been merged into the locking/core branch of tip:
The following commit has been merged into the locking/core branch of tip:
Commit-ID: ace1a98519270c586c0d4179419292df67441cd1 Gitweb: https://git.kernel.org/tip/ace1a98519270c586c0d4179419292df67441cd1 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 23 Mar 2022 23:24:12 +01:00 Committer: Borislav Petkov <[email protected]> CommitterDate: Mon, 04 Apr 2022 10:13:25 +02:00
x86/mm: Force-inline __phys_addr_nodebug()
Fix:
vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x8b: call to __phys_addr_nodebug() leaves .noinstr.text section
--- arch/x86/include/asm/page_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/page_64.h +1 -1
@@ -16,7 +16,7 @@ extern unsigned long page_offset_base;extern unsigned long vmalloc_base;extern unsigned long vmemmap_base; -static inline unsigned long __phys_addr_nodebug (unsigned long x) +static __always_inline unsigned long __phys_addr_nodebug (unsigned long x) {unsigned long y = x - __START_KERNEL_map;
Quoted 4 lines · Borislav Petkov
Borislav Petkov (3):
task_stack, x86/cea: Force-inline stack helpers
x86/kvm/svm: Force-inline GHCB accessors
x86/mm: Force-inline__phys_addr_nodebug()