Re: [kvm-unit-tests PATCH v1 00/18] arm/arm64: Rework cache maintenance at boot

2023-11-30 Thread Alexandru Elisei
assembly. > - Unmap the early UART address if the DTB address does not match the early > address. > - Added dcache maintenance when a page table is modified with the MMU > disabled. > - Moved the cache maintenance when disabling the MMU to be executed before &

Re: [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files

2024-02-15 Thread Alexandru Elisei
Hi Drew, On Mon, Jan 15, 2024 at 01:44:17PM +0100, Andrew Jones wrote: > On Thu, Nov 30, 2023 at 04:07:03AM -0500, Shaoqin Huang wrote: > > From: Alexandru Elisei > > > > There are 25 header files today (found with grep -r "#ifndef __ASSEMBLY__) > > with function

Re: [kvm-unit-tests PATCH v1 01/18] Makefile: Define __ASSEMBLY__ for assembly files

2024-02-15 Thread Alexandru Elisei
Hi Drew, On Thu, Feb 15, 2024 at 05:32:22PM +0100, Andrew Jones wrote: > On Thu, Feb 15, 2024 at 04:05:56PM +0000, Alexandru Elisei wrote: > > Hi Drew, > > > > On Mon, Jan 15, 2024 at 01:44:17PM +0100, Andrew Jones wrote: > > > On Thu, Nov 30, 2023 at 04:07:0

Re: [kvm-unit-tests PATCH v1 00/18] arm/arm64: Rework cache maintenance at boot

2024-02-16 Thread Alexandru Elisei
e maintenance when a page table is modified with the MMU > disabled. > - Moved the cache maintenance when disabling the MMU to be executed before > the > MMU is disabled. > - Rebase it on lasted branch which efi support has been merged. > - Make the efi test also enable

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

2025-02-10 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 +0000, Alexandru Elisei wrote: > > --- > > arm/efi/run | 8 > > arm/run | 9 + > > run_tests.sh

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

2025-02-10 Thread Alexandru Elisei
Hi Drew, On Mon, Feb 10, 2025 at 02:56:25PM +0100, Andrew Jones wrote: > On Mon, Feb 10, 2025 at 10:41:53AM +0000, 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

Re: [kvm-unit-tests PATCH v2 15/18] Add kvmtool_params to test specification

2025-02-11 Thread Alexandru Elisei
Hi Drew, On Thu, Jan 23, 2025 at 04:53:29PM +0100, Andrew Jones wrote: > On Mon, Jan 20, 2025 at 04:43:13PM +0000, Alexandru Elisei wrote: > > arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for > > running a virtual machine is different than qemu'

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

2025-02-12 Thread Alexandru Elisei
Hi Drew, On Tue, Jan 21, 2025 at 04:46:24PM +0100, Andrew Jones wrote: > On Mon, Jan 20, 2025 at 04:43:02PM +0000, 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

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 +0000, 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

Re: [kvm-unit-tests PATCH v2 12/18] scripts/runtime: Add default arguments for kvmtool

2025-01-23 Thread Alexandru Elisei
Hi, On Thu, Jan 23, 2025 at 03:07:18PM +0100, Andrew Jones wrote: > On Mon, Jan 20, 2025 at 04:43:10PM +0000, Alexandru Elisei wrote: > > kvmtool, unless told otherwise, will do its best to make sure that a kernel > > successfully boots in a virtual machine. Among things lik

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

2025-01-20 Thread Alexandru Elisei
check in each of these locations for the supported virtual machine manager. Signed-off-by: Alexandru Elisei --- arm/efi/run | 8 arm/run | 9 + run_tests.sh| 8 scripts/mkstandalone.sh | 8 4 files changed, 33 inser

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

2025-01-20 Thread Alexandru Elisei
ls to load the dummy kernel. Signed-off-by: Alexandru Elisei --- scripts/runtime.bash | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 451b5585f010..ee8a188b22ce 100644 --- a/scripts/runtime.bash +++ b/sc

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

2025-01-20 Thread Alexandru Elisei
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 support for kvmtool. Signed-off-by: Alexandru Elisei --- arm/run

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

2025-01-20 Thread Alexandru Elisei
architectures, passes the parameters right back to run_qemu() et co, and do not treat individual parameters separately. Signed-off-by: Alexandru Elisei --- scripts/runtime.bash | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index

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

2025-01-20 Thread Alexandru Elisei
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 file changed, 5 insertions(+) diff --git a/scripts/runtime

[kvm-unit-tests PATCH v2 15/18] Add kvmtool_params to test specification

2025-01-20 Thread Alexandru Elisei
but using kvmtool's syntax. Signed-off-by: Alexandru Elisei --- arm/unittests.cfg | 27 +++ docs/unittests.txt | 8 scripts/common.bash | 4 3 files changed, 39 insertions(+) diff --git a/arm/unittests.cfg b/arm/unittests.cfg index 2bdad67d569

[kvm-unit-tests PATCH v2 14/18] run_tests: Add KVMTOOL environment variable for kvmtool binary path

2025-01-20 Thread Alexandru Elisei
kvmtool is often used for prototyping new features, and a developer might not want to install it system-wide. Add a KVMTOOL environment variable to make it easier for tests to use a binary not in $PATH. Signed-off-by: Alexandru Elisei --- run_tests.sh | 1 + scripts/arch-run.bash | 2

[kvm-unit-tests PATCH v2 00/18] arm/arm64: Add kvmtool to the runner script

2025-01-20 Thread Alexandru Elisei
on't think UEFI support is very important at the moment, no distro ships a EDK2 binary compiled for kvmtool so I don't think there would be many users for it. [1] https://lore.kernel.org/kvm/20210702163122.96110-1-alexandru.eli...@arm.com/ Please review, Alex Alexandru Elisei (18): r

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

2025-01-20 Thread Alexandru Elisei
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 | 17 + 1 file changed, 9 insertions(+), 8 del

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

2025-01-20 Thread Alexandru Elisei
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 | 12 +--- 2 files changed, 13 insertions(+), 4 deletions(-) diff

[kvm-unit-tests PATCH v2 12/18] scripts/runtime: Add default arguments for kvmtool

2025-01-20 Thread Alexandru Elisei
sts EXIT: STATUS=1 Note that KVMTOOL_DEFAULT_OPTS can be overwritten by an environment variable with the same name, but it's not documented in the help string for run_tests.sh. This has been done on purpose, since overwritting KVMTOOL_DEFAULT_OPTS should only be necessary for debugging or development

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

2025-01-20 Thread Alexandru Elisei
(two dashes instead of the single dash that qemu uses). arm/run does not know how to use these functions yet, but this will be added in a subsequent patch. Signed-off-by: Alexandru Elisei --- scripts/arch-run.bash | 94 +-- 1 file changed, 81 insertions

[kvm-unit-tests PATCH v2 13/18] run_tests: Do not probe for maximum number of VCPUs when using kvmtool

2025-01-20 Thread Alexandru Elisei
supports, which is exactly what --probe-maxsmp wants to achieve. When doing --probe-maxsmp with kvmtool, print a message explaining why it's redundant and don't do anything else. Signed-off-by: Alexandru Elisei --- run_tests.sh | 10 +- 1 file changed, 9 insertions(+), 1 deletio

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

2025-01-20 Thread Alexandru Elisei
f the two parameters. While we're at it, rename the variable opts to qemu_opts to match the new unit configuration name, and to make it easier to distinguish from the kvmtool parameters when they'll be added. Signed-off-by: Alexandru Elisei --- docs/unittests.tx

[kvm-unit-tests PATCH v2 16/18] scripts/mkstandalone: Export $TARGET

2025-01-20 Thread Alexandru Elisei
$TARGET is needed for the test runner to decide if it should use qemu or kvmtool, so export it. Signed-off-by: Alexandru Elisei --- scripts/mkstandalone.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh index 4de97056e641..10abb5e191b7

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

2025-01-20 Thread Alexandru Elisei
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 | 14 +++--- 2 files changed, 15 insertions(+), 5 deletion

[kvm-unit-tests PATCH v2 18/18] run_tests: Enable kvmtool

2025-01-20 Thread Alexandru Elisei
ssing is support for EFI tests. That's because distros don't ship a EDK2 binary compiled for kvmtool, and on top of that kvm-unit-tests as an EFI app hasn't been tested to work with kvmtool. Signed-off-by: Alexandru Elisei --- Should I also revert commit 35145f140442 ("arm/arm64:

[kvm-unit-tests PATCH v2 17/18] unittest: Add disabled_if parameter and use it for kvmtool

2025-01-20 Thread Alexandru Elisei
The pci-test is qemu specific. Other tests perform migration, which isn't supported by kvmtool. In general, kvmtool is not as feature-rich as qemu, so add a new unittest parameter, disabled_if, that causes a test to be skipped if the condition evaluates to true. Signed-off-by: Alexandru E

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

2025-01-20 Thread Alexandru Elisei
e. Signed-off-by: Alexandru Elisei --- arm/run | 183 ++-- 1 file changed, 110 insertions(+), 73 deletions(-) diff --git a/arm/run b/arm/run index 9b11feafffdd..880d5afae86d 100755 --- a/arm/run +++ b/arm/run @@ -17,77 +17,114 @@ qemu) ex

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 +0000, Alexandru Elisei wrote: > > Arm and arm64 support running the tests under kvmtool. Unsurprisingly, > > kvmtool and qemu have a different command line syntax for

Re: [kvm-unit-tests PATCH v1 1/5] configure: Document that the architecture name 'aarch64' is also supported

2025-01-14 Thread Alexandru Elisei
Hi Drew, On Mon, Jan 13, 2025 at 04:01:58PM +0100, Andrew Jones wrote: > On Fri, Jan 10, 2025 at 01:58:44PM +0000, Alexandru Elisei wrote: > > $arch, on arm64, defaults to 'aarch64', and later in the script is replaced > > by 'arm64'. Intentional or not, docum

Re: [kvm-unit-tests PATCH v1 2/5] configure: Display the default processor for arm and arm64

2025-01-14 Thread Alexandru Elisei
Hi Drew, On Mon, Jan 13, 2025 at 04:11:06PM +0100, Andrew Jones wrote: > On Fri, Jan 10, 2025 at 01:58:45PM +0000, Alexandru Elisei wrote: > > The help text for the --processor option displays the architecture name as > > the default processor type. But the default for arm is cort

Re: [kvm-unit-tests PATCH v1 4/5] arm/arm64: Add support for --processor=max

2025-01-14 Thread Alexandru Elisei
Hi Drew, On Mon, Jan 13, 2025 at 04:21:45PM +0100, Andrew Jones wrote: > On Fri, Jan 10, 2025 at 01:58:47PM +0000, Alexandru Elisei wrote: > > For arm64, newer architecture features are supported only on newer CPUs. > > Instead of expecting the user to know which CPU model

Re: [kvm-unit-tests PATCH v1 5/5] configure: arm64: Make 'max' the default for --processor

2025-01-14 Thread Alexandru Elisei
Hi Drew, On Mon, Jan 13, 2025 at 04:29:21PM +0100, Andrew Jones wrote: > On Fri, Jan 10, 2025 at 01:58:48PM +0000, Alexandru Elisei wrote: > > Newer architecture features are supported by qemu TCG on newer CPUs. When > > writing a test for such architecture features, it is necess

Re: [kvm-unit-tests PATCH v1 2/5] configure: Display the default processor for arm and arm64

2025-01-15 Thread Alexandru Elisei
Hi Drew, On Tue, Jan 14, 2025 at 07:51:04PM +0100, Andrew Jones wrote: > On Tue, Jan 14, 2025 at 05:17:28PM +0000, Alexandru Elisei wrote: > ... > > > > +# $arch will have changed when cross-compiling. > > > > +[ -z "$processor" ] && processor=$(ge

Re: [kvm-unit-tests PATCH v1 1/5] configure: Document that the architecture name 'aarch64' is also supported

2025-01-15 Thread Alexandru Elisei
Hi Drew, On Tue, Jan 14, 2025 at 07:39:49PM +0100, Andrew Jones wrote: > On Tue, Jan 14, 2025 at 05:03:20PM +0000, Alexandru Elisei wrote: > ... > > diff --git a/configure b/configure > > index 86cf1da36467..1362b68dd68b 100755 > > --- a/configure > > +++ b/configure

[kvm-unit-tests PATCH v1 3/5] arm64: Implement the ./configure --processor option

2025-01-10 Thread Alexandru Elisei
Signed-off-by: Alexandru Elisei --- arm/Makefile.arm| 1 - arm/Makefile.common | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arm/Makefile.arm b/arm/Makefile.arm index 7fd39f3ada64..d6250b7fb686 100644 --- a/arm/Makefile.arm +++ b/arm/Makefile.arm @@ -12,7 +12,6 @@ $(err

[kvm-unit-tests PATCH v1 2/5] configure: Display the default processor for arm and arm64

2025-01-10 Thread Alexandru Elisei
The help text for the --processor option displays the architecture name as the default processor type. But the default for arm is cortex-a15, and for arm64 is cortex-a57. Teach configure to display the correct default processor type for these two architectures. Signed-off-by: Alexandru Elisei

[kvm-unit-tests PATCH v1 1/5] configure: Document that the architecture name 'aarch64' is also supported

2025-01-10 Thread Alexandru Elisei
help text doesn't have it as one of the supported architectures. Signed-off-by: Alexandru Elisei --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 86cf1da36467..5b0a2d7f39c0 100755 --- a/configure +++ b/configure @@ -47,7 +47,7 @@ usage

[kvm-unit-tests PATCH v1 0/5] arm64: Change the default --processor to max

2025-01-10 Thread Alexandru Elisei
ght more prudent to go with it and document it. [1] https://lore.kernel.org/all/20241212103447.34593-1-vladimir.mur...@arm.com/ Alexandru Elisei (5): configure: Document that the architecture name 'aarch64' is also supported configure: Display the default processor for arm and

[kvm-unit-tests PATCH v1 5/5] configure: arm64: Make 'max' the default for --processor

2025-01-10 Thread Alexandru Elisei
CPU target via --cflags=-mcpu= configure option. Signed-off-by: Alexandru Elisei --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 46964d36a7d8..3ab0ec208e10 100755 --- a/configure +++ b/configure @@ -14,7 +14,7 @@ function get_default_processo

[kvm-unit-tests PATCH v1 4/5] arm/arm64: Add support for --processor=max

2025-01-10 Thread Alexandru Elisei
is used, it's only the error that changes: from an unknown processor type to using instructions that are not available on the processor. Signed-off-by: Alexandru Elisei --- arm/Makefile.common | 2 ++ configure | 5 - 2 files changed, 6 insertions(+), 1 deletion(-) diff

Re: [kvm-unit-tests PATCH v2 15/18] Add kvmtool_params to test specification

2025-02-12 Thread Alexandru Elisei
Hi Drew, On Wed, Feb 12, 2025 at 04:56:42PM +0100, Andrew Jones wrote: > On Tue, Feb 11, 2025 at 03:03:09PM +0000, Alexandru Elisei wrote: > > Hi Drew, > > > > On Thu, Jan 23, 2025 at 04:53:29PM +0100, Andrew Jones wrote: > > > On Mon, Jan 20, 2025 at 04:43:13PM

Re: [kvm-unit-tests PATCH v2] Makefile: Use CFLAGS in cc-option

2025-03-13 Thread Alexandru Elisei
Hi Drew, Thank you for debugging this. I tested the patch by compiling the MTE test from Vladimir with clang and it works now: Tested-by: Alexandru Elisei Thanks, Alex On Fri, Mar 07, 2025 at 10:18:29AM +0100, Andrew Jones wrote: > When cross compiling with clang we need to specify the tar