[PATCH v2 5/5] KVM: selftests: aarch64: Add invalid filter test in pmu_event_filter_test

2023-11-28 Thread Shaoqin Huang
Add the invalid filter test to double check if the KVM_ARM_VCPU_PMU_V3_FILTER will return the expected error. Signed-off-by: Shaoqin Huang --- .../kvm/aarch64/pmu_event_filter_test.c | 36 +++ 1 file changed, 36 insertions(+) diff --git a/tools/testing/selftests/kvm/aarch6

[PATCH v2 4/5] KVM: selftests: aarch64: Introduce pmu_event_filter_test

2023-11-28 Thread Shaoqin Huang
Introduce pmu_event_filter_test for arm64 platforms. The test configures PMUv3 for a vCPU, and sets different pmu event filters for the vCPU, and check if the guest can use those events which user allow and can't use those events which use deny. This test refactor the create_vpmu_vm() and make it

[PATCH v2 2/5] KVM: selftests: aarch64: Move pmu helper functions into vpmu.h

2023-11-28 Thread Shaoqin Huang
Move those pmu helper functions into include/aarch64/vpmu.h, thus it can be used by other pmu test. No functional change intended. Reviewed-by: Eric Auger Signed-off-by: Shaoqin Huang --- .../kvm/aarch64/vpmu_counter_access.c | 118 - .../selftests/kvm/include/aarch64/v

[PATCH v2 0/5] KVM: selftests: aarch64: Introduce pmu_event_filter_test

2023-11-28 Thread Shaoqin Huang
The test is inspired by the pmu_event_filter_test which implemented by x86. On the arm64 platform, there is the same ability to set the pmu_event_filter through the KVM_ARM_VCPU_PMU_V3_FILTER attribute. So add the test for arm64. The series first move some pmu common code from vpmu_counter_access

[PATCH V11 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core

2023-11-28 Thread Meng Li
Introduce amd-pstate preferred core. check preferred core state set by the kernel parameter: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Tested-by: Oleksandr Natalenko Reviewed-by: Wyes Karny Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Signed-off-by: Meng Li --- Documentatio

[PATCH V11 5/7] cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically

2023-11-28 Thread Meng Li
Preferred core rankings can be changed dynamically by the platform based on the workload and platform conditions and accounting for thermals and aging. When this occurs, cpu priority need to be set. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Reviewed-b

[PATCH V11 2/7] acpi: cppc: Add get the highest performance cppc control

2023-11-28 Thread Meng Li
Add support for getting the highest performance to the generic CPPC driver. This enables downstream drivers such as amd-pstate to discover and use these values. Please refer to the ACPI_Spec for details on continuous performance control of CPPC. Tested-by: Oleksandr Natalenko Reviewed-by: Mario

[PATCH V11 4/7] cpufreq: Add a notification message that the highest perf has changed

2023-11-28 Thread Meng Li
ACPI 6.5 section 8.4.6.1.1.1 specifies that Notify event 0x85 can be emmitted to cause the the OSPM to re-evaluate the highest performance register. Add support for this event. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Signed-off-by: Meng Li Link: ht

[PATCH V11 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion.

2023-11-28 Thread Meng Li
amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement of CPU_SUP_INTEL from the dependencies to allow compilation in kernels without Intel CPU support. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Signed-off-by: Meng Li --- arch/x86/Kco

[PATCH V11 0/7] amd-pstate preferred core

2023-11-28 Thread Meng Li
Hi all: The core frequency is subjected to the process variation in semiconductors. Not all cores are able to reach the maximum frequency respecting the infrastructure limits. Consequently, AMD has redefined the concept of maximum frequency of a part. This means that a fraction of cores can reach

Re: [PATCH bpf-next v5 0/3] selftests/bpf: Use pkg-config to determine ld flags

2023-11-28 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko : On Sat, 25 Nov 2023 17:42:49 +0900 you wrote: > When linking statically, libraries may require other dependencies to be > included to ld flags. In particular, libelf may require libzstd. Use > pkg-config to determine

Re: [PATCH v1 2/3] KVM: selftests: aarch64: Move the pmu helper function into lib/

2023-11-28 Thread Shaoqin Huang
Hi Marc, On 11/28/23 16:43, Marc Zyngier wrote: On 2023-11-27 21:48, Raghavendra Rao Ananta wrote: Hi Shaoqin, On Wed, Nov 22, 2023 at 10:39 PM Shaoqin Huang wrote: Move those pmu helper function into lib/, thus it can be used by other pmu test. Signed-off-by: Shaoqin Huang ---  .../kvm/

Re: [PATCH v1 2/3] KVM: selftests: aarch64: Move the pmu helper function into lib/

2023-11-28 Thread Shaoqin Huang
Hi Raghavendra, On 11/28/23 05:48, Raghavendra Rao Ananta wrote: Hi Shaoqin, On Wed, Nov 22, 2023 at 10:39 PM Shaoqin Huang wrote: Move those pmu helper function into lib/, thus it can be used by other pmu test. Signed-off-by: Shaoqin Huang --- .../kvm/aarch64/vpmu_counter_access.c

[PATCH] selftests:proc: Resolve 'Unused Result' Warning from proc-empty-vm.c

2023-11-28 Thread angquan yu
From: angquan yu In tools/testing/selftests/proc/proc-empty->because the return value of a write call was being ignored. This call was partof a conditional debugging block (if (0) { ... }), which meant it would neveractually execute. This patch removes the unused debug write call. This cleanup r

Re: [PATCH v1 1/3] KVM: selftests: aarch64: Make the [create|destroy]_vpmu_vm() can be reused

2023-11-28 Thread Shaoqin Huang
Hi Eric, On 11/25/23 02:14, Eric Auger wrote: Hi Shaoqin, On 11/23/23 07:37, Shaoqin Huang wrote: Move the [create|destroy]_vpmu_vm() into the lib/, which makes those some wording suggestions below: Move the implementation of .. into lib/aarch64/pmu.c and export their declaration in a header

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-11-28 Thread Jason Gunthorpe
On Tue, Nov 28, 2023 at 04:51:21PM -0800, Nicolin Chen wrote: > > > I also thought about making this out_driver_error_code per HW. > > > Yet, an error can be either per array or per entry/quest. The > > > array-related error should be reported in the array structure > > > that is a core uAPI, v.s.

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-11-28 Thread Nicolin Chen
On Tue, Nov 28, 2023 at 08:03:35AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Tuesday, November 28, 2023 3:53 AM > > > > On Fri, Nov 24, 2023 at 02:36:29AM +, Tian, Kevin wrote: > > > > > > > > > > >> + * @out_driver_error_code: Report a driver speicifc error > > > > > > > > >

[PATCH] Fix Format String Warnings in lam.c

2023-11-28 Thread angquan yu
From: angquan yu This commit addresses compiler warnings in lam.c related to the usage of non-literal format strings without format arguments in the 'run_test' function. Warnings fixed: - Resolved warnings indicating that 'ksft_test_result_skip' and 'ksft_test_result' were called with 't->msg' a

Re: [PATCH v2 26/26] selftests/resctrl: Add test groups and name L3 CAT test L3_CAT

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > To select test to run -t parameter can be used. However, -t cat > currently maps to L3 CAT test which is confusing after more CAT related > tests are added. > > Allow selecting tests as groups and call L3 CAT test "L3_CAT", "CAT" > group will

Re: [PATCH v2 25/26] selftests/resctrl: Get domain id from cache id

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Domain id is acquired differently depending on CPU. AMD tests use id > from L3 cache, whereas CPUs from other vendors base the id on topology > package id. In order to support L2 CAT test, this has to be > generalized. > > The driver side cod

Re: [PATCH v2 23/26] selftests/resctrl: Add helper to convert L2/3 to integer

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > "L2"/"L3" conversion to integer is embedded into get_cache_size() > which prevents reuse. > > Create a helper for the cache string to integer conversion to make > it reusable. > > Signed-off-by: Ilpo Järvinen > --- > tools/testing/selftest

Re: [PATCH v2 22/26] selftests/resctrl: Pass write_schemata() resource instead of test name

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > write_schemata() takes the test name as an argument and determines the > relevant resource based on the test name. Such mapping from name to > resource does not really belong to resctrlfs.c that should provide > only generic, test-independent

Re: [PATCH v2 21/26] selftests/resctrl: Introduce generalized test framework

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... > + > +static bool cmt_feature_check(const struct resctrl_test *test) > +{ > + return validate_resctrl_feature_request("L3_MON", "llc_occupancy") && > +validate_resctrl_feature_request("L3", NULL); > +} > + ... > + > +stati

Re: [PATCH v2 20/26] selftests/resctrl: Create struct for input parameters

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... > > +static void init_user_params(struct user_params *uparams) > +{ > + uparams->cpu = 1; > + uparams->bits = 0; > +} > + > int main(int argc, char **argv) > { > bool mbm_test = true, mba_test = true, cmt_test = true; > -

Re: [PATCH v2 19/26] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > CAT test spawns two processes into two different control groups with > exclusive schemata. Both the processes alloc a buffer from memory > matching their allocated LLC block size and flush the entire buffer out > of caches. Since the processes

Re: [PATCH v2 18/26] selftests/resctrl: Read in less obvious order to defeat prefetch optimizations

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > When reading memory in order, HW prefetching optimizations will > interfere with measuring how caches and memory are being accessed. This > adds noise into the results. > > Change the fill_buf reading loop to not use an obvious in-order acces

Re: [PATCH v2 17/26] selftests/resctrl: Replace file write with volatile variable

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > The fill_buf code prevents compiler optimizating the entire read loop > away by writing the final value of the variable into a file. While it > achieves the goal, writing into a file requires significant amount of > work within the innermost t

Re: [PATCH v2 16/26] selftests/resctrl: Open perf fd before start & add error handling

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Perf fd (pe_fd) is opened, reset, and enabled during every test the CAT > selftest runs. Also, ioctl(pe_fd, ...) calls are not error checked even > if ioctl() could return an error. > > Open perf fd only once before the tests and only reset a

Re: [PATCH v2 15/26] selftests/resctrl: Move cat_val() to cat_test.c and rename to cat_test()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > The main CAT test function is called cat_val() and resides in cache.c > which is illogical. > > Rename the function to cat_test() and move it into cat_test.c. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Chatre Reinette

Re: [PATCH v2 14/26] selftests/resctrl: Convert perf related globals to locals

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Perf related variables pea_llc_miss, pe_read, and pe_fd are globals in > cache.c. > > Convert them to locals for better scoping and make pea_llc_miss simpler > by renaming it to pea. Make close(pe_fd) handling easier to understand > by doing

Re: [PATCH v2 10/26] selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Perf counters are __u64 but the code converts them to unsigned long > before printing them out. > > Remove unnecessary type conversion and retain the value as __u64 whole > the time. "whole the time" -> "the whole time" Even so, this does n

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > measure_cache_vals() does a different thing depending on the test case > that called it: > - For CAT, it measures LLC misses through perf. > - For CMT, it measures LLC occupancy through resctrl. > > Split these two functionalities into ow

[PATCH] Resolve Macro Expansion Warning in nx_huge_pages_test.c

2023-11-28 Thread angquan yu
From: angquan yu This commit fixes a compiler warning in the file x86_64/nx_huge_pages_test.c, which was caused by improper macro expansion of '__TEST_REQUIRE'. Warning addressed: - The warning was triggered by the expansion of the '__TEST_REQUIRE' macro, indicating a potential issue in how the

Re: [PATCH v2 04/26] selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > Callers of get_cbm_mask() are required to pass a string into which the > capacity bitmask (CBM) is read. Neither CAT nor CMT tests need the > bitmask as string but just convert it into an unsigned long value. > > Another limitation is that th

Re: [PATCH v2 03/26] selftests/resctrl: Refactor fill_buf functions

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > There are unnecessary nested calls in fill_buf.c: > - run_fill_buf() calls fill_cache() > - alloc_buffer() calls malloc_and_init_memory() > > Simplify the code flow and remove those unnecessary call levels by > moving the called code insi

Re: [PATCH v2 02/26] selftests/resctrl: Split fill_buf to allow tests finer-grained control

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > MBM, MBA and CMT test cases call run_fill_buf() that in turn calls > fill_cache() to alloc and loop indefinitely around the buffer. This > binds buffer allocation and running the benchmark into a single bundle > so that a selftest cannot alloc

Re: [PATCH v2 01/26] selftests/resctrl: Don't use ctrlc_handler() outside signal handling

2023-11-28 Thread Reinette Chatre
Hi Ilpo, On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > perf_event_open_llc_miss() calls ctrlc_handler() to cleanup if > perf_event_open() returns an error. Those cleanups, however, are not > the responsability of perf_event_open_llc_miss() and it thus interferes responsibility > unnecessarily wi

[PATCH] selftests/breakpoints: Fix format specifier in ksft_print_msg in step_after_suspend_test.c

2023-11-28 Thread angquan yu
From: angquan yu In the function 'tools/testing/selftests/breakpoints/run_test' within step_after_suspend_test.c, the ksft_print_msg function call incorrectly used '$s' as a format specifier. This commit corrects this typo to use the proper '%s' format specifier, ensuring the error message from w

[PATCH] Fix Format String Warning in breakpoint_test

2023-11-28 Thread angquan yu
From: angquan yu This commit resolves a compiler warning regardingthe use of non-literal format strings in breakpoint_test.c. The functions `ksft_test_result_pass` and `ksft_test_result_fail` were previously called with a variable `msg` directly, which could potentially lead to format string vul

Re: [PATCH RFT v4 2/5] fork: Add shadow stack support to clone3()

2023-11-28 Thread Deepak Gupta
On Tue, Nov 28, 2023 at 06:22:40PM +, Mark Brown wrote: Unlike with the normal stack there is no API for configuring the the shadow stack for a new thread, instead the kernel will dynamically allocate a new shadow stack with the same size as the normal stack. This appears to be due to the sha

[PATCH AUTOSEL 6.1 14/25] selftests/bpf: fix bpf_loop_bench for new callback verification scheme

2023-11-28 Thread Sasha Levin
From: Eduard Zingerman [ Upstream commit f40bfd1679446b22d321e64a1fa98b7d07d2be08 ] This is a preparatory change. A follow-up patch "bpf: verify callbacks as if they are called unknown number of times" changes logic for callbacks handling. While previously callbacks were verified as a single fun

[PATCH AUTOSEL 6.6 17/40] selftests/bpf: fix bpf_loop_bench for new callback verification scheme

2023-11-28 Thread Sasha Levin
From: Eduard Zingerman [ Upstream commit f40bfd1679446b22d321e64a1fa98b7d07d2be08 ] This is a preparatory change. A follow-up patch "bpf: verify callbacks as if they are called unknown number of times" changes logic for callbacks handling. While previously callbacks were verified as a single fun

Re: [RFC PATCH v2 2/2] kselftest: devices: Add sample board file for google,spherion

2023-11-28 Thread Nícolas F . R . A . Prado
On Tue, Nov 28, 2023 at 06:33:52PM +, Bird, Tim wrote: > > > > -Original Message- > > From: Christopher Obbard > > Hi Nícolas, > > > > On Mon, 2023-11-27 at 18:34 -0500, Nícolas F. R. A. Prado wrote: > > > Add a sample board file describing the file's format and with the list > > >

[PATCH] Fix Format String Warning in breakpoint_test

2023-11-28 Thread angquan yu
From: angquan yu This commit resolves a compiler warning regardingthe use of non-literal format strings in breakpoint_test.c. The functions `ksft_test_result_pass` and `ksft_test_result_fail` were previously called with a variable `msg` directly, which could potentially lead to format string vul

Re: [RFC PATCH v2 2/2] kselftest: devices: Add sample board file for google,spherion

2023-11-28 Thread Nícolas F . R . A . Prado
On Tue, Nov 28, 2023 at 05:54:57PM +, Bird, Tim wrote: > > -Original Message- > > From: Nícolas F. R. A. Prado > > On Tue, Nov 28, 2023 at 12:10:46AM +, Bird, Tim wrote: > > > > -Original Message- > > > > From: Nícolas F. R. A. Prado > > > > Add a sample board file describ

Re: [PATCH v2] kunit: run test suites only after module initialization completes

2023-11-28 Thread Marco Pagani
On 28/11/23 12:15, Javier Martinez Canillas wrote: > Marco Pagani writes: > > Hello Marco, > > [...] > >> @@ -737,12 +738,14 @@ static void kunit_module_exit(struct module *mod) >> }; >> const char *action = kunit_action(); >> >> +if (!suite_set.start || !virt_addr_valid(suit

[PATCH RFT v4 5/5] kselftest/clone3: Test shadow stack support

2023-11-28 Thread Mark Brown
Add basic test coverage for specifying the shadow stack for a newly created thread via clone3(), including coverage of the newly extended argument structure. In order to facilitate testing on systems without userspace shadow stack support we manually enable shadow stacks on startup, this is archit

[PATCH RFT v4 4/5] selftests/clone3: Allow tests to flag if -E2BIG is a valid error code

2023-11-28 Thread Mark Brown
The clone_args structure is extensible, with the syscall passing in the length of the structure. Inside the kernel we use copy_struct_from_user() to read the struct but this has the unfortunate side effect of silently accepting some overrun in the structure size providing the extra data is all zero

[PATCH RFT v4 1/5] mm: Introduce ARCH_HAS_USER_SHADOW_STACK

2023-11-28 Thread Mark Brown
Since multiple architectures have support for shadow stacks and we need to select support for this feature in several places in the generic code provide a generic config option that the architectures can select. Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Signed-off-by: Mark Brow

[PATCH RFT v4 2/5] fork: Add shadow stack support to clone3()

2023-11-28 Thread Mark Brown
Unlike with the normal stack there is no API for configuring the the shadow stack for a new thread, instead the kernel will dynamically allocate a new shadow stack with the same size as the normal stack. This appears to be due to the shadow stack series having been in development since before the m

[PATCH RFT v4 0/5] fork: Support shadow stacks in clone3()

2023-11-28 Thread Mark Brown
The kernel has recently added support for shadow stacks, currently x86 only using their CET feature but both arm64 and RISC-V have equivalent features (GCS and Zicfiss respectively), I am actively working on GCS[1]. With shadow stacks the hardware maintains an additional stack containing only the

Re: [RFC PATCH v2 2/2] kselftest: devices: Add sample board file for google,spherion

2023-11-28 Thread Christopher Obbard
Hi Nícolas, On Mon, 2023-11-27 at 18:34 -0500, Nícolas F. R. A. Prado wrote: > Add a sample board file describing the file's format and with the list > of devices expected to be probed on the google,spherion machine as an > example. Did you consider using some machine-readable & extensible format

[PATCH ipsec-next v2 6/6] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-11-28 Thread Daniel Xu
This commit extends test_tunnel selftest to test the new XDP xfrm state lookup kfunc. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_tests/test_tunnel.c| 20 ++-- .../selftests/bpf/progs/test_tunnel_kern.c| 51 +++

[PATCH ipsec-next v2 5/6] bpf: selftests: Move xfrm tunnel test to test_progs

2023-11-28 Thread Daniel Xu
test_progs is better than a shell script b/c C is a bit easier to maintain than shell. Also it's easier to use new infra like memory mapped global variables from C via bpf skeleton. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_

[PATCH ipsec-next v2 4/6] bpf: selftests: test_tunnel: Use vmlinux.h declarations

2023-11-28 Thread Daniel Xu
vmlinux.h declarations are more ergnomic, especially when working with kfuncs. The uapi headers are often incomplete for kfunc definitions. This commit also switches bitfield accesses to use CO-RE helpers. Switching to vmlinux.h definitions makes the verifier very unhappy with raw bitfield accesse

[PATCH ipsec-next v2 0/6] Add bpf_xdp_get_xfrm_state() kfunc

2023-11-28 Thread Daniel Xu
This patchset adds two kfunc helpers, bpf_xdp_get_xfrm_state() and bpf_xdp_xfrm_state_release() that wrap xfrm_state_lookup() and xfrm_state_put(). The intent is to support software RSS (via XDP) for the ongoing/upcoming ipsec pcpu work [0]. Recent experiments performed on (hopefully) reproducible

Re: [PATCH v6 2/6] memcontrol: allows mem_cgroup_iter() to check for onlineness

2023-11-28 Thread Nhat Pham
On Tue, Nov 28, 2023 at 8:53 AM Nhat Pham wrote: > > On Tue, Nov 28, 2023 at 1:38 AM Michal Hocko wrote: > > > > On Mon 27-11-23 11:36:59, Nhat Pham wrote: > > > The new zswap writeback scheme requires an online-only memcg hierarchy > > > traversal. Add a new parameter to mem_cgroup_iter() to che

Re: [PATCH v6 2/6] memcontrol: allows mem_cgroup_iter() to check for onlineness

2023-11-28 Thread Nhat Pham
On Tue, Nov 28, 2023 at 1:38 AM Michal Hocko wrote: > > On Mon 27-11-23 11:36:59, Nhat Pham wrote: > > The new zswap writeback scheme requires an online-only memcg hierarchy > > traversal. Add a new parameter to mem_cgroup_iter() to check for > > onlineness before returning. > > Why is this needed

Re: [PATCH] cgroup/cpuset: Expose cpuset.cpus.isolated

2023-11-28 Thread Tejun Heo
Hello, On Mon, Nov 27, 2023 at 02:51:05PM -0500, Waiman Long wrote: > The root-only cpuset.cpus.isolated control file shows the current set > of isolated CPUs in isolated partitions. This control file is currently > exposed only with the cgroup_debug boot command line option which also > adds the

Re: [PATCH ipsec-next v1 6/7] bpf: selftests: test_tunnel: Disable CO-RE relocations

2023-11-28 Thread Eduard Zingerman
On Tue, 2023-11-28 at 10:13 -0600, Daniel Xu wrote: [...] > > One thing for sure is memory layout of bitfields should be the same > > for both clang and gcc as it is determined by C standard. Register > > representation and how to manipulate could be different for different > > compilers. > > I wa

Re: [PATCH ipsec-next v1 6/7] bpf: selftests: test_tunnel: Disable CO-RE relocations

2023-11-28 Thread Daniel Xu
On Tue, Nov 28, 2023 at 10:13:50AM -0600, Daniel Xu wrote: > On Mon, Nov 27, 2023 at 08:06:01PM -0800, Yonghong Song wrote: > > > > On 11/27/23 7:01 PM, Daniel Xu wrote: > > > On Mon, Nov 27, 2023 at 02:45:11PM -0600, Daniel Xu wrote: > > > > On Sun, Nov 26, 2023 at 09:53:04PM -0800, Yonghong Song

Re: [PATCH ipsec-next v1 6/7] bpf: selftests: test_tunnel: Disable CO-RE relocations

2023-11-28 Thread Daniel Xu
On Mon, Nov 27, 2023 at 08:06:01PM -0800, Yonghong Song wrote: > > On 11/27/23 7:01 PM, Daniel Xu wrote: > > On Mon, Nov 27, 2023 at 02:45:11PM -0600, Daniel Xu wrote: > > > On Sun, Nov 26, 2023 at 09:53:04PM -0800, Yonghong Song wrote: > > > > On 11/27/23 12:44 AM, Yonghong Song wrote: > > > > >

Re: [PATCH ipsec-next v1 6/7] bpf: selftests: test_tunnel: Disable CO-RE relocations

2023-11-28 Thread Andrii Nakryiko
On Mon, Nov 27, 2023 at 8:06 PM Yonghong Song wrote: > > > On 11/27/23 7:01 PM, Daniel Xu wrote: > > On Mon, Nov 27, 2023 at 02:45:11PM -0600, Daniel Xu wrote: > >> On Sun, Nov 26, 2023 at 09:53:04PM -0800, Yonghong Song wrote: > >>> On 11/27/23 12:44 AM, Yonghong Song wrote: > On 11/26/23 8:

Re: [RFC] drm/tests: annotate intentional stack trace in drm_test_rect_calc_hscale()

2023-11-28 Thread Maxime Ripard
Hi Dan, On Wed, Nov 15, 2023 at 05:42:17PM -0500, Dan Carpenter wrote: > On Mon, Nov 06, 2023 at 02:58:12PM +0100, mrip...@kernel.org wrote: > > > But a similar thing is happening here where we have so many bogus > > > warnings that we missed a real bug. > > > > IIRC, there was a similar discussi

[PATCH 13/15] KVM: riscv: selftests: Add Zvfh[min] extensions to get-reg-list test

2023-11-28 Thread Anup Patel
The KVM RISC-V allows Zvfh[min] extensions for Guest/VM so let us add these extensions to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c

[PATCH 12/15] RISC-V: KVM: Allow Zvfh[min] extensions for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zvfh[min] extensions for Guest/VM. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 2 ++ arch/riscv/kvm/vcpu_onereg.c | 4 2 files changed, 6 insertions(+) diff --git a/arc

[PATCH 11/15] KVM: riscv: selftests: Add Zihintntl extension to get-reg-list test

2023-11-28 Thread Anup Patel
The KVM RISC-V allows Zihintntl extension for Guest/VM so let us add this extension to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/too

[PATCH 10/15] RISC-V: KVM: Allow Zihintntl extension for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zihintntl extension for Guest/VM. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/ri

[PATCH 08/15] RISC-V: KVM: Allow Zfh[min] extensions for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zfh[min] extensions for Guest/VM. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 2 ++ arch/riscv/kvm/vcpu_onereg.c | 4 2 files changed, 6 insertions(+) diff --git a/arch

[PATCH 09/15] KVM: riscv: selftests: Add Zfh[min] extensions to get-reg-list test

2023-11-28 Thread Anup Patel
The KVM RISC-V allows Zfh[min] extensions for Guest/VM so let us add these extensions to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c

[PATCH 07/15] KVM: riscv: selftests: Add vector crypto extensions to get-reg-list test

2023-11-28 Thread Anup Patel
The KVM RISC-V allows vector crypto extensions for Guest/VM so let us add these extensions to get-reg-list test. This includes extensions Zvbb, Zvbc, Zvkb, Zvkg, Zvkned, Zvknha, Zvknhb, Zvksed, Zvksh, and Zvkt. Signed-off-by: Anup Patel --- .../selftests/kvm/riscv/get-reg-list.c| 40

[PATCH 06/15] RISC-V: KVM: Allow vector crypto extensions for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable vector crypto extensions for Guest/VM. This includes extensions Zvbb, Zvbc, Zvkb, Zvkg, Zvkned, Zvknha, Zvknhb, Zvksed, Zvksh, and Zvkt. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h

[PATCH 04/15] RISC-V: KVM: Allow scalar crypto extensions for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable scalar crypto extensions for Guest/VM. This includes extensions Zbkb, Zbkc, Zbkx, Zknd, Zkne, Zknh, Zkr, Zksed, Zksh, and Zkt. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 10 +

[PATCH 03/15] KVM: riscv: selftests: Add Zbc extension to get-reg-list test

2023-11-28 Thread Anup Patel
The KVM RISC-V allows Zbc extension for Guest/VM so let us add this extension to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/tes

[PATCH 02/15] RISC-V: KVM: Allow Zbc extension for Guest/VM

2023-11-28 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zbc extension for Guest/VM. Signed-off-by: Anup Patel --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/riscv/in

[PATCH 01/15] KVM: riscv: selftests: Generate ISA extension reg_list using macros

2023-11-28 Thread Anup Patel
Various ISA extension reg_list have common pattern so let us generate these using macros. We define two macros for the above purpose: 1) KVM_ISA_EXT_SIMPLE_CONFIG - Macro to generate reg_list for ISA extension without any additional ONE_REG registers 2) KVM_ISA_EXT_SUBLIST_CONFIG - Macro to gen

Re: [PATCH v2 3/3] drm/vc4: tests: Use KUNIT_DEFINE_ACTION_WRAPPER

2023-11-28 Thread Maxime Ripard
On Tue, 28 Nov 2023 15:24:07 +0800, David Gow wrote: > In order to pass functions to kunit_add_action(), they need to be of the > kunit_action_t type. While casting the function pointer can work, it > will break control-flow integrity. > > vc4_mock already defines such a wrapper for drm_dev_unregi

Re: [RFC PATCH v2 2/2] kselftest: devices: Add sample board file for google,spherion

2023-11-28 Thread Nícolas F . R . A . Prado
On Tue, Nov 28, 2023 at 12:10:46AM +, Bird, Tim wrote: > > -Original Message- > > From: Nícolas F. R. A. Prado > > Add a sample board file describing the file's format and with the list > > of devices expected to be probed on the google,spherion machine as an > > example. > > > > Sign

Re: [RFC PATCH v2 2/2] kselftest: devices: Add sample board file for google,spherion

2023-11-28 Thread Mark Brown
On Tue, Nov 28, 2023 at 12:10:46AM +, Bird, Tim wrote: > I'm not a big fan of naming these with a comma in the name. Is there a reason > you are not using dash or underscore? That's a common patter with this sort of software (eg, bootrr does the same). It's convenient to just be able to use

Re: [PATCH v2] kunit: run test suites only after module initialization completes

2023-11-28 Thread Javier Martinez Canillas
Marco Pagani writes: Hello Marco, [...] > @@ -737,12 +738,14 @@ static void kunit_module_exit(struct module *mod) > }; > const char *action = kunit_action(); > > + if (!suite_set.start || !virt_addr_valid(suite_set.start)) > + return; > + I would add a comment her

[PATCH v2] kunit: run test suites only after module initialization completes

2023-11-28 Thread Marco Pagani
Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in kunit_free_suite_set()") fixed a wild-memory-access bug that could have happened during the loading phase of test suites built and executed as loadable modules. However, it also introduced a problematic side effect that causes test suites m

RE: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-11-28 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Tuesday, November 28, 2023 3:53 AM > > On Fri, Nov 24, 2023 at 02:36:29AM +, Tian, Kevin wrote: > > > > > > > > >> + * @out_driver_error_code: Report a driver speicifc error code > > > upon > > > > > > > failure. > > > > > > > >> + * It's