[1/7] x86: Move ARCH_HAS_CPU_RELAX to arch

Message ID 1700488898-12431-2-git-send-email-mihai.carabas@oracle.com
State New
Headers
Series [1/7] x86: Move ARCH_HAS_CPU_RELAX to arch |

Commit Message

Mihai Carabas Nov. 20, 2023, 2:01 p.m. UTC
  From: Joao Martins <joao.m.martins@oracle.com>

ARM64 is going to use it for haltpoll support (for poll-state)
so move the definition to be arch-agnostic and allow architectures
to override it.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
---
 arch/Kconfig     | 3 +++
 arch/x86/Kconfig | 1 +
 2 files changed, 4 insertions(+)
  

Comments

Petr Mladek Nov. 27, 2023, 2:44 p.m. UTC | #1
On Mon 2023-11-20 16:01:32, Mihai Carabas wrote:
> From: Joao Martins <joao.m.martins@oracle.com>
> 
> ARM64 is going to use it for haltpoll support (for poll-state)
> so move the definition to be arch-agnostic and allow architectures
> to override it.

This says that the definition is moved.

> diff --git a/arch/Kconfig b/arch/Kconfig
> index 4a85a10b12fd..92af0e9bc35e 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -1371,6 +1371,9 @@ config RELR
>  config ARCH_HAS_MEM_ENCRYPT
>  	bool
>  
> +config ARCH_HAS_CPU_RELAX
> +	bool
> +
>  config ARCH_HAS_CC_PLATFORM
>  	bool
>  
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index d1c362f479d9..0c77670d020e 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -73,6 +73,7 @@ config X86
>  	select ARCH_HAS_CACHE_LINE_SIZE
>  	select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
>  	select ARCH_HAS_CPU_FINALIZE_INIT
> +	select ARCH_HAS_CPU_RELAX
>  	select ARCH_HAS_CURRENT_STACK_POINTER
>  	select ARCH_HAS_DEBUG_VIRTUAL
>  	select ARCH_HAS_DEBUG_VM_PGTABLE	if !X86_PAE

But the definion is only added here.

I would expect that the patch also removes the original definion.


Best Regards,
Petr
  
Mihai Carabas Nov. 28, 2023, 2:09 p.m. UTC | #2
>> From: Joao Martins <joao.m.martins@oracle.com>
>>
>> ARM64 is going to use it for haltpoll support (for poll-state)
>> so move the definition to be arch-agnostic and allow architectures
>> to override it.
> This says that the definition is moved.
>
>> diff --git a/arch/Kconfig b/arch/Kconfig
>> index 4a85a10b12fd..92af0e9bc35e 100644
>> --- a/arch/Kconfig
>> +++ b/arch/Kconfig
>> @@ -1371,6 +1371,9 @@ config RELR
>>   config ARCH_HAS_MEM_ENCRYPT
>>   	bool
>>   
>> +config ARCH_HAS_CPU_RELAX
>> +	bool
>> +
>>   config ARCH_HAS_CC_PLATFORM
>>   	bool
>>   
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index d1c362f479d9..0c77670d020e 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -73,6 +73,7 @@ config X86
>>   	select ARCH_HAS_CACHE_LINE_SIZE
>>   	select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
>>   	select ARCH_HAS_CPU_FINALIZE_INIT
>> +	select ARCH_HAS_CPU_RELAX
>>   	select ARCH_HAS_CURRENT_STACK_POINTER
>>   	select ARCH_HAS_DEBUG_VIRTUAL
>>   	select ARCH_HAS_DEBUG_VM_PGTABLE	if !X86_PAE
> But the definion is only added here.
>
> I would expect that the patch also removes the original definion.

Thanks for catching this. I updated the patch:

diff --git a/arch/Kconfig b/arch/Kconfig
index 12d51495caec..626ddd9ba7e0 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1371,6 +1371,9 @@ config RELR
  config ARCH_HAS_MEM_ENCRYPT
         bool

+config ARCH_HAS_CPU_RELAX
+       bool
+
  config ARCH_HAS_CC_PLATFORM
         bool

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 66bfabae8814..aaca90ba791a 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -72,6 +72,7 @@ config X86
         select ARCH_HAS_CACHE_LINE_SIZE
         select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
         select ARCH_HAS_CPU_FINALIZE_INIT
+       select ARCH_HAS_CPU_RELAX
         select ARCH_HAS_CURRENT_STACK_POINTER
         select ARCH_HAS_DEBUG_VIRTUAL
         select ARCH_HAS_DEBUG_VM_PGTABLE        if !X86_PAE
@@ -363,9 +364,6 @@ config ARCH_MAY_HAVE_PC_FDC
  config GENERIC_CALIBRATE_DELAY
         def_bool y

-config ARCH_HAS_CPU_RELAX
-       def_bool y
-
  config ARCH_HIBERNATION_POSSIBLE
         def_bool y
  

Patch

diff --git a/arch/Kconfig b/arch/Kconfig
index 4a85a10b12fd..92af0e9bc35e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1371,6 +1371,9 @@  config RELR
 config ARCH_HAS_MEM_ENCRYPT
 	bool
 
+config ARCH_HAS_CPU_RELAX
+	bool
+
 config ARCH_HAS_CC_PLATFORM
 	bool
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d1c362f479d9..0c77670d020e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -73,6 +73,7 @@  config X86
 	select ARCH_HAS_CACHE_LINE_SIZE
 	select ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
 	select ARCH_HAS_CPU_FINALIZE_INIT
+	select ARCH_HAS_CPU_RELAX
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL
 	select ARCH_HAS_DEBUG_VM_PGTABLE	if !X86_PAE