Skip to content

Commit 2823e83

Browse files
Peter ZijlstraKAGA-KOKO
authored andcommitted
x86/entry: __always_inline CR2 for noinstr
vmlinux.o: warning: objtool: exc_page_fault()+0x9: call to read_cr2() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_page_fault()+0x24: call to prefetchw() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_page_fault()+0x21: call to kvm_handle_async_pf.isra.0() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_nmi()+0x1cc: call to write_cr2() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 6eebad1 commit 2823e83

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

arch/x86/include/asm/kvm_para.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static inline void kvm_disable_steal_time(void)
141141
return;
142142
}
143143

144-
static inline bool kvm_handle_async_pf(struct pt_regs *regs, u32 token)
144+
static __always_inline bool kvm_handle_async_pf(struct pt_regs *regs, u32 token)
145145
{
146146
return false;
147147
}

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static inline void prefetch(const void *x)
823823
* Useful for spinlocks to avoid one state transition in the
824824
* cache coherency protocol:
825825
*/
826-
static inline void prefetchw(const void *x)
826+
static __always_inline void prefetchw(const void *x)
827827
{
828828
alternative_input(BASE_PREFETCH, "prefetchw %P1",
829829
X86_FEATURE_3DNOWPREFETCH,

arch/x86/include/asm/special_insns.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ static inline unsigned long native_read_cr0(void)
2828
return val;
2929
}
3030

31-
static inline unsigned long native_read_cr2(void)
31+
static __always_inline unsigned long native_read_cr2(void)
3232
{
3333
unsigned long val;
3434
asm volatile("mov %%cr2,%0\n\t" : "=r" (val), "=m" (__force_order));
3535
return val;
3636
}
3737

38-
static inline void native_write_cr2(unsigned long val)
38+
static __always_inline void native_write_cr2(unsigned long val)
3939
{
4040
asm volatile("mov %0,%%cr2": : "r" (val), "m" (__force_order));
4141
}
@@ -160,12 +160,12 @@ static inline void write_cr0(unsigned long x)
160160
native_write_cr0(x);
161161
}
162162

163-
static inline unsigned long read_cr2(void)
163+
static __always_inline unsigned long read_cr2(void)
164164
{
165165
return native_read_cr2();
166166
}
167167

168-
static inline void write_cr2(unsigned long x)
168+
static __always_inline void write_cr2(unsigned long x)
169169
{
170170
native_write_cr2(x);
171171
}

0 commit comments

Comments
 (0)