diff mbox series

[v5,5/6] x86: Add Kconfig/Makefile to build hardware prefetch control driver

Message ID 20220607120530.2447112-6-tarumizu.kohei@fujitsu.com
State New
Headers show
Series Add hardware prefetch control driver for A64FX and x86 | expand

Commit Message

tarumizu.kohei@fujitsu.com June 7, 2022, 12:05 p.m. UTC
This adds Kconfig/Makefile to build hardware prefetch control driver
for x86 support. This also adds a MAINTAINERS entry.

Signed-off-by: Kohei Tarumizu <tarumizu.kohei@fujitsu.com>
---
 MAINTAINERS                  |  1 +
 arch/x86/Kconfig             | 17 +++++++++++++++++
 arch/x86/kernel/cpu/Makefile |  2 ++
 3 files changed, 20 insertions(+)

Comments

Randy Dunlap June 7, 2022, 2:40 p.m. UTC | #1
On 6/7/22 05:05, Kohei Tarumizu wrote:
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 4bed3abf444d..3ee173483f9f 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -1359,6 +1359,23 @@ config X86_CPUID
>  	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
>  	  /dev/cpu/31/cpuid.
>  
> +config X86_HWPF_CONTROL
> +	tristate "x86 Hardware Prefetch Control support"
> +	depends on X86_64
> +	help
> +	  This provides a sysfs interface to control the Hardware Prefetch
> +	  behavior for X86.
> +
> +	  Some Intel processors have MSR 0x1a4 (MSR_MISC_FEATURE_CONTROL),
> +	  which can control the hardware prefech behavior. If the processor

	                                 prefetch

> +	  supports this, the module can be loaded with the name x86-pfctl.
> +
> +	  Depending on the characteristics of the application, this register
> +	  parameters improve or degrade performance.
> +
> +	  Please see Documentation/ABI/testing/sysfs-devices-system-cpu for
> +	  more information.
> +
tarumizu.kohei@fujitsu.com June 8, 2022, 6:11 a.m. UTC | #2
> > +	  which can control the hardware prefech behavior. If the processor
> 
> 	                                 prefetch
> 

I'll fix it, thank you.
diff mbox series

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index b3e920a8a044..4f44bbef2614 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8623,6 +8623,7 @@  K:	(devm_)?hwmon_device_(un)?register(|_with_groups|_with_info)
 HARDWARE PREFETCH CONTROL DRIVERS
 M:	Kohei Tarumizu <tarumizu.kohei@fujitsu.com>
 S:	Maintained
+F:	arch/x86/kernel/cpu/x86-pfctl.c
 F:	drivers/soc/fujitsu/a64fx-pfctl.c
 
 HARDWARE RANDOM NUMBER GENERATOR CORE
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4bed3abf444d..3ee173483f9f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1359,6 +1359,23 @@  config X86_CPUID
 	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
 	  /dev/cpu/31/cpuid.
 
+config X86_HWPF_CONTROL
+	tristate "x86 Hardware Prefetch Control support"
+	depends on X86_64
+	help
+	  This provides a sysfs interface to control the Hardware Prefetch
+	  behavior for X86.
+
+	  Some Intel processors have MSR 0x1a4 (MSR_MISC_FEATURE_CONTROL),
+	  which can control the hardware prefech behavior. If the processor
+	  supports this, the module can be loaded with the name x86-pfctl.
+
+	  Depending on the characteristics of the application, this register
+	  parameters improve or degrade performance.
+
+	  Please see Documentation/ABI/testing/sysfs-devices-system-cpu for
+	  more information.
+
 choice
 	prompt "High Memory Support"
 	default HIGHMEM4G
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 9661e3e802be..1aa13dad17a3 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -56,6 +56,8 @@  obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o
 obj-$(CONFIG_HYPERVISOR_GUEST)		+= vmware.o hypervisor.o mshyperv.o
 obj-$(CONFIG_ACRN_GUEST)		+= acrn.o
 
+obj-$(CONFIG_X86_HWPF_CONTROL)		+= x86-pfctl.o
+
 ifdef CONFIG_X86_FEATURE_NAMES
 quiet_cmd_mkcapflags = MKCAP   $@
       cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $@ $^