LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/2] xen: make debugreg accessors always_inline
@ 2021-11-25  9:20 Juergen Gross
  2021-11-25  9:20 ` [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline Juergen Gross
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Juergen Gross @ 2021-11-25  9:20 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: peterz, Juergen Gross, Boris Ostrovsky, Stefano Stabellini,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin

Juergen Gross (2):
  xen: make HYPERVISOR_get_debugreg() always_inline
  xen: make HYPERVISOR_set_debugreg() always_inline

 arch/x86/include/asm/xen/hypercall.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.26.2


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

* [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline
  2021-11-25  9:20 [PATCH 0/2] xen: make debugreg accessors always_inline Juergen Gross
@ 2021-11-25  9:20 ` Juergen Gross
  2021-11-25 15:00   ` Andrew Cooper
  2021-11-25  9:20 ` [PATCH 2/2] xen: make HYPERVISOR_set_debugreg() always_inline Juergen Gross
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Juergen Gross @ 2021-11-25  9:20 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: peterz, Juergen Gross, Boris Ostrovsky, Stefano Stabellini,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, kernel test robot

HYPERVISOR_get_debugreg() is being called from noinstr code, so it
should be attributed "always_inline".

Fixes: f4afb713e5c3a4419ba ("x86/xen: Make get_debugreg() noinstr")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/xen/hypercall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index 0575f5863b7f..28ca1119606b 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -287,7 +287,7 @@ HYPERVISOR_set_debugreg(int reg, unsigned long value)
 	return _hypercall2(int, set_debugreg, reg, value);
 }
 
-static inline unsigned long
+static __always_inline unsigned long
 HYPERVISOR_get_debugreg(int reg)
 {
 	return _hypercall1(unsigned long, get_debugreg, reg);
-- 
2.26.2


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

* [PATCH 2/2] xen: make HYPERVISOR_set_debugreg() always_inline
  2021-11-25  9:20 [PATCH 0/2] xen: make debugreg accessors always_inline Juergen Gross
  2021-11-25  9:20 ` [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline Juergen Gross
@ 2021-11-25  9:20 ` Juergen Gross
  2021-11-25 15:39 ` [PATCH 0/2] xen: make debugreg accessors always_inline Boris Ostrovsky
  2021-11-26 15:16 ` Boris Ostrovsky
  3 siblings, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2021-11-25  9:20 UTC (permalink / raw)
  To: xen-devel, x86, linux-kernel
  Cc: peterz, Juergen Gross, Boris Ostrovsky, Stefano Stabellini,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, kernel test robot

HYPERVISOR_set_debugreg() is being called from noinstr code, so it
should be attributed "always_inline".

Fixes: 7361fac0465ba96ec8f ("x86/xen: Make set_debugreg() noinstr")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/xen/hypercall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
index 28ca1119606b..e5e0fe10c692 100644
--- a/arch/x86/include/asm/xen/hypercall.h
+++ b/arch/x86/include/asm/xen/hypercall.h
@@ -281,7 +281,7 @@ HYPERVISOR_callback_op(int cmd, void *arg)
 	return _hypercall2(int, callback_op, cmd, arg);
 }
 
-static inline int
+static __always_inline int
 HYPERVISOR_set_debugreg(int reg, unsigned long value)
 {
 	return _hypercall2(int, set_debugreg, reg, value);
-- 
2.26.2


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

* Re: [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline
  2021-11-25  9:20 ` [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline Juergen Gross
@ 2021-11-25 15:00   ` Andrew Cooper
  2021-11-25 15:04     ` Juergen Gross
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2021-11-25 15:00 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, x86, linux-kernel
  Cc: peterz, Boris Ostrovsky, Stefano Stabellini, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	kernel test robot

On 25/11/2021 09:20, Juergen Gross wrote:
> HYPERVISOR_get_debugreg() is being called from noinstr code, so it
> should be attributed "always_inline".
>
> Fixes: f4afb713e5c3a4419ba ("x86/xen: Make get_debugreg() noinstr")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  arch/x86/include/asm/xen/hypercall.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
> index 0575f5863b7f..28ca1119606b 100644
> --- a/arch/x86/include/asm/xen/hypercall.h
> +++ b/arch/x86/include/asm/xen/hypercall.h
> @@ -287,7 +287,7 @@ HYPERVISOR_set_debugreg(int reg, unsigned long value)
>  	return _hypercall2(int, set_debugreg, reg, value);
>  }
>  
> -static inline unsigned long
> +static __always_inline unsigned long
>  HYPERVISOR_get_debugreg(int reg)
>  {
>  	return _hypercall1(unsigned long, get_debugreg, reg);

All this is going to do is push the error one step further in.

Next, objtool will complain that hypercall_page isn't noinstr.

~Andrew

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

* Re: [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline
  2021-11-25 15:00   ` Andrew Cooper
@ 2021-11-25 15:04     ` Juergen Gross
  2021-11-25 15:41       ` Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Juergen Gross @ 2021-11-25 15:04 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel, x86, linux-kernel
  Cc: peterz, Boris Ostrovsky, Stefano Stabellini, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	kernel test robot


[-- Attachment #1.1.1: Type: text/plain, Size: 1465 bytes --]

On 25.11.21 16:00, Andrew Cooper wrote:
> On 25/11/2021 09:20, Juergen Gross wrote:
>> HYPERVISOR_get_debugreg() is being called from noinstr code, so it
>> should be attributed "always_inline".
>>
>> Fixes: f4afb713e5c3a4419ba ("x86/xen: Make get_debugreg() noinstr")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>   arch/x86/include/asm/xen/hypercall.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h
>> index 0575f5863b7f..28ca1119606b 100644
>> --- a/arch/x86/include/asm/xen/hypercall.h
>> +++ b/arch/x86/include/asm/xen/hypercall.h
>> @@ -287,7 +287,7 @@ HYPERVISOR_set_debugreg(int reg, unsigned long value)
>>   	return _hypercall2(int, set_debugreg, reg, value);
>>   }
>>   
>> -static inline unsigned long
>> +static __always_inline unsigned long
>>   HYPERVISOR_get_debugreg(int reg)
>>   {
>>   	return _hypercall1(unsigned long, get_debugreg, reg);
> 
> All this is going to do is push the error one step further in.
> 
> Next, objtool will complain that hypercall_page isn't noinstr.

I don't think so:

.pushsection .noinstr.text, "ax"
         .balign PAGE_SIZE
SYM_CODE_START(hypercall_page)
         .rept (PAGE_SIZE / 32)
                 UNWIND_HINT_FUNC
                 .skip 31, 0x90
                 ret
         .endr


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH 0/2] xen: make debugreg accessors always_inline
  2021-11-25  9:20 [PATCH 0/2] xen: make debugreg accessors always_inline Juergen Gross
  2021-11-25  9:20 ` [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline Juergen Gross
  2021-11-25  9:20 ` [PATCH 2/2] xen: make HYPERVISOR_set_debugreg() always_inline Juergen Gross
@ 2021-11-25 15:39 ` Boris Ostrovsky
  2021-11-26 15:16 ` Boris Ostrovsky
  3 siblings, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2021-11-25 15:39 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, x86, linux-kernel
  Cc: peterz, Stefano Stabellini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin


On 11/25/21 4:20 AM, Juergen Gross wrote:
> Juergen Gross (2):
>    xen: make HYPERVISOR_get_debugreg() always_inline
>    xen: make HYPERVISOR_set_debugreg() always_inline
>
>   arch/x86/include/asm/xen/hypercall.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>


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

* Re: [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline
  2021-11-25 15:04     ` Juergen Gross
@ 2021-11-25 15:41       ` Andrew Cooper
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Cooper @ 2021-11-25 15:41 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, x86, linux-kernel
  Cc: peterz, Boris Ostrovsky, Stefano Stabellini, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	kernel test robot

On 25/11/2021 15:04, Juergen Gross wrote:
> On 25.11.21 16:00, Andrew Cooper wrote:
>> On 25/11/2021 09:20, Juergen Gross wrote:
>>> HYPERVISOR_get_debugreg() is being called from noinstr code, so it
>>> should be attributed "always_inline".
>>>
>>> Fixes: f4afb713e5c3a4419ba ("x86/xen: Make get_debugreg() noinstr")
>>> Reported-by: kernel test robot <lkp@intel.com>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>>   arch/x86/include/asm/xen/hypercall.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/x86/include/asm/xen/hypercall.h
>>> b/arch/x86/include/asm/xen/hypercall.h
>>> index 0575f5863b7f..28ca1119606b 100644
>>> --- a/arch/x86/include/asm/xen/hypercall.h
>>> +++ b/arch/x86/include/asm/xen/hypercall.h
>>> @@ -287,7 +287,7 @@ HYPERVISOR_set_debugreg(int reg, unsigned long
>>> value)
>>>       return _hypercall2(int, set_debugreg, reg, value);
>>>   }
>>>   -static inline unsigned long
>>> +static __always_inline unsigned long
>>>   HYPERVISOR_get_debugreg(int reg)
>>>   {
>>>       return _hypercall1(unsigned long, get_debugreg, reg);
>>
>> All this is going to do is push the error one step further in.
>>
>> Next, objtool will complain that hypercall_page isn't noinstr.
>
> I don't think so:
>
> .pushsection .noinstr.text, "ax"
>         .balign PAGE_SIZE
> SYM_CODE_START(hypercall_page)
>         .rept (PAGE_SIZE / 32)
>                 UNWIND_HINT_FUNC
>                 .skip 31, 0x90
>                 ret
>         .endr

/sigh yes.  It would help if I was reading an up to date tree.

Sorry for the noise.

~Andrew

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

* Re: [PATCH 0/2] xen: make debugreg accessors always_inline
  2021-11-25  9:20 [PATCH 0/2] xen: make debugreg accessors always_inline Juergen Gross
                   ` (2 preceding siblings ...)
  2021-11-25 15:39 ` [PATCH 0/2] xen: make debugreg accessors always_inline Boris Ostrovsky
@ 2021-11-26 15:16 ` Boris Ostrovsky
  3 siblings, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2021-11-26 15:16 UTC (permalink / raw)
  To: Juergen Gross, xen-devel, x86, linux-kernel
  Cc: peterz, Stefano Stabellini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin


On 11/25/21 4:20 AM, Juergen Gross wrote:
> Juergen Gross (2):
>    xen: make HYPERVISOR_get_debugreg() always_inline
>    xen: make HYPERVISOR_set_debugreg() always_inline
>
>   arch/x86/include/asm/xen/hypercall.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)



Applied to for-linus-5.16c


-boris


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

end of thread, other threads:[~2021-11-26 15:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25  9:20 [PATCH 0/2] xen: make debugreg accessors always_inline Juergen Gross
2021-11-25  9:20 ` [PATCH 1/2] xen: make HYPERVISOR_get_debugreg() always_inline Juergen Gross
2021-11-25 15:00   ` Andrew Cooper
2021-11-25 15:04     ` Juergen Gross
2021-11-25 15:41       ` Andrew Cooper
2021-11-25  9:20 ` [PATCH 2/2] xen: make HYPERVISOR_set_debugreg() always_inline Juergen Gross
2021-11-25 15:39 ` [PATCH 0/2] xen: make debugreg accessors always_inline Boris Ostrovsky
2021-11-26 15:16 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).