Re: [kvm-unit-tests PATCH v2 02/18] Document environment variables

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:00PM +, Alexandru Elisei wrote: > Document the environment variables that influence how a test is executed > by the run_tests.sh test runner. > > Suggested-by: Andrew Jones > Signed-off-by: Alexandru Elisei > --- > docs/unittests.txt | 5 - > run_tests.sh

Re: [kvm-unit-tests PATCH v2 01/18] run_tests: Document --probe-maxsmp argument

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:42:59PM +, Alexandru Elisei wrote: > Commit 5dd20ec76ea63 ("runtime: Update MAX_SMP probe") added the > --probe-maxmp argument, but the help message for run_tests.sh wasn't > updated. Document --probe-maxsmp. > > Signed-off-by: Alexandru Elisei > --- > run_tests.sh

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-21 Thread Madhavan Srinivasan
On 1/20/25 10:42 PM, Dmitry V. Levin wrote: > On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote: >> Le 14/01/2025 à 18:04, Dmitry V. Levin a écrit : >>> On Mon, Jan 13, 2025 at 06:34:44PM +0100, Christophe Leroy wrote: Le 13/01/2025 à 18:10, Dmitry V. Levin a écrit : > Br

[PATCH V3 1/2] arch/powerpc/perf: Check the instruction type before creating sample with perf_mem_data_src

2025-01-21 Thread Athira Rajeev
perf mem report aborts as below sometimes (during some corner case) in powerpc: # ./perf mem report 1>out *** stack smashing detected ***: terminated Aborted (core dumped) The backtrace is as below: __pthread_kill_implementation () raise () abort () __libc_message __fortif

[PATCH V3 2/2] arch/powerpc/perf: Update get_mem_data_src function to use saved values of sier and mmcra regs

2025-01-21 Thread Athira Rajeev
During performance monitor interrupt handling, the regs are setup using perf_read_regs function. Here some of the pt_regs fields is overloaded. Samples Instruction Event Register (SIER) is loaded into pt_regs, overloading regs->dar. And regs->dsisr to store MMCRA (Monitor Mode Control Register A) s

Re: [PATCH v2] selftests: livepatch: handle PRINTK_CALLER in check_result()

2025-01-21 Thread Madhavan Srinivasan
On 1/20/25 9:36 PM, Petr Mladek wrote: > On Sun 2025-01-19 22:02:38, Madhavan Srinivasan wrote: >> Some arch configs (like ppc64) enable CONFIG_PRINTK_CALLER, >> which adds the caller id as part of the dmesg. With recent >> util-linux's update 467a5b3192f16 ('dmesg: add caller_id support') >> th

Re: [PATCH v2] treewide: const qualify ctl_tables where applicable

2025-01-21 Thread Alexander Gordeev
On Fri, Jan 10, 2025 at 03:16:08PM +0100, Joel Granados wrote: Hi Joel, > Add the const qualifier to all the ctl_tables in the tree except for > watchdog_hardlockup_sysctl, memory_allocation_profiling_sysctls, > loadpin_sysctl_table and the ones calling register_net_sysctl (./net, > drivers/inifi

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-21 Thread Christophe Leroy
Le 21/01/2025 à 12:13, Madhavan Srinivasan a écrit : On 1/20/25 10:42 PM, Dmitry V. Levin wrote: On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote: Le 14/01/2025 à 18:04, Dmitry V. Levin a écrit : On Mon, Jan 13, 2025 at 06:34:44PM +0100, Christophe Leroy wrote: Le 13/01/2

[PATCH v2 1/6] kexec: Initialize ELF lowest address to ULONG_MAX

2025-01-21 Thread Sourabh Jain
kexec_elf_load() loads an ELF executable and sets the address of the lowest PT_LOAD section to the address held by the lowest_load_addr function argument. To determine the lowest PT_LOAD address, a local variable lowest_addr (type unsigned long) is initialized to UINT_MAX. After loading each PT_LO

[PATCH v2 0/6] powerpc/crash: use generic crashkernel reservation

2025-01-21 Thread Sourabh Jain
Commit 0ab97169aa05 ("crash_core: add generic function to do reservation") added a generic function to reserve crashkernel memory. So let's use the same function on powerpc and remove the architecture-specific code that essentially does the same thing. The generic crashkernel reservation also prov

[PATCH v2 2/6] crash: remove an unused argument from reserve_crashkernel_generic()

2025-01-21 Thread Sourabh Jain
cmdline argument is not used in reserve_crashkernel_generic() so remove it. Correspondingly, all the callers have been updated as well. No functional change intended. Cc: Andrew Morton Cc: Hari Bathini Cc: Madhavan Srinivasan Cc: Mahesh Salgaonkar Cc: Michael Ellerman Cc: ke...@lists.infrade

[PATCH v2 4/6] powerpc/kdump: preserve user-specified memory limit

2025-01-21 Thread Sourabh Jain
Commit 59d58189f3d9 ("crash: fix crash memory reserve exceed system memory bug") fails crashkernel parsing if the crash size is found to be higher than system RAM, which makes the memory_limit adjustment code ineffective due to an early exit from reserve_crashkernel(). Regardless lets not violated

[PATCH v2 6/6] crash: option to let arch decide mem range is usable

2025-01-21 Thread Sourabh Jain
On PowerPC, the memory reserved for the crashkernel can contain components like RTAS, TCE, OPAL, etc., which should be avoided when loading kexec segments into crashkernel memory. Due to these special components, PowerPC has its own set of functions to locate holes in the crashkernel memory for loa

[PATCH v2 5/6] powerpc/crash: use generic crashkernel reservation

2025-01-21 Thread Sourabh Jain
Commit 0ab97169aa05 ("crash_core: add generic function to do reservation") added a generic function to reserve crashkernel memory. So let's use the same function on powerpc and remove the architecture-specific code that essentially does the same thing. The generic crashkernel reservation also prov

[PATCH v2 3/6] crash: let arch decide crash memory export to iomem_resource

2025-01-21 Thread Sourabh Jain
insert_crashkernel_resources() adds crash memory to iomem_resource if generic crashkernel reservation is enabled on an architecture. On PowerPC, system RAM is added to iomem_resource. See commit c40dd2f766440 ("powerpc: Add System RAM to /proc/iomem"). Enabling generic crashkernel reservation on

[PATCH] mm/hugetlb: bring gigantic page allocation under hugepages_supported()

2025-01-21 Thread Sourabh Jain
Despite having kernel arguments to enable gigantic hugepages, this provides a way for the architecture to disable gigantic hugepages on the fly, similar to what we do for hugepages. Components like fadump (PowerPC-specific) need this functionality to disable gigantic hugepages when the kernel is b

Re: [PATCH 2/4] seccomp: kill the dead code in the !CONFIG_HAVE_ARCH_SECCOMP_FILTER version of __secure_computing()

2025-01-21 Thread Oleg Nesterov
On 01/20, Kees Cook wrote: > > On Mon, Jan 20, 2025 at 02:44:52PM +0100, Oleg Nesterov wrote: > > Depending on CONFIG_HAVE_ARCH_SECCOMP_FILTER, __secure_computing(NULL) > > will crash or not, this is not consistent/safe. > > Right now this never happens because there are no callers. > > > Fortunate

Re: [kvm-unit-tests PATCH v2 03/18] scripts: Refuse to run the tests if not configured for qemu

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:01PM +, Alexandru Elisei wrote: > Arm and arm64 support running the tests under kvmtool. Unsurprisingly, > kvmtool and qemu have a different command line syntax for configuring and > running a virtual machine. > > On top of that, when kvm-unit-tests has been confi

Re: [kvm-unit-tests PATCH v2 04/18] run_tests: Introduce unittest parameter 'qemu_params'

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:02PM +, Alexandru Elisei wrote: > Tests for the arm and arm64 architectures can also be run with kvmtool, and > work is under way to have it supported by the run_tests.sh test runner. Not > suprisingly, kvmtool has a different syntax than qemu when configuring and

Re: [kvm-unit-tests PATCH v2 06/18] scripts: Merge the qemu parameter -smp into $qemu_opts

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:04PM +, Alexandru Elisei wrote: > kvmtool has a different command line parameter to specify the number of > VCPUs (-c/--cpus). To make it easier to accommodate it, merge the qemu > specific parameter -smp into $qemu_opts when passing it to the > $RUNTIME_arch_run s

Re: [kvm-unit-tests PATCH v2 03/18] scripts: Refuse to run the tests if not configured for qemu

2025-01-21 Thread Alexandru Elisei
Hi Drew, On Tue, Jan 21, 2025 at 05:17:22PM +0100, Andrew Jones wrote: > On Tue, Jan 21, 2025 at 03:54:17PM +, Alexandru Elisei wrote: > > Hi Drew, > > > > On Tue, Jan 21, 2025 at 03:48:55PM +0100, Andrew Jones wrote: > > > On Mon, Jan 20, 2025 at 04:43:01PM +, Alexandru Elisei wrote: > >

Re: [kvm-unit-tests PATCH v2 07/18] scripts: Introduce kvmtool_opts

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:05PM +, Alexandru Elisei wrote: > In preparation for supporting kvmtool, create and pass the variable > 'kvmtool_opts' to the arch run script $RUNTIME_arch_run. > > Signed-off-by: Alexandru Elisei > --- > scripts/common.bash | 6 -- > scripts/runtime.bash

Re: [kvm-unit-tests PATCH v2 11/18] arm/run: Add support for kvmtool

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:09PM +, Alexandru Elisei wrote: > Teach the arm runner to use kvmtool when kvm-unit-tests has been configured > appropriately. > > The test is ran using run_test_status() because kvmtool does not have a > testdev device to return the test exit code, so kvm-unit-te

Re: [kvm-unit-tests PATCH v2 03/18] scripts: Refuse to run the tests if not configured for qemu

2025-01-21 Thread Andrew Jones
On Tue, Jan 21, 2025 at 03:54:17PM +, Alexandru Elisei wrote: > Hi Drew, > > On Tue, Jan 21, 2025 at 03:48:55PM +0100, Andrew Jones wrote: > > On Mon, Jan 20, 2025 at 04:43:01PM +, Alexandru Elisei wrote: > > > Arm and arm64 support running the tests under kvmtool. Unsurprisingly, > > > kv

Re: [kvm-unit-tests PATCH v2 03/18] scripts: Refuse to run the tests if not configured for qemu

2025-01-21 Thread Alexandru Elisei
Hi Drew, On Tue, Jan 21, 2025 at 03:48:55PM +0100, Andrew Jones wrote: > On Mon, Jan 20, 2025 at 04:43:01PM +, Alexandru Elisei wrote: > > Arm and arm64 support running the tests under kvmtool. Unsurprisingly, > > kvmtool and qemu have a different command line syntax for configuring and > > ru

Re: [kvm-unit-tests PATCH v2 08/18] scripts/runtime: Detect kvmtool failure in premature_failure()

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:06PM +, Alexandru Elisei wrote: > kvm-unit-tests assumes that if the VMM is able to get to where it tries to > load the kernel, then the VMM and the configuration parameters will also > work for running the test. All of this is done in premature_failure(). > > Tea

Re: [kvm-unit-tests PATCH v2 09/18] scripts/runtime: Skip test when kvmtool and $accel is not KVM

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:07PM +, Alexandru Elisei wrote: > kvmtool, unlike qemu, cannot emulate a different architecture than the > host's, and as a result the only $accel parameter it can support is 'kvm'. > > Signed-off-by: Alexandru Elisei > --- > scripts/runtime.bash | 5 + > 1

Re: [kvm-unit-tests PATCH v2 05/18] scripts: Rename run_qemu_status -> run_test_status

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:03PM +, Alexandru Elisei wrote: > From: Alexandru Elisei > > For the arm/arm64 architectures, kvm-unit-tests can also be run using the > kvmtool virtual machine manager. Rename run_qemu_status to run_test_status > to make it more generic, in preparation to add su

Re: [kvm-unit-tests PATCH v2 10/18] scripts/arch-run: Add support for kvmtool

2025-01-21 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:08PM +, Alexandru Elisei wrote: > Add two new functions, search_kvmtool_binary(), which, like the name > suggests, searches for the location of the kvmtool binary, and > run_kvmtool(), which runs a test with kvmtool as the VMM. > > initrd_create() has also been mo

Re: [PATCH v2 0/5] kallsyms: Emit symbol for holes in text and fix weak function issue

2025-01-21 Thread Steven Rostedt
Sorry for the late reply. Forgot about this as I was focused on other end-of-year issues. On Sat, 14 Dec 2024 16:37:59 +0800 Zheng Yejian wrote: > The direct cause of this issue is the wrong fentry being founded by > ftrace_location(), > following the approach of "FTRACE_MCOUNT_MAX_OFFSET",

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-21 Thread Madhavan Srinivasan
On 1/21/25 4:58 PM, Christophe Leroy wrote: > > > Le 21/01/2025 à 12:13, Madhavan Srinivasan a écrit : >> >> >> On 1/20/25 10:42 PM, Dmitry V. Levin wrote: >>> On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote: Le 14/01/2025 à 18:04, Dmitry V. Levin a écrit : > On Mon,

Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value()

2025-01-21 Thread Dmitry V. Levin
On Tue, Jan 21, 2025 at 05:55:40PM +0530, Madhavan Srinivasan wrote: > On 1/21/25 4:58 PM, Christophe Leroy wrote: > > Le 21/01/2025 à 12:13, Madhavan Srinivasan a écrit : > >> On 1/20/25 10:42 PM, Dmitry V. Levin wrote: > >>> On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote: >

Re: [PATCH v2 5/5] perf: Record sample last_period before updating

2025-01-21 Thread kernel test robot
Hello, kernel test robot noticed "BUG:KASAN:null-ptr-deref_in_handle_pmi_common" on: commit: b16c01fbc96460a72789c04e0e2a8f8437eab05b ("[PATCH v2 5/5] perf: Record sample last_period before updating") url: https://github.com/intel-lab-lkp/linux/commits/mark-barnett-arm-com/perf-Allow-periodi