Skip to content

Commit 6b91ec4

Browse files
committed
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 Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e87f415 commit 6b91ec4

File tree

1 file changed

+4
-4
lines changed
  • arch/x86/include/asm

1 file changed

+4
-4
lines changed

arch/x86/include/asm/svm.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,23 +444,23 @@ struct vmcb {
444444
(offsetof(struct vmcb_save_area, field) / sizeof(u64))
445445

446446
#define DEFINE_GHCB_ACCESSORS(field) \
447-
static inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \
447+
static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \
448448
{ \
449449
return test_bit(GHCB_BITMAP_IDX(field), \
450450
(unsigned long *)&ghcb->save.valid_bitmap); \
451451
} \
452452
\
453-
static inline u64 ghcb_get_##field(struct ghcb *ghcb) \
453+
static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \
454454
{ \
455455
return ghcb->save.field; \
456456
} \
457457
\
458-
static inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \
458+
static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \
459459
{ \
460460
return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \
461461
} \
462462
\
463-
static inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \
463+
static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \
464464
{ \
465465
__set_bit(GHCB_BITMAP_IDX(field), \
466466
(unsigned long *)&ghcb->save.valid_bitmap); \

0 commit comments

Comments
 (0)