[PATCH v5 2/2] selftests/resctrl: Adjust SNC support messages

2024-10-29 Thread Maciej Wieczor-Retman
alert the user when SNC detection could return incorrect results. Correct old messages to account for kernel support of SNC in resctrl. Signed-off-by: Maciej Wieczor-Retman --- Changelog v5: - Move all resctrlfs.c code from this patch to 1/2. (Reinette) - Remove kernel support check and error me

[PATCH v5 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-10-29 Thread Maciej Wieczor-Retman
active by comparing the number of CPUs that share a cache with CPU0, with the number of CPUs on node0. Co-developed-by: Tony Luck Signed-off-by: Tony Luck Signed-off-by: Maciej Wieczor-Retman --- Changelog v5: - Set snc_mode to 1 at the start of if(!snc_mode) block. - Move all resctrlfs.c code

[PATCH v5 0/2] selftests/resctrl: SNC kernel support discovery

2024-10-29 Thread Maciej Wieczor-Retman
https://lore.kernel.org/all/cover.1719842207.git.maciej.wieczor-ret...@intel.com/ [v4] https://lore.kernel.org/all/cover.1720774981.git.maciej.wieczor-ret...@intel.com/ Maciej Wieczor-Retman (2): selftests/resctrl: Adjust effective L3 cache size with SNC enabled selftests/resctrl: Adjust SNC su

[PATCH] selftests/lam: Test get_user() LAM pointer handling

2024-10-29 Thread Maciej Wieczor-Retman
.129639-1-torva...@linux-foundation.org/ [2] https://lore.kernel.org/all/20240710160655.3402786-1-alexander.shish...@linux.intel.com/ Signed-off-by: Maciej Wieczor-Retman --- tools/testing/selftests/x86/lam.c | 85 +++ 1 file changed, 85 insertions(+) diff --git

Re: [PATCH] selftests/lam: Test get_user() LAM pointer handling

2024-10-30 Thread Maciej Wieczor-Retman
On 2024-10-30 at 14:31:51 +0200, Kirill A. Shutemov wrote: >On Tue, Oct 29, 2024 at 03:14:20PM +0100, Maciej Wieczor-Retman wrote: >> Recent change in how get_user() handles pointers [1] has a specific case >> for LAM. It assigns a different bitmask that's later used to check

Re: [PATCH v4 2/2] selftests/resctrl: Adjust SNC support messages

2024-09-19 Thread Maciej Wieczor-Retman
On 2024-09-17 at 08:32:11 -0700, Reinette Chatre wrote: >Hi Maciej, > >On 8/27/24 1:15 AM, Maciej Wieczor-Retman wrote: >> On 2024-08-12 at 16:40:10 -0700, Reinette Chatre wrote: >> > On 7/12/24 2:04 AM, Maciej Wieczor-Retman wrote: > >> > > + >>

[PATCH v3] selftests/lam: Test get_user() LAM pointer handling

2024-11-22 Thread Maciej Wieczor-Retman
essfully tested in Simics on a 5-level capable machine. [1] https://lore.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ [2] https://lore.kernel.org/all/20240710160655.3402786-1-alexander.shish...@linux.intel.com/ Signed-off-by: Maciej Wieczor-Retman --- Changelog v3: - m

Re: [PATCH v3] selftests/lam: Test get_user() LAM pointer handling

2024-11-22 Thread Maciej Wieczor-Retman
On 2024-11-22 at 11:13:44 +0200, Kirill A. Shutemov wrote: >On Fri, Nov 22, 2024 at 09:55:20AM +0100, Maciej Wieczor-Retman wrote: >> Recent change in how get_user() handles pointers [1] has a specific case >> for LAM. It assigns a different bitmask that's later used to check

[PATCH v5 3/3] selftests/lam: Test get_user() LAM pointer handling

2024-11-27 Thread Maciej Wieczor-Retman
n its implementation. Execute the syscall with differently tagged pointers to verify that valid user pointers are passing through and invalid kernel/non-canonical pointers are not. [1] https://lore.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ Signed-off-by: Maciej Wieczor-Retman Ack

[PATCH v5 2/3] selftests/lam: Skip test if LAM is disabled

2024-11-27 Thread Maciej Wieczor-Retman
tests in the latter case. [1] https://lore.kernel.org/all/20241028160917.1380714-1-alexander.shish...@linux.intel.com/ Signed-off-by: Maciej Wieczor-Retman Acked-by: Kirill A. Shutemov Acked-by: Shuah Khan --- Changelog v4: - Add this patch to the series. tools/testing/selftests/x86/lam.c

[PATCH v5 0/3] selftests/lam: get_user additions and LAM enabled check

2024-11-27 Thread Maciej Wieczor-Retman
.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ [2] https://lore.kernel.org/all/20241028160917.1380714-1-alexander.shish...@linux.intel.com/ Maciej Wieczor-Retman (3): selftests/lam: Move cpu_has_la57() to use cpuinfo flag selftests/lam: Skip test if LAM is disabled self

[PATCH v5 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2024-11-27 Thread Maciej Wieczor-Retman
into the kernel, is supported by the platform and wasn't disabled by kernel command line argument. Use system() with cat and grep to figure out if la57 is enabled on the running system. Signed-off-by: Maciej Wieczor-Retman Acked-by: Kirill A. Shutemov Acked-by: Shuah Khan --- Changelog v5

Re: [PATCH v4 0/3] selftests/lam: get_user additions and LAM enabled check

2024-11-27 Thread Maciej Wieczor-Retman
On 2024-11-26 at 09:34:36 -0700, Shuah Khan wrote: >On 11/26/24 06:34, Maciej Wieczor-Retman wrote: >> Recent change in how get_user() handles pointers [1] has a specific case >> for LAM. It assigns a different bitmask that's later used to check >> whether a pointer comes

[PATCH v2] selftests/lam: Test get_user() LAM pointer handling

2024-11-21 Thread Maciej Wieczor-Retman
essfully tested in Simics on a 5-level capable machine. [1] https://lore.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ [2] https://lore.kernel.org/all/20240710160655.3402786-1-alexander.shish...@linux.intel.com/ Signed-off-by: Maciej Wieczor-Retman --- Changelog v2:

Re: [PATCH v4 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2024-11-27 Thread Maciej Wieczor-Retman
On 2024-11-27 at 14:11:38 +0200, Kirill A. Shutemov wrote: >On Tue, Nov 26, 2024 at 02:34:48PM +0100, Maciej Wieczor-Retman wrote: >> In current form cpu_has_la57() reports platform's support for LA57 >> through reading the output of cpuid. A much more useful information i

[PATCH v6 0/2] selftests/resctrl: SNC kernel support discovery

2024-12-02 Thread Maciej Wieczor-Retman
el.org/all/cover.1730206468.git.maciej.wieczor-ret...@intel.com/ Maciej Wieczor-Retman (2): selftests/resctrl: Adjust effective L3 cache size with SNC enabled selftests/resctrl: Discover SNC kernel support and adjust messages tools/testing/selftests/resctrl/cmt_test.c| 4 +- tools/testing

[PATCH v6 2/2] selftests/resctrl: Discover SNC kernel support and adjust messages

2024-12-02 Thread Maciej Wieczor-Retman
Add helper that checks for mon_sub_L3_00 existence. Correct old messages to account for kernel support of SNC in resctrl. Signed-off-by: Maciej Wieczor-Retman --- Changelog v6: - Remove snc_unreliable checks at the end of the tests since now the tests are skipped if snc_unreliable was s

[PATCH v6 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-12-02 Thread Maciej Wieczor-Retman
lts couldn't be trusted. Co-developed-by: Tony Luck Signed-off-by: Tony Luck Signed-off-by: Maciej Wieczor-Retman --- Changelog v6: - Redo snc_nodes_per_l3_cache() by removing old logic and taking into account existance of cpus_offline_empty(). - Remove MAX_SNC since now we just divide cac

[PATCH v4 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2024-11-26 Thread Maciej Wieczor-Retman
into the kernel, is supported by the platform and wasn't disabled by kernel command line argument. Use system() with cat and grep to figure out if la57 is enabled on the running system. Signed-off-by: Maciej Wieczor-Retman --- Changelog v4: - Add this patch to the series. tools/testing/sel

[PATCH v4 3/3] selftests/lam: Test get_user() LAM pointer handling

2024-11-26 Thread Maciej Wieczor-Retman
n its implementation. Execute the syscall with differently tagged pointers to verify that valid user pointers are passing through and invalid kernel/non-canonical pointers are not. [1] https://lore.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ Signed-off-by: Maciej Wieczor-R

[PATCH v4 2/3] selftests/lam: Skip test if LAM is disabled

2024-11-26 Thread Maciej Wieczor-Retman
tests in the latter case. [1] https://lore.kernel.org/all/20241028160917.1380714-1-alexander.shish...@linux.intel.com/ Signed-off-by: Maciej Wieczor-Retman --- Changelog v4: - Add this patch to the series. tools/testing/selftests/x86/lam.c | 13 + 1 file changed, 13 insertions

[PATCH v4 0/3] selftests/lam: get_user additions and LAM enabled check

2024-11-26 Thread Maciej Wieczor-Retman
.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ [2] https://lore.kernel.org/all/20241028160917.1380714-1-alexander.shish...@linux.intel.com/ Maciej Wieczor-Retman (3): selftests/lam: Move cpu_has_la57() to use cpuinfo flag selftests/lam: Skip test if LAM is disabled self

Re: [PATCH v6 2/2] selftests/resctrl: Discover SNC kernel support and adjust messages

2024-12-04 Thread Maciej Wieczor-Retman
On 2024-12-03 at 15:30:56 -0800, Reinette Chatre wrote: >Hi Maciej, > >On 12/2/24 3:08 AM, Maciej Wieczor-Retman wrote: > >> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c >> b/tools/testing/selftests/resctrl/resctrlfs.c >> index 50561993d37c..d0a5c0f78397

Re: [PATCH v6 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-12-04 Thread Maciej Wieczor-Retman
On 2024-12-03 at 15:26:41 -0800, Reinette Chatre wrote: >Hi Maciej, > >On 12/2/24 3:08 AM, Maciej Wieczor-Retman wrote: > >> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c >> b/tools/testing/selftests/resctrl/resctrlfs.c >> index d38d6dd90be4..50561993d37c

[PATCH v7 2/2] selftests/resctrl: Discover SNC kernel support and adjust messages

2024-12-09 Thread Maciej Wieczor-Retman
Add helper that checks for mon_sub_L3_00 existence. Correct old messages to account for kernel support of SNC in resctrl. Signed-off-by: Maciej Wieczor-Retman --- Changelog v7: - Merge strings with file paths that are saved into node_path variable. Changelog v6: - Remove snc_unreliable checks at

[PATCH v7 0/2] selftests/resctrl: SNC kernel support discovery

2024-12-09 Thread Maciej Wieczor-Retman
1719842207.git.maciej.wieczor-ret...@intel.com/ [v4] https://lore.kernel.org/all/cover.1720774981.git.maciej.wieczor-ret...@intel.com/ [v5] https://lore.kernel.org/all/cover.1730206468.git.maciej.wieczor-ret...@intel.com/ [v6] https://lore.kernel.org/all/cover.1733136454.git.maciej.wieczor-ret...@intel.com/ Maci

[PATCH v7 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-12-09 Thread Maciej Wieczor-Retman
tection was not reliable due to offline cpus. If it was skip running tests since the results couldn't be trusted. Co-developed-by: Tony Luck Signed-off-by: Tony Luck Signed-off-by: Maciej Wieczor-Retman --- Changelog v7: - Check return value when opening empty cpus file. - Add protection a

Re: [PATCH v7 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-12-16 Thread Maciej Wieczor-Retman
Hello! On 2024-12-09 at 11:18:37 -0800, Reinette Chatre wrote: >Hi Maciej, > >On 12/9/24 3:09 AM, Maciej Wieczor-Retman wrote: >> Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA >> nodes. Systems may support splitting into either two, three, four or s

[PATCH v8 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

2024-12-16 Thread Maciej Wieczor-Retman
tection was not reliable due to offline cpus. If it was skip running tests since the results couldn't be trusted. Co-developed-by: Tony Luck Signed-off-by: Tony Luck Signed-off-by: Maciej Wieczor-Retman --- Changelog v8: - Fix Makefile changes by only modifying CFLAGS after including l

Re: [PATCH v7 0/2] selftests/resctrl: SNC kernel support discovery

2024-12-16 Thread Maciej Wieczor-Retman
On 2024-12-09 at 11:19:32 -0800, Reinette Chatre wrote: >Hi Maciej, > >On 12/9/24 3:09 AM, Maciej Wieczor-Retman wrote: >> >> Sub-Numa Clustering (SNC) allows splitting CPU cores, caches and memory >> into multiple NUMA nodes. When enabled, NUMA-aware applica

[PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2024-12-16 Thread Maciej Wieczor-Retman
over.1730206468.git.maciej.wieczor-ret...@intel.com/ [v6] https://lore.kernel.org/all/cover.1733136454.git.maciej.wieczor-ret...@intel.com/ [v7] https://lore.kernel.org/all/cover.1733741950.git.maciej.wieczor-ret...@intel.com/ Maciej Wieczor-Retman (2): selftests/resctrl: Adjust effective L3 cache size w

[PATCH v8 2/2] selftests/resctrl: Discover SNC kernel support and adjust messages

2024-12-16 Thread Maciej Wieczor-Retman
Add helper that checks for mon_sub_L3_00 existence. Correct old messages to account for kernel support of SNC in resctrl. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Reinette Chatre --- Changelog v8: - Add Reinette's reviewed by tag. Changelog v7: - Merge strings with file paths that

Re: [PATCH v5 2/3] selftests/lam: Skip test if LAM is disabled

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 08:23:09 -0800, Dave Hansen wrote: >On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >> +static inline int kernel_has_lam(void) >> +{ >> +unsigned long bits; >> + >> +syscall(SYS_arch_prctl, ARCH_GET_MAX_TAG_BITS, &bits); >> +

Re: [PATCH v5 3/3] selftests/lam: Test get_user() LAM pointer handling

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 08:32:18 -0800, Dave Hansen wrote: >On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >... >> +switch (test->later) { >> +case GET_USER_USER: >> +/* Control group - properly tagger user pointer */ >> +ptr = (void *

Re: [PATCH v5 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 08:14:41 -0800, Dave Hansen wrote: >On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >> -/* Check 5-level page table feature in CPUID.(EAX=07H, ECX=00H):ECX.[bit >> 16] */ >> static inline int cpu_has_la57(void) >> { >> -unsigned int cpuin

Re: [PATCH v5 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2025-01-24 Thread Maciej Wieczor-Retman
On 2025-01-24 at 21:17:22 +0100, Maciej Wieczor-Retman wrote: >On 2025-01-24 at 08:14:41 -0800, Dave Hansen wrote: >>On 11/27/24 09:35, Maciej Wieczor-Retman wrote: >Sure, I'll try to find some other way. > >My previous tactic was to munmap() a high address and see if it wo

[PATCH v6 1/3] selftests/lam: Move cpu_has_la57() to use cpuinfo flag

2025-01-27 Thread Maciej Wieczor-Retman
dress space. Signed-off-by: Maciej Wieczor-Retman --- Changelog v6: - Go back to using mmap() to check la57 status. Changelog v5: - Remove "cat" from system() call and use only "grep". Changelog v4: - Add this patch to the series. tools/testing/selftests/x86/lam.c | 16 +++

[PATCH v6 2/3] selftests/lam: Skip test if LAM is disabled

2025-01-27 Thread Maciej Wieczor-Retman
aciej Wieczor-Retman --- Changelog v6: - Merge cpuid and kernel_has_lam() functions into one lam_is_available(). Changelog v4: - Add this patch to the series. tools/testing/selftests/x86/lam.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/te

[PATCH v6 0/3] selftests/lam: get_user additions and LAM enabled check

2025-01-27 Thread Maciej Wieczor-Retman
om/ [v3] https://lore.kernel.org/all/20241122085521.270802-1-maciej.wieczor-ret...@intel.com/ [v4] https://lore.kernel.org/all/cover.1732627541.git.maciej.wieczor-ret...@intel.com/ [v5] https://lore.kernel.org/all/cover.1732728879.git.maciej.wieczor-ret...@intel.com/ Maciej Wieczor-Retman (3): self

[PATCH v6 3/3] selftests/lam: Test get_user() LAM pointer handling

2025-01-27 Thread Maciej Wieczor-Retman
n its implementation. Execute the syscall with differently tagged pointers to verify that valid user pointers are passing through and invalid kernel/non-canonical pointers are not. [1] https://lore.kernel.org/all/20241024013214.129639-1-torva...@linux-foundation.org/ Signed-off-by: Maciej Wieczor-R

Re: [PATCH v5 0/3] selftests/lam: get_user additions and LAM enabled check

2025-01-15 Thread Maciej Wieczor-Retman
Hello Shuah, I'd like to bump this series for visibility and ask if you still consider these patches okay to merge? Just checked and there were no conflicts after applying it on the newest kselftest-next. On 2024-11-27 at 18:35:28 +0100, Maciej Wieczor-Retman wrote: >Recent chang

Re: [PATCH v8 0/2] selftests/resctrl: SNC kernel support discovery

2025-01-15 Thread Maciej Wieczor-Retman
On 2025-01-14 at 16:58:34 -0700, Shuah Khan wrote: >On 1/14/25 16:28, Reinette Chatre wrote: >> >> >> On 1/14/25 3:25 PM, Shuah Khan wrote: >> > >> > Thank you for bumping it up to top of my Inbox. >> > I will apply these for 6.14-rc1 now. >> > >> >> Thank you very much Shuah. >> >> Reinette