Skip to contentSkip to conversation

Add unit test module for AMD P-State driver

PATCH Superseded Meng Li 2 participants 7 messages Mar 23, 2022 – Mar 28, 2022

Subsystems (4)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Meng Li

author
#0 lore raw

cover Add unit test module for AMD P-State driver

Hi all:

AMD P-State unit test(amd-pstate-ut) is a kernel module for testing the functions of amd-pstate.
It could import as a module to launch some test tasks.

We upstream out AMD P-state driver into Linux kernel and use this unit test module to verify the required conditions and basic functions of amd-pstate before integration test.

When you test all the test cases, you will get the following test results. The status "P" is pass, "F" is fail.

jasmine@jasmine:/sys/module/amd_pstate_ut/parameters$ cat
unit_test
Index    Test cases              Status
0        stop                    [ ]
1        all                     [P]
2        x86_vendor              [P]
3        acpi_cpc_valid          [P]
4        modprobed_driver        [P]
5        capability_check        [P]
6        enable                  [P]
7        init_perf               [P]
8        support_boost           [P]
9        clear_status            [ ]
------------------------------------------
begin_index = 1 end_index= 8

For exmaple: The test case acpi_cpc_valid is used to check whether the _CPC object is exist in SBIOS.
The amd-pstate initialization will fail if the _CPC in ACPI SBIOS is not existed at the detected processor, so it is a necessary condition.

At present, its test cases are very simple, and the corresponding test cases will continue to be added later to improve the test coverage.

Thanks,
Jasmine

Meng Li (3):
cpufreq: amd-pstate: Expose struct amd_cpudata
cpupower: Introduce a new unit test module for AMD P-State driver
Documentation: amd-pstate: Add unit test introduction

 Documentation/admin-guide/pm/amd-pstate.rst   | 221 +++++++
 drivers/cpufreq/amd-pstate.c                  |  60 +-
 include/linux/amd-pstate.h                    |  74 +++
 tools/power/cpupower/debug/kernel/Makefile    |  10 +-
 .../cpupower/debug/kernel/amd-pstate-ut.c     | 618 ++++++++++++++++++
 5 files changed, 923 insertions(+), 60 deletions(-)
 create mode 100644 include/linux/amd-pstate.h
 create mode 100644 tools/power/cpupower/debug/kernel/amd-pstate-ut.c
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/3 cpufreq: amd-pstate: Expose struct amd_cpudata

Expose struct amd_cpudata to AMD P-State unit test module.

This data struct will be used on the following AMD P-State unit test (amd-pstate-ut) module. The amd-pstate-ut module can get some AMD P-State infomations by this data struct. For example: highest perf, nominal perf, boost supported etc.

---
 drivers/cpufreq/amd-pstate.c | 60 +----------------------------
 include/linux/amd-pstate.h   | 74 ++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 59 deletions(-)
 create mode 100644 include/linux/amd-pstate.h
drivers/cpufreq/amd-pstate.c +1 -59
index 7be38bc6a673..5f7a00a64f76 100644
@@ -36,6 +36,7 @@
 #include <linux/delay.h>
 #include <linux/uaccess.h>
 #include <linux/static_call.h>
+#include <linux/amd-pstate.h>
 
 #include <acpi/processor.h>
 #include <acpi/cppc_acpi.h>
@@ -65,65 +66,6 @@ MODULE_PARM_DESC(shared_mem,
 
 static struct cpufreq_driver amd_pstate_driver;
 
-/**
- * struct  amd_aperf_mperf
- * @aperf: actual performance frequency clock count
- * @mperf: maximum performance frequency clock count
- * @tsc:   time stamp counter
- */
-struct amd_aperf_mperf {
-	u64 aperf;
-	u64 mperf;
-	u64 tsc;
-};
-
-/**
- * struct amd_cpudata - private CPU data for AMD P-State
- * @cpu: CPU number
- * @req: constraint request to apply
- * @cppc_req_cached: cached performance request hints
- * @highest_perf: the maximum performance an individual processor may reach,
- *		  assuming ideal conditions
- * @nominal_perf: the maximum sustained performance level of the processor,
- *		  assuming ideal operating conditions
- * @lowest_nonlinear_perf: the lowest performance level at which nonlinear power
- *			   savings are achieved
- * @lowest_perf: the absolute lowest performance level of the processor
- * @max_freq: the frequency that mapped to highest_perf
- * @min_freq: the frequency that mapped to lowest_perf
- * @nominal_freq: the frequency that mapped to nominal_perf
- * @lowest_nonlinear_freq: the frequency that mapped to lowest_nonlinear_perf
- * @cur: Difference of Aperf/Mperf/tsc count between last and current sample
- * @prev: Last Aperf/Mperf/tsc count value read from register
- * @freq: current cpu frequency value
- * @boost_supported: check whether the Processor or SBIOS supports boost mode
- *
- * The amd_cpudata is key private data for each CPU thread in AMD P-State, and
- * represents all the attributes and goals that AMD P-State requests at runtime.
- */
-struct amd_cpudata {
-	int	cpu;
-
-	struct	freq_qos_request req[2];
-	u64	cppc_req_cached;
-
-	u32	highest_perf;
-	u32	nominal_perf;
-	u32	lowest_nonlinear_perf;
-	u32	lowest_perf;
-
-	u32	max_freq;
-	u32	min_freq;
-	u32	nominal_freq;
-	u32	lowest_nonlinear_freq;
-
-	struct amd_aperf_mperf cur;
-	struct amd_aperf_mperf prev;
-
-	u64 freq;
-	bool	boost_supported;
-};
-
 static inline int pstate_enable(bool enable)
 {
 	return wrmsrl_safe(MSR_AMD_CPPC_ENABLE, enable);
include/linux/amd-pstate.h new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#2 lore raw

PATCH 2/3 cpupower: Introduce a new unit test module for AMD P-State driver

In reply to Meng Li

amd-pstate-ut is a kernel module for testing the functions of AMD P-State driver.

It can verify the required conditions and basic functions of AMD P-State driver before integration test.

---
 tools/power/cpupower/debug/kernel/Makefile    |  10 +-
 .../cpupower/debug/kernel/amd-pstate-ut.c     | 618 ++++++++++++++++++
 2 files changed, 627 insertions(+), 1 deletion(-)
 create mode 100644 tools/power/cpupower/debug/kernel/amd-pstate-ut.c
tools/power/cpupower/debug/kernel/Makefile +9 -1
index 7b5c43684be1..314827f106b4 100644
@@ -8,11 +8,19 @@ ifeq ("$(CONFIG_X86_TSC)", "y")
   obj-m	 += cpufreq-test_tsc.o
 endif
 
+amd_pstate_ut-y := amd-pstate-ut.o
+
+ifeq ("$(CONFIG_X86_AMD_PSTATE)", "y")
+  obj-m	 += amd_pstate_ut.o
+else ifeq ("$(CONFIG_X86_AMD_PSTATE)", "m")
+  obj-m	 += amd_pstate_ut.o
+endif
+
 default:
 	$(MAKE) -C $(KDIR) M=$(CURDIR)
 
 clean:
-	- rm -rf *.o *.ko .*.cmd .*.mod.* *.mod.c
+	- rm -rf *.o *.ko .*.cmd *.mod .*.mod.* *.mod.c
 	- rm -rf Module.symvers modules.order
 
 install: default
tools/power/cpupower/debug/kernel/amd-pstate-ut.c new file +618 -0

618 lines not on this page · raw message

Signature · 1 line
2.25.1
author
#6 lore raw

PATCH 3/3 Documentation: amd-pstate: Add unit test introduction

In reply to Meng Li

Introduce the AMD P-State unit test module design and implementation.

---
 Documentation/admin-guide/pm/amd-pstate.rst | 221 ++++++++++++++++++++
 1 file changed, 221 insertions(+)
Documentation/admin-guide/pm/amd-pstate.rst +221 -0
index 1923cb25073b..47ba6eeb2e38 100644
@@ -182,6 +182,7 @@ according to the ``struct sugov_cpu`` that utilization update belongs to.
 Then ``amd-pstate`` updates the desired performance according to the CPU
 scheduler assigned.
 
+.. _processor_support:
 
 Processor Support
 =======================
@@ -283,6 +284,8 @@ efficiency frequency management method on AMD processors.
 Kernel Module Options for ``amd-pstate``
 =========================================
 
+.. _shared_mem:
+
 ``shared_mem``
 Use a module param (shared_mem) to enable related processors manually with
 **amd_pstate.shared_mem=1**.
@@ -395,6 +398,224 @@ about part of the output. ::
  CPU_006     712          116408        39        49        166       0.6769  8950227 1839034 37192089  24.06  11.272       470         2.496         kworker/6:0-1264
 
 
+Unit Tests for amd-pstate
+-------------------------
+
+``amd-pstate-ut`` is a kernel module for testing the functions of ``amd-pstate``.
+It can verify the required conditions and basic functions of ``amd-pstate`` before integration test.
+
+1. Test case decriptions
+
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | Index   | Functions                      | Description                                                                        |
+        +=========+================================+====================================================================================+
+        | 0       | stop                           || Stop the test currently in progress.                                              |
+        |         |                                ||                                                                                   |
+        |         |                                || For example: if the n test case is being executed, it needs to be completed and   |
+        |         |                                | the next test case will not be executed.                                           |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 1       | all                            || Start all test cases.                                                             |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : all cases pass                                                           |
+        |         |                                || - Fail : only one case fail                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 2       | x86_vendor                     || Check whether the boot CPU x86_vendor is AMD.                                     |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 3       | acpi_cpc_valid                 || Check whether the _CPC object is present in SBIOS.                                |
+        |         |                                ||                                                                                   |
+        |         |                                || The detail refer to `Processor Support <processor_support_>`_.                    |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 4       | modprobed_driver               || Check whether cpufreq_driver module is load.                                      |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 5       | capability_check               || Full MSR Support: check whether cpu set feature flag :c:macro:`X86_FEATURE_CPPC`. |
+        |         |                                || The detail refer to `Processor Support <processor_support_>`_.                    |
+        |         |                                ||                                                                                   |
+        |         |                                || Shared Memory Support: check whether module param shared_mem enable               |
+        |         |                                || The detail refer to `Shared Memory <shared_mem_>`_.                               |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 6       | enable                         || Check whether AMD P-State is enabled.                                             |
+        |         |                                ||                                                                                   |
+        |         |                                || AMD P-States and ACPI hardware P-States always can be supported in one processor. |
+        |         |                                | But AMD P-States has the higher priority and if it is enabled with                 |
+        |         |                                | :c:macro:`MSR_AMD_CPPC_ENABLE` or ``cppc_set_enable``, it will respond to the      |
+        |         |                                | request from AMD P-States.                                                         |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 7       | init_perf                      || Check whether AMD P-State init perf sucessfully.                                  |
+        |         |                                | Include highest_perf, nominal_perf, lowest_nonlinear_perf and lowest_perf values.  |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : no                                                                       |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 8       | support_boost                  || Check whether all cpus support boost.                                             |
+        |         |                                ||                                                                                   |
+        |         |                                || If boost is not active but supported, this maximum frequency will be larger than  |
+        |         |                                | the one in ``cpuinfo``.                                                            |
+        |         |                                ||                                                                                   |
+        |         |                                || - Pass : yes                                                                      |
+        |         |                                || - Fail : only one cpu not suppport boost                                          |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+        | 9       | clear_status                   || Clear all test results.                                                           |
+        |         |                                ||                                                                                   |
+        |         |                                || **This test case is always at the end and cannot be changed.**                    |
+        +---------+--------------------------------+------------------------------------------------------------------------------------+
+
+#. How to execute the tests
+
+    a. Build ::
+
+        jasminemeng@jasmine-meng:~/amd-brahma$ cd linux
+        jasminemeng@jasmine-meng:~/amd-brahma/linux$ make modules M=tools/power/cpupower/debug/kernel/
+          CC [M]  tools/power/cpupower/debug/kernel/amd_pstate_ut.o
+          MODPOST tools/power/cpupower/debug/kernel/Module.symvers
+          CC [M]  tools/power/cpupower/debug/kernel/amd_pstate_ut.mod.o
+          LD [M]  tools/power/cpupower/debug/kernel/amd_pstate_ut.ko
+
+
+    #. Installation & Steps
+
+       Test all cases ::
+
+        jasmine@jasmine-MayanDAP-RMB:~$ sudo insmod amd_pstate_ut.ko
+        jasmine@jasmine-MayanDAP-RMB:~$ cd /sys/module/amd_pstate_ut/parameters/
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ sudo chmod 666 unit_test
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ cat unit_test
+        Index	 Test cases          	 Status
+        0    	 stop                	 [ ]
+        1    	 all                 	 [ ]
+        2    	 x86_vendor          	 [ ]
+        3    	 acpi_cpc_valid      	 [ ]
+        4    	 modprobed_driver    	 [ ]
+        5    	 capability_check    	 [ ]
+        6    	 enable              	 [ ]
+        7    	 init_perf           	 [ ]
+        8    	 support_boost       	 [ ]
+        9    	 clear_status        	 [ ]
+        ------------------------------------------
+        begin_index = 0 end_index= 0
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ echo 1 > unit_test
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ cat unit_test
+        Index	 Test cases          	 Status
+        0    	 stop                	 [ ]
+        1    	 all                 	 [P]
+        2    	 x86_vendor          	 [P]
+        3    	 acpi_cpc_valid      	 [P]
+        4    	 modprobed_driver    	 [P]
+        5    	 capability_check    	 [P]
+        6    	 enable              	 [P]
+        7    	 init_perf           	 [P]
+        8    	 support_boost       	 [P]
+        9    	 clear_status        	 [ ]
+        ------------------------------------------
+        begin_index = 1 end_index= 8
+
+       Clear test resut ::
+
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ echo 9 > unit_test
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ cat unit_test
+        Index	 Test cases          	 Status
+        0    	 stop                	 [ ]
+        1    	 all                 	 [ ]
+        2    	 x86_vendor          	 [ ]
+        3    	 acpi_cpc_valid      	 [ ]
+        4    	 modprobed_driver    	 [ ]
+        5    	 capability_check    	 [ ]
+        6    	 enable              	 [ ]
+        7    	 init_perf           	 [ ]
+        8    	 support_boost       	 [ ]
+        ------------------------------------------
+        begin_index = 0 end_index= 0
+
+       Test specific case ::
+
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ echo 3 > unit_test
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ cat unit_test
+        Index	 Test cases          	 Status
+        0    	 stop                	 [ ]
+        1    	 all                 	 [ ]
+        2    	 x86_vendor          	 [ ]
+        3    	 acpi_cpc_valid      	 [P]
+        4    	 modprobed_driver    	 [ ]
+        5    	 capability_check    	 [ ]
+        6    	 enable              	 [ ]
+        7    	 init_perf           	 [ ]
+        8    	 support_boost       	 [ ]
+        9    	 clear_status        	 [ ]
+        ------------------------------------------
+        begin_index = 3 end_index= 3
+
+       Test some cases ::
+
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ echo 5 8 > unit_test
+        jasmine@jasmine-MayanDAP-RMB:/sys/module/amd_pstate_ut/parameters$ cat unit_test
+        Index	 Test cases          	 Status
+        0    	 stop                	 [ ]
+        1    	 all                 	 [ ]
+        2    	 x86_vendor          	 [ ]
+        3    	 acpi_cpc_valid      	 [P]
+        4    	 modprobed_driver    	 [ ]
+        5    	 capability_check    	 [P]
+        6    	 enable              	 [P]
+        7    	 init_perf           	 [P]
+        8    	 support_boost       	 [P]
+        9    	 clear_status        	 [ ]
+        ------------------------------------------
+        begin_index = 5 end_index= 8
+
+
+    #. Results
+
+        +-----------+--------------------------------+
+        |  Status   | Description                    |
+        +===========+================================+
+        |   [ ]     | Not test.                      |
+        +-----------+--------------------------------+
+        |   [P]     | Test pass.                     |
+        +-----------+--------------------------------+
+        |   [F]     | Test fail.                     |
+        +-----------+--------------------------------+
+
+        Enable all the messages in the ``amd-pstate-ut`` module. ::
+
+         jasmine@jasmine-MayanDAP-RMB:~/3_Cr$ su
+         root@jasmine-MayanDAP-RMB:# echo -n "module amd_pstate_ut +p" > /sys/kernel/debug/dynamic_debug/control
+
+        When you start to test all cases, you will get the follow logs. ::
+
+         jasmine@jasmine-MayanDAP-RMB:~$ dmesg | grep "AMD P-state UT" | tee log.txt
+         [  732.084122] AMD P-state UT:param_set_index 1 0 result=0!
+         [  732.084140] AMD P-state UT:!====! Begin all unit test! !====!
+         [  732.084146] AMD P-state UT:****** Begin 2    	 x86_vendor          	 ******
+         [  732.084152] AMD P-state UT:****** End   2    	 x86_vendor          	 ******
+         [  732.084156] AMD P-state UT:****** Begin 3    	 acpi_cpc_valid      	 ******
+         [  732.084162] AMD P-state UT:****** End   3    	 acpi_cpc_valid      	 ******
+         [  732.084165] AMD P-state UT:****** Begin 4    	 modprobed_driver    	 ******
+         [  732.084168] AMD P-state UT:****** End   4    	 modprobed_driver    	 ******
+         [  732.084172] AMD P-state UT:****** Begin 5    	 capability_check    	 ******
+         [  732.084174] AMD P-state UT:****** End   5    	 capability_check    	 ******
+         [  732.084176] AMD P-state UT:****** Begin 6    	 enable              	 ******
+         [  732.084222] AMD P-state UT:****** End   6    	 enable              	 ******
+         [  732.084225] AMD P-state UT:****** Begin 7    	 init_perf           	 ******
+         [  732.085016] AMD P-state UT:****** End   7    	 init_perf           	 ******
+         [  732.085026] AMD P-state UT:****** Begin 8    	 support_boost       	 ******
+         [  732.085033] AMD P-state UT:****** End   8    	 support_boost       	 ******
+         [  732.085036] AMD P-state UT:!====! End   all unit test! !====!
+
+
 Reference
 ===========
 
Signature · 1 line
2.25.1
maintainer
#3 lore raw

Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver

In reply to Meng Li
Quoted 5 lines · Meng Li

amd-pstate-ut is a kernel module for testing the functions of AMD P-State driver.

It can verify the required conditions and basic functions of AMD P-State driver before integration test.

Can you elaborate on the need for a kernel module? It would be helpful to know tne value the mdoule adds and why it is necessary. Include details on why it can't be done as part of the user-space program.

I am not saying it isn't necssary, I would like to know the reasons before I review the patch.

Also if this is a driver test, why not use other test frameworks such as kunit or kselftest. cpupower is user-space utility and driver debug code would not belong in here.

thanks,
-- Shuah

#4 lore raw

RE: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver

[AMD Official Use Only]

Hi Shuah:

Thank you very much for your valuable suggestions.
We will adapt it to test our AMD P-State driver. But we haven't decided which one to adapt, kunit or kselftest.

Requirements for our unit test module:
- It can access kernel internal structures and functions which aren't exposed to user space.
- It is implemented through the script trigger CPU benchmark app in conjunction with the kernel module.

Therefore, next, we will study which method can meet the above requirements. Can you give us some suggestions?

Thanks,
Jasmine

-----Original Message-----
From: Shuah Khan <[email protected]>
Sent: Wednesday, March 23, 2022 10:15 PM
To: Meng, Li (Jassmine) <[email protected]>; Rafael J . Wysocki <[email protected]>; Huang, Ray <[email protected]>; [email protected]
Cc: Fontenot, Nathan <[email protected]>; Sharma, Deepak <[email protected]>; Deucher, Alexander <[email protected]>; Limonciello, Mario <[email protected]>; Su, Jinzhou (Joe) <[email protected]>; Yuan, Perry <[email protected]>; Du, Xiaojian <[email protected]>; Viresh Kumar <[email protected]>; Borislav Petkov <[email protected]>; [email protected]; Shuah Khan <[email protected]>
Subject: Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver

[CAUTION: External Email]

Quoted 5 lines · Meng Li

amd-pstate-ut is a kernel module for testing the functions of AMD P-State driver.

It can verify the required conditions and basic functions of AMD P-State driver before integration test.

Can you elaborate on the need for a kernel module? It would be helpful to know tne value the mdoule adds and why it is necessary. Include details on why it can't be done as part of the user-space program.

I am not saying it isn't necssary, I would like to know the reasons before I review the patch.

Also if this is a driver test, why not use other test frameworks such as kunit or kselftest. cpupower is user-space utility and driver debug code would not belong in here.

thanks,
-- Shuah

maintainer
#5 lore raw

Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver

Quoted 7 lines · Li (Jassmine)

[AMD Official Use Only]

Hi Shuah:

Thank you very much for your valuable suggestions.
We will adapt it to test our AMD P-State driver. But we haven't decided which one to adapt, kunit or kselftest.

Quoted 7 lines

Requirements for our unit test module:
- It can access kernel internal structures and functions which aren't exposed to user space.
- It is implemented through the script trigger CPU benchmark app in conjunction with the kernel module.

Therefore, next, we will study which method can meet the above requirements. Can you give us some suggestions?

No top posting please. If you need to access kernel internal structures and functions KUNit is a better choice for you as long as all of the testing can be done in the kernel driver.

If kernel internal structures and functions need to be tested from user-space, then a kernel driver test module and a user-space kselftest shell or C program is the approach to take.

Quoted 16 lines

-----Original Message-----
From: Shuah Khan <[email protected]>
Sent: Wednesday, March 23, 2022 10:15 PM
To: Meng, Li (Jassmine) <[email protected]>; Rafael J . Wysocki <[email protected]>; Huang, Ray <[email protected]>; [email protected]
Cc: Fontenot, Nathan <[email protected]>; Sharma, Deepak <[email protected]>; Deucher, Alexander <[email protected]>; Limonciello, Mario <[email protected]>; Su, Jinzhou (Joe) <[email protected]>; Yuan, Perry <[email protected]>; Du, Xiaojian <[email protected]>; Viresh Kumar <[email protected]>; Borislav Petkov <[email protected]>; [email protected]; Shuah Khan <[email protected]>
Subject: Re: [PATCH 2/3] cpupower: Introduce a new unit test module for AMD P-State driver

[CAUTION: External Email]

Quoted 5 lines · Meng Li

amd-pstate-ut is a kernel module for testing the functions of AMD P-State driver.

It can verify the required conditions and basic functions of AMD P-State driver before integration test.

Quoted 6 lines

Can you elaborate on the need for a kernel module? It would be helpful to know tne value the mdoule adds and why it is necessary. Include details on why it can't be done as part of the user-space program.

I am not saying it isn't necssary, I would like to know the reasons before I review the patch.

Also if this is a driver test, why not use other test frameworks such as kunit or kselftest. cpupower is user-space utility and driver debug code would not belong in here.

thanks,
-- Shuah