Re: [PATCH RESEND 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 13:33, SeongJae Park wrote: > Hi Jinjie, > > > Thank you for this patchset! > > On Mon, 18 Sep 2023 13:10:43 +0800 Jinjie Ruan wrote: > >> The damon_region which is allocated by kmem_cache_alloc() in >> damon_new_region() in damon_test_regions() and >> damon_test_update_monitor

Re: [PATCH RESEND 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 13:43, SeongJae Park wrote: > Hi Jinjie, > > On Mon, 18 Sep 2023 13:10:44 +0800 Jinjie Ruan wrote: > >> The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in >> damon_test_ops_registration() and damon_test_set_attrs() are not freed and >> it causes below memory leak

[PATCH v2 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Jinjie Ruan
When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_region which is allocated by kmem_cache_alloc() in damon_new_region() in damon_test_regions() and damon_test_update_monitoring_result() are not free

[PATCH v2 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread Jinjie Ruan
When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in damon_test_ops_registration() and damon_test_set_attrs() are not freed. So use damon_destr

[PATCH v2 0/2] mm/damon/core-test: Fix memory leaks in core-test

2023-09-18 Thread Jinjie Ruan
There are a few memory leak in core-test which is detected by kmemleak, the patch set fix the above issue. Changes in v2: - Add Reviewed-by. - Rebased on mm-unstable. - Replace the damon_del_region() with damon_destroy_region() rather than calling damon_free_region(). - Update the commit message

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

2023-09-18 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

[PATCH V7 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting.

2023-09-18 Thread Meng Li
amd-pstate driver utilizes the functions and data structures provided by the ITMT architecture to enable the scheduler to favor scheduling on cores which can be get a higher frequency with lower voltage. We call it amd-pstate preferrred core. Here sched_set_itmt_core_prio() is called to set priori

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

2023-09-18 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. Reviewed-by: Mario Limonciello Signed-off-by: Meng Li --- arch/x86/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 delet

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

2023-09-18 Thread Meng Li
Introduce amd-pstate preferred core. check preferred core state: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Signed-off-by: Meng Li --- Documentation/admin-guide/pm/amd-pstate.rst | 58 - 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/Documentation/admi

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

2023-09-18 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. Reviewed-by: Mario Limonciello Reviewed-by: Wyes K

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

2023-09-18 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. Signed-off-by: Meng Li Reviewed-by: Wyes Karny --- drivers/cpufreq/amd-pstate.c | 34 +++

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

2023-09-18 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. Signed-off-by: Meng Li Link: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#processor-device-n

[PATCH V7 7/7] Documentation: introduce amd-pstate preferrd core mode kernel command line options

2023-09-18 Thread Meng Li
amd-pstate driver support enable/disable preferred core. Default enabled on platforms supporting amd-pstate preferred core. Disable amd-pstate preferred core with "amd_prefcore=disable" added to the kernel command line. Signed-off-by: Meng Li Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karn

Re: [PATCH v2 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread SeongJae Park
Hi Jinjie, On Mon, 18 Sep 2023 15:47:58 +0800 Jinjie Ruan wrote: > When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y > and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. > > The damon_region which is allocated by kmem_cache_alloc() in > damon_new_region()

Re: [PATCH v2 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread SeongJae Park
Hi Jinjie, On Mon, 18 Sep 2023 15:47:59 +0800 Jinjie Ruan wrote: > When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y > and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. > > The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in > damon_test_o

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-18 Thread Luis Gerhorst
On Thu, 14 Sep 2023 12:47:16 -0700, Alexei Starovoitov wrote: > You mean since skb_shared_info is placed after skb->end > and in zero copy case destructor_arg may be initialized with the same > kernel pointer for multiple skb-s ? > The attacker cannot construct the address from data_end. > The veri

Re: [PATCH v2 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Ruan Jinjie
On 2023/9/18 19:00, SeongJae Park wrote: > Hi Jinjie, > > On Mon, 18 Sep 2023 15:47:58 +0800 Jinjie Ruan wrote: > >> When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y >> and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. >> >> The damon_region which is a

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-18 Thread Luis Gerhorst
On 15/09/2023 04:26, Yafang Shao wrote: On Wed, Sep 13, 2023 at 8:30 PM Luis Gerhorst wrote: This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. To mitigate Spectre v1, the verifier relies on static analysis to deduct constant pointer bounds, which can then be enforced by rewriting

[PATCH v3 0/2] mm/damon/core-test: Fix memory leaks in core-test

2023-09-18 Thread Jinjie Ruan
There are a few memory leak in core-test which is detected by kmemleak, the patch set fix the issue. Changes in v3: - Add new Reviewed-by. - Update the first patch's commit message to make the description more accurate. Changes in v2: - Add Reviewed-by. - Rebased on mm-unstable. - Replace the d

[PATCH v3 1/2] mm/damon/core-test: Fix memory leak in damon_new_region()

2023-09-18 Thread Jinjie Ruan
When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_region which is allocated by kmem_cache_alloc() in damon_new_region() in damon_test_regions() and damon_test_update_monitoring_result() are not free

[PATCH v3 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx()

2023-09-18 Thread Jinjie Ruan
When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in damon_test_ops_registration() and damon_test_set_attrs() are not freed. So use damon_destr

Re: [PATCH RFC v2] selftests/nolibc: don't embed initramfs into kernel image

2023-09-18 Thread Willy Tarreau
Hi Thomas, On Sun, Sep 17, 2023 at 05:21:38PM +0200, Thomas Weißschuh wrote: > When the initramfs is embedded into the kernel each rebuild of it will > trigger a full kernel relink and all the expensive postprocessing steps. > > Currently nolibc-test and therefore the initramfs are always rebuild

Re: [PATCH v2 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks

2023-09-18 Thread Willy Tarreau
Hi Thomas, On Sun, Sep 17, 2023 at 05:36:17PM +0200, Thomas Weißschuh wrote: > The ENOSYS fallback code does not use its functions parameters. > This can lead to compiler warnings about unused parameters. > > Explicitly avoid these warnings. > > Signed-off-by: Thomas Weißschuh > --- > tools/in

Re: [PATCH v6 0/7] Optimize mremap during mutual alignment within PMD

2023-09-18 Thread zhenyu zhang
With 4k guest and 64k host, on aarch64(Ampere's Altra Max CPU) hit Call trace: Steps: 1) System setup hugepages on host. # echo 50 > /proc/sys/vm/nr_hugepages 2) Mount this hugepage to /mnt/kvm_hugepage. # mount -t hugetlbfs -o pagesize=524288K none /mnt/kvm_hugepage 3

Re: [PATCH] selftests: uevent filtering: fix return on error in uevent_listener

2023-09-18 Thread Shuah Khan
On 9/16/23 10:11, Javier Carrasco wrote: Assign the error value to the real returned variable fret. The ret variable is used to check function return values and assigning values to it on error has no effect as it is an unused value. Signed-off-by: Javier Carrasco --- tools/testing/selftests/u

Re: [PATCH v2 2/3] selftests/hid: do not manually call headers_install

2023-09-18 Thread Shuah Khan
On 9/8/23 16:22, Justin Stitt wrote: From: Benjamin Tissoires "make headers" is a requirement before calling make on the selftests dir, so we should not have to manually install those headers Signed-off-by: Benjamin Tissoires Thank for making this change. Just check bpf continues to compile

Re: [PATCH V7 0/7] amd-pstate preferred core

2023-09-18 Thread Mario Limonciello
On 9/18/2023 03:14, Meng Li wrote: 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 mean

Re: [PATCH V7 0/7] amd-pstate preferred core

2023-09-18 Thread Shuah Khan
On 9/18/23 02:14, Meng Li wrote: 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

[PATCH 0/4] KVM RISC-V fixes for ONE_REG interface

2023-09-18 Thread Anup Patel
This series includes few assorted fixes for KVM RISC-V ONE_REG interface and KVM_GET_REG_LIST API. These patches can also be found in riscv_kvm_onereg_fixes_v1 branch at: https://github.com/avpatel/linux.git Anup Patel (4): RISC-V: KVM: Fix KVM_GET_REG_LIST API for ISA_EXT registers RISC-V: K

[PATCH 1/4] RISC-V: KVM: Fix KVM_GET_REG_LIST API for ISA_EXT registers

2023-09-18 Thread Anup Patel
The ISA_EXT registers to enabled/disable ISA extensions for VCPU are always available when underlying host has the corresponding ISA extension. The copy_isa_ext_reg_indices() called by the KVM_GET_REG_LIST API does not align with this expectation so let's fix it. Fixes: 031f9efafc08 ("KVM: riscv:

[PATCH 2/4] RISC-V: KVM: Fix riscv_vcpu_get_isa_ext_single() for missing extensions

2023-09-18 Thread Anup Patel
The riscv_vcpu_get_isa_ext_single() should fail with -ENOENT error when corresponding ISA extension is not available on the host. Fixes: e98b1085be79 ("RISC-V: KVM: Factor-out ONE_REG related code to its own source file") Signed-off-by: Anup Patel --- arch/riscv/kvm/vcpu_onereg.c | 5 - 1 f

[PATCH 3/4] KVM: riscv: selftests: Fix ISA_EXT register handling in get-reg-list

2023-09-18 Thread Anup Patel
Same set of ISA_EXT registers are not present on all host because ISA_EXT registers are visible to the KVM user space based on the ISA extensions available on the host. Also, disabling an ISA extension using corresponding ISA_EXT register does not affect the visibility of the ISA_EXT register itsel

[PATCH 4/4] KVM: riscv: selftests: Selectively filter-out AIA registers

2023-09-18 Thread Anup Patel
Currently the AIA ONE_REG registers are reported by get-reg-list as new registers for various vcpu_reg_list configs whenever Ssaia is available on the host because Ssaia extension can only be disabled by Smstateen extension which is not always available. To tackle this, we should filter-out AIA ON

Re: [PATCH V7 0/7] amd-pstate preferred core

2023-09-18 Thread Shuah
On 9/18/23 11:44, Shuah Khan wrote: On 9/18/23 02:14, Meng Li wrote: 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 max

Re: [PATCH v2 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks

2023-09-18 Thread Thomas Weißschuh
On 2023-09-18 18:19:15+0200, Willy Tarreau wrote: > Hi Thomas, > > On Sun, Sep 17, 2023 at 05:36:17PM +0200, Thomas Weißschuh wrote: > > The ENOSYS fallback code does not use its functions parameters. > > This can lead to compiler warnings about unused parameters. > > > > Explicitly avoid these w

kselftest/next build: 6 builds: 0 failed, 6 passed, 1 warning (v6.6-rc2)

2023-09-18 Thread kernelci.org bot
kselftest/next build: 6 builds: 0 failed, 6 passed, 1 warning (v6.6-rc2) Full Build Summary: https://kernelci.org/build/kselftest/branch/next/kernel/v6.6-rc2/ Tree: kselftest Branch: next Git Describe: v6.6-rc2 Git Commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70 Git URL: https://git.kernel.org

kselftest/fixes build: 6 builds: 0 failed, 6 passed, 1 warning (v6.6-rc2-1-g8ed99af4a266)

2023-09-18 Thread kernelci.org bot
kselftest/fixes build: 6 builds: 0 failed, 6 passed, 1 warning (v6.6-rc2-1-g8ed99af4a266) Full Build Summary: https://kernelci.org/build/kselftest/branch/fixes/kernel/v6.6-rc2-1-g8ed99af4a266/ Tree: kselftest Branch: fixes Git Describe: v6.6-rc2-1-g8ed99af4a266 Git Commit: 8ed99af4a266a3492d773

kselftest/next kselftest-seccomp: 1 runs, 1 regressions (v6.6-rc2)

2023-09-18 Thread kernelci.org bot
kselftest/next kselftest-seccomp: 1 runs, 1 regressions (v6.6-rc2) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions +---+---+--+--+--

RE: [PATCH V7 0/7] amd-pstate preferred core

2023-09-18 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Mario: > -Original Message- > From: Limonciello, Mario > Sent: Tuesday, September 19, 2023 1:41 AM > To: Meng, Li (Jassmine) ; Rafael J . Wysocki > ; Huang, Ray > Cc: linux...@vger.kernel.org; linux-ker...@vger.kernel.org; > x...@kernel.org; linux-a.

[PATCH] iommufd/selftest: Iterate idev_ids in mock_domain's alloc_hwpt test

2023-09-18 Thread Nicolin Chen
The point in iterating variant->mock_domains is to test the idev_ids[0] and idev_ids[1]. So use it instead of keeping testing idev_ids[0] only. Signed-off-by: Nicolin Chen --- Jason/Kevin, I formated the patch with "-U4" so it shows the "for" line. I didn't send it as a bug fix since it doesn't f

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-18 Thread Yafang Shao
On Mon, Sep 18, 2023 at 7:52 PM Luis Gerhorst wrote: > > On 15/09/2023 04:26, Yafang Shao wrote: > > On Wed, Sep 13, 2023 at 8:30 PM Luis Gerhorst wrote: > >> > >> This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. > >> > >> To mitigate Spectre v1, the verifier relies on static analysi

[PATCH 0/7] KVM RISC-V Conditional Operations

2023-09-18 Thread Anup Patel
This series extends KVM RISC-V to allow Guest/VM discover and use conditional operations related ISA extensions (namely XVentanaCondOps and Zicond). To try these patches, use KVMTOOL from riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches are bas

[PATCH 1/7] RISC-V: Detect XVentanaCondOps from ISA string

2023-09-18 Thread Anup Patel
The Veyron-V1 CPU supports custom conditional arithmetic and conditional-select/move operations referred to as XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating XVentanaCondOps extension. Let us detect XVentanaCondOps extension from ISA string available through DT or A

[PATCH 2/7] RISC-V: Detect Zicond from ISA string

2023-09-18 Thread Anup Patel
The RISC-V integer conditional (Zicond) operation extension defines standard conditional arithmetic and conditional-select/move operations which are inspired from the XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating Zicond extension. Let us detect Zicond extension fro

[PATCH 3/7] RISC-V: KVM: Allow XVentanaCondOps extension for Guest/VM

2023-09-18 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable XVentanaCondOps 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/a

[PATCH 4/7] RISC-V: KVM: Allow Zicond extension for Guest/VM

2023-09-18 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zicond 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

[PATCH 5/7] KVM: riscv: selftests: Add senvcfg register to get-reg-list test

2023-09-18 Thread Anup Patel
We have a new senvcfg register in the general CSR ONE_REG interface so let us add it to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/too

[PATCH 6/7] KVM: riscv: selftests: Add smstateen registers to get-reg-list test

2023-09-18 Thread Anup Patel
We have a new smstateen registers as separate sub-type of CSR ONE_REG interface so let us add these registers to get-reg-list test. Signed-off-by: Anup Patel --- .../selftests/kvm/riscv/get-reg-list.c| 34 +++ 1 file changed, 34 insertions(+) diff --git a/tools/testing/s

[PATCH 7/7] KVM: riscv: selftests: Add condops extensions to get-reg-list test

2023-09-18 Thread Anup Patel
We have a new conditional operations related ISA extensions 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 | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c

Re: [PATCH 2/3] Revert "bpf: Fix issue in verifying allow_ptr_leaks"

2023-09-18 Thread Daniel Borkmann
On 9/19/23 5:43 AM, Yafang Shao wrote: On Mon, Sep 18, 2023 at 7:52 PM Luis Gerhorst wrote: On 15/09/2023 04:26, Yafang Shao wrote: On Wed, Sep 13, 2023 at 8:30 PM Luis Gerhorst wrote: This reverts commit d75e30dddf73449bc2d10bb8e2f1a2c446bc67a2. To mitigate Spectre v1, the verifier relies