mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] context_tracking: Tag context_tracking_enabled_this_cpu() __always_inline
@ 2024-06-17 15:51 Sean Christopherson
  2024-06-18 18:08 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2024-06-17 15:51 UTC (permalink / raw)
  To: Frederic Weisbecker, Paul E. McKenney; +Cc: linux-kernel, Sean Christopherson

Force context_tracking_enabled_this_cpu() to be inlined so that invoking
it from guest_context_enter_irqoff(), which KVM uses in non-instrumentable
code, doesn't unexpectedly leave a noinstr section.

  vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0x1c7: call to
    context_tracking_enabled_this_cpu() leaves .noinstr.text section
  vmlinux.o: warning: objtool: svm_vcpu_enter_exit+0x83: call to
    context_tracking_enabled_this_cpu() leaves .noinstr.text section

Note, the CONFIG_CONTEXT_TRACKING_USER=n stub is already __always_inline.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 include/linux/context_tracking_state.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index bbff5f7f8803..1a23d8c7d8c3 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -113,7 +113,7 @@ static __always_inline bool context_tracking_enabled_cpu(int cpu)
 	return context_tracking_enabled() && per_cpu(context_tracking.active, cpu);
 }
 
-static inline bool context_tracking_enabled_this_cpu(void)
+static __always_inline bool context_tracking_enabled_this_cpu(void)
 {
 	return context_tracking_enabled() && __this_cpu_read(context_tracking.active);
 }

base-commit: e4e9e1067138e5620cf0500c3e5f6ebfb9d322c8
-- 
2.45.2.627.g7a2c4fd464-goog


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] context_tracking: Tag context_tracking_enabled_this_cpu() __always_inline
  2024-06-17 15:51 [PATCH] context_tracking: Tag context_tracking_enabled_this_cpu() __always_inline Sean Christopherson
@ 2024-06-18 18:08 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2024-06-18 18:08 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Frederic Weisbecker, linux-kernel

On Mon, Jun 17, 2024 at 08:51:14AM -0700, Sean Christopherson wrote:
> Force context_tracking_enabled_this_cpu() to be inlined so that invoking
> it from guest_context_enter_irqoff(), which KVM uses in non-instrumentable
> code, doesn't unexpectedly leave a noinstr section.
> 
>   vmlinux.o: warning: objtool: vmx_vcpu_enter_exit+0x1c7: call to
>     context_tracking_enabled_this_cpu() leaves .noinstr.text section
>   vmlinux.o: warning: objtool: svm_vcpu_enter_exit+0x83: call to
>     context_tracking_enabled_this_cpu() leaves .noinstr.text section
> 
> Note, the CONFIG_CONTEXT_TRACKING_USER=n stub is already __always_inline.
> 
> Signed-off-by: Sean Christopherson <seanjc@google.com>

Thank you, Sean, I have queued this for further review and testing.

						Thanx, Paul

> ---
>  include/linux/context_tracking_state.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
> index bbff5f7f8803..1a23d8c7d8c3 100644
> --- a/include/linux/context_tracking_state.h
> +++ b/include/linux/context_tracking_state.h
> @@ -113,7 +113,7 @@ static __always_inline bool context_tracking_enabled_cpu(int cpu)
>  	return context_tracking_enabled() && per_cpu(context_tracking.active, cpu);
>  }
>  
> -static inline bool context_tracking_enabled_this_cpu(void)
> +static __always_inline bool context_tracking_enabled_this_cpu(void)
>  {
>  	return context_tracking_enabled() && __this_cpu_read(context_tracking.active);
>  }
> 
> base-commit: e4e9e1067138e5620cf0500c3e5f6ebfb9d322c8
> -- 
> 2.45.2.627.g7a2c4fd464-goog
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-18 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-17 15:51 [PATCH] context_tracking: Tag context_tracking_enabled_this_cpu() __always_inline Sean Christopherson
2024-06-18 18:08 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®