Re: [kvm-unit-tests PATCH v3 03/16] configure: Export TARGET unconditionally

2025-05-08 Thread Andrew Jones
On Thu, May 08, 2025 at 11:05:32AM +0100, Alexandru Elisei wrote: > Hi Drew, > > On Thu, May 08, 2025 at 11:39:54AM +0200, Andrew Jones wrote: > > On Thu, May 08, 2025 at 09:52:38AM +0100, Alexandru Elisei wrote: > > > Hi Drew, > > > > > > On Wed, May

Re: [kvm-unit-tests PATCH v3 03/16] configure: Export TARGET unconditionally

2025-05-08 Thread Andrew Jones
On Thu, May 08, 2025 at 09:52:38AM +0100, Alexandru Elisei wrote: > Hi Drew, > > On Wed, May 07, 2025 at 06:02:31PM +0200, Andrew Jones wrote: > > On Wed, May 07, 2025 at 04:12:43PM +0100, Alexandru Elisei wrote: > > > Only arm and arm64 are allowed to set --target to

Re: [kvm-unit-tests PATCH v3 16/16] scripts: Enable kvmtool

2025-05-07 Thread Andrew Jones
een tested to work with kvmtool. > > Signed-off-by: Alexandru Elisei > --- > README.md| 18 +- > arm/efi/run | 5 + > configure| 1 - > scripts/vmm.bash | 2 +- > 4 files changed, 23 insertions(+), 3 deletions(-) > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 15/16] scripts: Add 'disabled_if' test definition parameter for kvmtool to use

2025-05-07 Thread Andrew Jones
ugh in my opinion this > semantic is somewhat better conveyed with the name 'excluded_targets'. excluded_targets sounds good, but disabled_if is growing on me. So, unless you or others also prefer excluded_targets, then Reviewed-by: Andrew Jones Thanks, drew

Re: [kvm-unit-tests PATCH v3 13/16] scripts: Do not probe for maximum number of VCPUs when using kvmtool

2025-05-07 Thread Andrew Jones
7;-smp' > [qemu:kernel]='-kernel' > @@ -122,6 +144,7 @@ declare -A vmm_opts=( > [qemu:default_opts]='' > [qemu:fixup_return_code]=qemu_fixup_return_code > [qemu:parse_premature_failure]=qemu_parse_premature_failure > + [qemu:probe_maxsmp]=qemu_probe_maxsmp > > [kvmtool:nr_cpus]='--cpus' > [kvmtool:kernel]='--kernel' > @@ -130,6 +153,7 @@ declare -A vmm_opts=( > [kvmtool:default_opts]="$KVMTOOL_DEFAULT_OPTS" > [kvmtool:fixup_return_code]=kvmtool_fixup_return_code > [kvmtool:parse_premature_failure]=kvmtool_parse_premature_failure > + [kvmtool:probe_maxsmp]=kvmtool_probe_maxsmp > ) > > function check_vmm_supported() > -- > 2.49.0 > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 12/16] scripts: Detect kvmtool failure in premature_failure()

2025-05-07 Thread Andrew Jones
@ declare -A vmm_opts=( > [qemu:initrd]='-initrd' > [qemu:default_opts]='' > [qemu:fixup_return_code]=qemu_fixup_return_code > + [qemu:parse_premature_failure]=qemu_parse_premature_failure > > [kvmtool:nr_cpus]='--cpus' > [kvmtool:kernel]='--kernel' > @@ -107,6 +129,7 @@ declare -A vmm_opts=( > [kvmtool:initrd]='--initrd' > [kvmtool:default_opts]="$KVMTOOL_DEFAULT_OPTS" > [kvmtool:fixup_return_code]=kvmtool_fixup_return_code > + [kvmtool:parse_premature_failure]=kvmtool_parse_premature_failure > ) > > function check_vmm_supported() > -- > 2.49.0 > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 11/16] scripts: Add KVMTOOL environment variable for kvmtool binary path

2025-05-07 Thread Andrew Jones
kvmtool="$kvmtoolcmd" > break > @@ -381,6 +381,7 @@ search_kvmtool_binary () > > if [ -z "$kvmtool" ]; then > echo "A kvmtool binary was not found." >&2 > + echo "You can set a custom location by using the KVMTOOL= > environment variable." >&2 > return 2 > fi > > -- > 2.49.0 > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 10/16] scripts: Add default arguments for kvmtool

2025-05-07 Thread Andrew Jones
evel=warning"}" > + > > ###### > # qemu_fixup_return_code translates the ambiguous exit status in Table1 to > that > # in Table2. Table3 simply documents the complete status table. > @@ -87,12 +98,14 @@ declare -A vmm_opts=( > [qemu:kernel]='-kernel' > [qemu:args]='-append' > [qemu:initrd]='-initrd' > + [qemu:default_opts]='' > [qemu:fixup_return_code]=qemu_fixup_return_code > > [kvmtool:nr_cpus]='--cpus' > [kvmtool:kernel]='--kernel' > [kvmtool:args]='--params' > [kvmtool:initrd]='--initrd' > + [kvmtool:default_opts]="$KVMTOOL_DEFAULT_OPTS" > [kvmtool:fixup_return_code]=kvmtool_fixup_return_code > ) > > -- > 2.49.0 Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 09/16] scripts: Add support for kvmtool

2025-05-07 Thread Andrew Jones
; powerpc/run | 4 +- > riscv/run | 4 +- > s390x/run | 2 +- > scripts/arch-run.bash | 112 +++-- > scripts/vmm.bash | 89 +++ > x86/run | 4 +- > 7 files changed, 236 insertions(+), 140 deletions(-) > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 08/16] scripts: Add 'kvmtool_params' to test definition

2025-05-07 Thread Andrew Jones
On Wed, May 07, 2025 at 04:12:48PM +0100, Alexandru Elisei wrote: > arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for > running and configuring a virtual machine is different to qemu. To run > tests using the automated test infrastructure, add a new test parameter, > 'kvmtool

Re: [kvm-unit-tests PATCH v3 07/16] scripts: Use an associative array for qemu argument names

2025-05-07 Thread Andrew Jones
e same VM > configuration parameters. > > Suggested-by: Andrew Jones > Signed-off-by: Alexandru Elisei > --- > scripts/common.bash | 10 +++--- > scripts/runtime.bash | 7 +-- > scripts/vmm.bash | 7 +++ > 3 files changed, 15 insertions(+), 9 deletions(-) >

Re: [kvm-unit-tests PATCH v3 06/16] scripts: Refuse to run the tests if not configured for qemu

2025-05-07 Thread Andrew Jones
On Wed, May 07, 2025 at 04:12:46PM +0100, Alexandru Elisei wrote: > Arm and arm64 support running the tests under kvmtool. kvmtool has a > different command line syntax for configuring and running a virtual > machine, and the automated scripts know only how to use qemu. > > One issue with that is

Re: [kvm-unit-tests PATCH v3 02/16] scripts: Add 'test_args' test definition parameter

2025-05-07 Thread Andrew Jones
local check="${CHECK:-$9}" > +local accel="${10}" > +local timeout="${11:-$TIMEOUT}" # unittests.cfg overrides the default > + > +# If $test_args is empty, qemu will interpret the first option after > -append > +# as a kernel parameter instead of a qemu option, so make sure the > -append > +# option is used only if $test_args is not empy. ^ empty Otherwise, Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 03/16] configure: Export TARGET unconditionally

2025-05-07 Thread Andrew Jones
++ > 1 file changed, 24 insertions(+), 12 deletions(-) > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v3 01/16] scripts: unittests.cfg: Rename 'extra_params' to 'qemu_params'

2025-05-07 Thread Andrew Jones
> powerpc/unittests.cfg | 18 +++--- > riscv/unittests.cfg | 2 +- > s390x/unittests.cfg | 50 +++ > scripts/common.bash | 8 +-- > scripts/runtime.bash | 6 +- > x86/unittests.cfg | 140 +++++- > 8 files changed, 160 insertions(+), 155 deletions(-) > Reviewed-by: Andrew Jones

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

2025-04-08 Thread Andrew Jones
On Fri, Mar 07, 2025 at 10:18:29AM +0100, Andrew Jones wrote: > When cross compiling with clang we need to specify the target in > CFLAGS and cc-option will fail to recognize target-specific options > without it. Add CFLAGS to the CC invocation in cc-option. > > The intr

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

2025-03-07 Thread Andrew Jones
CFLAGS referencing itself. Signed-off-by: Andrew Jones --- v2: - Fixed x86 builds with the realmode_bits variable Makefile| 2 +- x86/Makefile.common | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 78352fced9d4..9dc5d2234e2a 100644 --- a

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

2025-03-07 Thread Andrew Jones
On Fri, Mar 07, 2025 at 09:42:03AM +0100, Thomas Huth wrote: > On 07/03/2025 09.39, Andrew Jones wrote: > > When cross compiling with clang we need to specify the target in > > CFLAGS and cc-option will fail to recognize target-specific options > > without it. Add CFLAGS to th

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

2025-03-07 Thread Andrew Jones
When cross compiling with clang we need to specify the target in CFLAGS and cc-option will fail to recognize target-specific options without it. Add CFLAGS to the CC invocation in cc-option. Signed-off-by: Andrew Jones --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [RFC kvm-unit-tests PATCH] lib: Use __ASSEMBLER__ instead of __ASSEMBLY__

2025-02-25 Thread Andrew Jones
that replaced, for riscv and arm Reviewed-by: Andrew Jones Thanks, drew

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

2025-02-13 Thread Andrew Jones
On Wed, Feb 12, 2025 at 04:34:44PM +, Alexandru Elisei wrote: > Hi Drew, > > On Wed, Feb 12, 2025 at 04:56:42PM +0100, Andrew Jones wrote: > > On Tue, Feb 11, 2025 at 03:03:09PM +, Alexandru Elisei wrote: > > > Hi Drew, > > > > > > On Thu, Jan

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

2025-02-12 Thread Andrew Jones
On Tue, Feb 11, 2025 at 03:03:09PM +, 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 +, Alexandru Elisei wrote: > > > arm/arm64 supports running tests under kvmtool,

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

2025-02-12 Thread Andrew Jones
On Wed, Feb 12, 2025 at 01:40:51PM +, Alexandru Elisei wrote: ... > > > @@ -80,7 +80,7 @@ function run() > > > local groups="$2" > > > local smp="$3" > > > local kernel="$4" > > > -local opts="$5" > > > +local qemu_opts="$5" > > > local arch="$6" > > > local mac

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

2025-02-10 Thread Andrew Jones
On Mon, Feb 10, 2025 at 10:41:53AM +, 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/efi/run

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

2025-01-23 Thread Andrew Jones
x27;!" > usage > diff --git a/run_tests.sh b/run_tests.sh > index d38954be9093..3921dcdcb344 100755 > --- a/run_tests.sh > +++ b/run_tests.sh > @@ -110,7 +110,7 @@ while [ $# -gt 0 ]; do > done > > case "$TARGET" in > -qemu) > +qemu | kvmtool) > ;; > *) > echo "$0 does not support '$TARGET'" > diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh > index 10abb5e191b7..16383b05adfa 100755 > --- a/scripts/mkstandalone.sh > +++ b/scripts/mkstandalone.sh > @@ -8,7 +8,7 @@ source config.mak > source scripts/common.bash > > case "$TARGET" in > -qemu) > +qemu | kvmtool) > ;; > *) > echo "'$TARGET' not supported for standlone tests" > -- > 2.47.1 > Reviewed-by: Andrew Jones

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

2025-01-23 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:15PM +, Alexandru Elisei wrote: > 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 skippe

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

2025-01-23 Thread Andrew Jones
ort ARCH_NAME > config_export PROCESSOR > + config_export TARGET > > echo "echo BUILD_HEAD=$(cat build-head)" > > -- > 2.47.1 > Reviewed-by: Andrew Jones

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

2025-01-23 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:13PM +, Alexandru Elisei wrote: > arm/arm64 supports running tests under kvmtool, but kvmtool's syntax for > running a virtual machine is different than qemu's. To run tests using the > automated test infrastructure, add a new test parameter, kvmtool_params. > The

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

2025-01-23 Thread Andrew Jones
On Mon, Jan 20, 2025 at 04:43:12PM +, Alexandru Elisei wrote: > 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: Alex

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

2025-01-23 Thread Andrew Jones
kvmtool) > +echo "kvmtool automatically limits the number of VCPUs to > maximum supported" > +echo "The 'smp' test parameter won't be modified" > +;; > +esac > ;; >

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

2025-01-23 Thread Andrew Jones
t;--nodefaults --network mode=none > --loglevel=warning"}" > + > PASS() { echo -ne "\e[32mPASS\e[0m"; } > SKIP() { echo -ne "\e[33mSKIP\e[0m"; } > FAIL() { echo -ne "\e[31mFAIL\e[0m"; } > @@ -103,7 +114,7 @@ function run() > opts="-smp $smp $qemu_opts" > ;; > kvmtool) > -opts="--cpus $smp $kvmtool_opts" > +opts="$KVMTOOL_DEFAULT_OPTS --cpus $smp $kvmtool_opts" > ;; > esac > > -- > 2.47.1 > Otherwise, Reviewed-by: Andrew Jones

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 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

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

2025-01-21 Thread Andrew Jones
L" = "kvm" ] || [ "$ACCEL" = "hvf" ]; then > - if [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ]; then > - processor="host" > - if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then > - processor+=",aarch64=off" > - fi > - fi > -fi > - > -if [ "$ARCH" = "arm" ]; then > - M+=",highmem=off" > -fi > - > -if ! $qemu $M -device '?' | grep -q virtconsole; then > - echo "$qemu doesn't support virtio-console for chr-testdev. Exiting." > - exit 2 > -fi > - > -if ! $qemu $M -chardev '?' | grep -q testdev; then > - echo "$qemu doesn't support chr-testdev. Exiting." > - exit 2 > -fi > - > -if [ "$UEFI_SHELL_RUN" != "y" ] && [ "$EFI_USE_ACPI" != "y" ]; then > - chr_testdev='-device virtio-serial-device' > - chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd' > -fi > - > -pci_testdev= > -if $qemu $M -device '?' | grep -q pci-testdev; then > - pci_testdev="-device pci-testdev" > -fi > - > -A="-accel $ACCEL$ACCEL_PROPS" > -command="$qemu -nodefaults $M $A -cpu $processor $chr_testdev $pci_testdev" > -command+=" -display none -serial stdio" > -command="$(migration_cmd) $(timeout_cmd) $command" > - > -if [ "$UEFI_SHELL_RUN" = "y" ]; then > - ENVIRON_DEFAULT=n run_test_status $command "$@" > -elif [ "$EFI_USE_ACPI" = "y" ]; then > - run_test_status $command -kernel "$@" > -else > - run_qemu $command -kernel "$@" > -fi > +case "$TARGET" in > +qemu) > +arch_run_qemu "$@" > +;; > +kvmtool) > +arch_run_kvmtool "$@" > +;; > +esac > -- > 2.47.1 > > Reviewed-by: Andrew Jones

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: [kvm-unit-tests PATCH v2 09/18] scripts/runtime: Skip test when kvmtool and $accel is not KVM

2025-01-21 Thread Andrew Jones
$accel" > +return 2 > +fi > + > # check a file for a particular value before running a test > # the check line can contain multiple files to check separated by a space > # but each check parameter needs to be of the form = > -- > 2.47.1 Reviewed-by: Andrew Jones

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 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 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 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 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 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

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

2025-01-21 Thread Andrew Jones
tests in parallel > +-t, --tap13 Output test results in TAP format > +-l, --list Only output all tests list > +--probe-maxsmp Update the maximum number of VCPUs supported by host > > Set the environment variable QEMU=/path/to/qemu-system-ARCH to > specify the appropriate qemu binary for ARCH-run. > -- > 2.47.1 > > Reviewed-by: Andrew Jones

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

2025-01-15 Thread Andrew Jones
On Wed, Jan 15, 2025 at 09:55:14AM +, Alexandru Elisei wrote: > Hi Drew, > > On Tue, Jan 14, 2025 at 07:51:04PM +0100, Andrew Jones wrote: > > On Tue, Jan 14, 2025 at 05:17:28PM +, Alexandru Elisei wrote: > > ... > > > > > +# $arch will have changed w

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

2025-01-14 Thread Andrew Jones
On Tue, Jan 14, 2025 at 05:17:28PM +, Alexandru Elisei wrote: ... > > > +# $arch will have changed when cross-compiling. > > > +[ -z "$processor" ] && processor=$(get_default_processor $arch) > > > > The fact that $arch and $processor are wrong until they've had a chance to > > $processor is

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

2025-01-14 Thread Andrew Jones
On Tue, Jan 14, 2025 at 05:03:20PM +, Alexandru Elisei wrote: ... > diff --git a/configure b/configure > index 86cf1da36467..1362b68dd68b 100755 > --- a/configure > +++ b/configure > @@ -15,8 +15,8 @@ objdump=objdump > readelf=readelf > ar=ar > addr2line=addr2line > -arch=$(uname -m | sed -e

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

2025-01-13 Thread Andrew Jones
On Fri, Jan 10, 2025 at 01:58:48PM +, Alexandru Elisei wrote: > Newer architecture features are supported by qemu TCG on newer CPUs. When > writing a test for such architecture features, it is necessary to pass the > correct -cpu argument to qemu. Make it easier on users and test authors > alik

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

2025-01-13 Thread Andrew Jones
On Fri, Jan 10, 2025 at 01:58:47PM +, Alexandru Elisei wrote: > For arm64, newer architecture features are supported only on newer CPUs. > Instead of expecting the user to know which CPU model supports which > feature when using the TCG accelerator for qemu, let's make it easier and > add suppo

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

2025-01-13 Thread Andrew Jones
k.o relies on frame pointers. > KEEP_FRAME_POINTER := y > > +CFLAGS += -mcpu=$(PROCESSOR) > CFLAGS += -std=gnu99 > CFLAGS += -ffreestanding > CFLAGS += -O2 > -- > 2.47.1 > Reviewed-by: Andrew Jones

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

2025-01-13 Thread Andrew Jones
On Fri, Jan 10, 2025 at 01:58:44PM +, Alexandru Elisei wrote: > $arch, on arm64, defaults to 'aarch64', and later in the script is replaced > by 'arm64'. Intentional or not, document that the name 'aarch64' is also > supported when configuring for the arm64 architecture. This has been the > cas

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

2025-01-13 Thread Andrew Jones
On Fri, Jan 10, 2025 at 01:58:45PM +, 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 cortex-a15, and for > arm64 is cortex-a57. Teach configure to display the correct default > process

Re: [kvm-unit-tests PATCH v3 0/5] Support cross compiling with clang

2024-10-24 Thread Andrew Jones
On Wed, Sep 11, 2024 at 11:14:07AM +0200, Andrew Jones wrote: > Modify configure to allow --cc=clang and a cross-prefix to be specified > together (as well as --cflags). This allows compiling with clang, but > using cross binutils for everything else, including the linker. So far > tes

[kvm-unit-tests PATCH v3 4/5] riscv: gitlab-ci: Add clang build tests

2024-09-11 Thread Andrew Jones
Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Acked-by: Thomas Huth Acked-by: Nicholas Piggin Signed-off-by: Andrew Jones --- .gitlab-ci.yml | 43

[kvm-unit-tests PATCH v3 5/5] README: Add cross and clang recipes

2024-09-11 Thread Andrew Jones
Add configure command line examples for cross-compiling, for compiling with clang, and for cross-compiling with clang. Signed-off-by: Andrew Jones --- README.md | 22 ++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 2d6f7db5605c..be07dc28a094

[kvm-unit-tests PATCH v3 3/5] configure: Support cross compiling with clang

2024-09-11 Thread Andrew Jones
ble to cross compile for riscv with clang after configuring with ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ --cross-prefix=riscv64-linux-gnu- Reviewed-by: Thomas Huth Reviewed-by: Nicholas Piggin Signed-off-by: Andrew Jones --- configure | 11

[kvm-unit-tests PATCH v3 2/5] Makefile: Prepare for clang EFI builds

2024-09-11 Thread Andrew Jones
r the initrd_dev_path struct. (Eliminating the warning is preferred to reworking the struct, because the implementation is imported verbatim from Linux.) Reviewed-by: Nicholas Piggin Signed-off-by: Andrew Jones --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile

[kvm-unit-tests PATCH v3 0/5] Support cross compiling with clang

2024-09-11 Thread Andrew Jones
gnore warnings vs. fix code to commit message of patch2 - Picked up Nick's tags v2: - fix building with clang and --config-efi by suppressing a warning - added riscv clang efi build to CI - picked up Thomas's tags Andrew Jones (5): riscv: Drop mstrict-align Makefile: Prepare for c

[kvm-unit-tests PATCH v3 1/5] riscv: Drop mstrict-align

2024-09-11 Thread Andrew Jones
The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Reviewed-by: Thomas Huth Signed-off-by: Andrew Jones --- riscv/Makefile | 4 +++- 1

Re: [kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang

2024-09-11 Thread Andrew Jones
On Wed, Sep 11, 2024 at 10:24:34AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > When a user specifies the compiler with --cc assume it's already > > fully named, even if the user also specifies a cross-prefix. This > > allow

Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds

2024-09-11 Thread Andrew Jones
On Wed, Sep 11, 2024 at 10:21:39AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > clang complains about GNU extensions such as variable sized types not > > being at the end of structs unless -Wno-gnu is used. We may > > eventually w

Re: [kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align

2024-09-11 Thread Andrew Jones
On Wed, Sep 11, 2024 at 10:08:23AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 8:50 PM AEST, Andrew Jones wrote: > > The spec says unaligned accesses are supported, so this isn't required > > and clang doesn't support it. A platform might have slow unaligned &

Re: [kvm-unit-tests PATCH 1/2] configure: Introduce add-config

2024-09-11 Thread Andrew Jones
On Wed, Sep 11, 2024 at 10:39:03AM GMT, Nicholas Piggin wrote: > On Wed Sep 4, 2024 at 12:39 AM AEST, Andrew Jones wrote: > > Allow users to add additional CONFIG_* and override defaults > > by concatenating a given file with #define's and #undef's to > > lib/config.

[kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests

2024-09-04 Thread Andrew Jones
Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Acked-by: Thomas Huth Signed-off-by: Andrew Jones --- .gitlab-ci.yml | 43

[kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang

2024-09-04 Thread Andrew Jones
ble to cross compile for riscv with clang after configuring with ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ --cross-prefix=riscv64-linux-gnu- Reviewed-by: Thomas Huth Signed-off-by: Andrew Jones --- configure | 11 --- 1 file changed

[kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds

2024-09-04 Thread Andrew Jones
r the initrd_dev_path struct. Signed-off-by: Andrew Jones --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 3d51cb726120..7471f7285b78 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ EFI_CFLAGS += -fshort-wchar # EFI applications use PIC as they are l

[kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align

2024-09-04 Thread Andrew Jones
The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Reviewed-by: Thomas Huth Signed-off-by: Andrew Jones --- riscv/Makefile | 2 +- 1

[kvm-unit-tests PATCH v2 0/4] Support cross compiling with clang

2024-09-04 Thread Andrew Jones
compile - which is why there's no gitlab-ci patch for aarch64 in this series). I suspect it should work for other architectures too. v2: - fix building with clang and --config-efi by suppressing a warning - added riscv clang efi build to CI - picked up Thomas's tags Andrew Jones (4

Re: [kvm-unit-tests PATCH 0/3] Support cross compiling with clang

2024-09-04 Thread Andrew Jones
On Tue, Sep 03, 2024 at 06:30:47PM GMT, Andrew Jones wrote: > Modify configure to allow --cc=clang and a cross-prefix to be specified > together (as well as --cflags). This allows compiling with clang, but > using cross binutils for everything else, including the linker. So far > tes

[kvm-unit-tests PATCH 2/3] configure: Support cross compiling with clang

2024-09-03 Thread Andrew Jones
ble to cross compile for riscv with clang after configuring with ./configure --arch=riscv64 --cc=clang --cflags='--target=riscv64' \ --cross-prefix=riscv64-linux-gnu- Signed-off-by: Andrew Jones --- configure | 11 --- 1 file changed, 8 insertions(+), 3 deletion

[kvm-unit-tests PATCH 3/3] riscv: gitlab-ci: Add clang build tests

2024-09-03 Thread Andrew Jones
Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Signed-off-by: Andrew Jones --- .gitlab-ci.yml | 28 1 file changed, 28

[kvm-unit-tests PATCH 1/3] riscv: Drop mstrict-align

2024-09-03 Thread Andrew Jones
The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Signed-off-by: Andrew Jones --- riscv/Makefile | 2 +- 1 file changed, 1 insertion

[kvm-unit-tests PATCH 0/3] Support cross compiling with clang

2024-09-03 Thread Andrew Jones
compile - which is why there's no gitlab-ci patch for aarch64 in this series). I suspect it should work for other architectures too. Andrew Jones (3): riscv: Drop mstrict-align configure: Support cross compiling with clang riscv: gitlab-ci: Add clang build tests .gitlab-ci.yml

[kvm-unit-tests PATCH 2/2] riscv: Make NR_CPUS configurable

2024-09-03 Thread Andrew Jones
, $ cat < 256.config #undef CONFIG_NR_CPUS #define CONFIG_NR_CPUS 256 EOF $ ./configure --arch=riscv64 --cross-prefix=riscv64-linux-gnu- --add-config=256.config Signed-off-by: Andrew Jones --- configure | 3 ++- lib/riscv/asm/setup.h | 3 ++- 2 files changed, 4 insertions(+)

[kvm-unit-tests PATCH 1/2] configure: Introduce add-config

2024-09-03 Thread Andrew Jones
Allow users to add additional CONFIG_* and override defaults by concatenating a given file with #define's and #undef's to lib/config.h Signed-off-by: Andrew Jones --- configure | 14 ++ 1 file changed, 14 insertions(+) diff --git a/configure b/configure index 27

[kvm-unit-tests PATCH 0/2] configure: Support CONFIG_* extension

2024-09-03 Thread Andrew Jones
branch). Add support for extending config.h with a manually provided config.h-type file and also add support for using it for CONFIG_NR_CPUS for riscv. Andrew Jones (2): configure: Introduce add-config riscv: Make NR_CPUS configurable configure | 17 - lib/riscv/asm

Re: [PATCH v12 57/84] KVM: RISC-V: Mark "struct page" pfns accessed before dropping mmu_lock

2024-07-31 Thread Andrew Jones
ST) && writable) > kvm_set_pfn_dirty(hfn); > + else > + kvm_release_pfn_clean(hfn); > > spin_unlock(&kvm->mmu_lock); > - kvm_set_pfn_accessed(hfn); > - kvm_release_pfn_clean(hfn); > return ret; > } > > -- > 2.46.0.rc1.232.g9752f9e123-goog > Reviewed-by: Andrew Jones

Re: [PATCH v12 56/84] KVM: RISC-V: Mark "struct page" pfns dirty iff a stage-2 PTE is installed

2024-07-31 Thread Andrew Jones
err("Failed to map in G-stage\n"); > > out_unlock: > + if ((!ret || ret == -EEXIST) && writable) > + kvm_set_pfn_dirty(hfn); > + > spin_unlock(&kvm->mmu_lock); > kvm_set_pfn_accessed(hfn); > kvm_release_pfn_clean(hfn); > -- > 2.46.0.rc1.232.g9752f9e123-goog > Reviewed-by: Andrew Jones

Re: [PATCH v12 58/84] KVM: RISC-V: Use kvm_faultin_pfn() when mapping pfns into the guest

2024-07-31 Thread Andrew Jones
m_release_pfn_clean(hfn); > - > + kvm_release_faultin_page(kvm, page, ret && ret != -EEXIST, writable); > spin_unlock(&kvm->mmu_lock); > return ret; > } > -- > 2.46.0.rc1.232.g9752f9e123-goog > > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status

2024-06-17 Thread Andrew Jones
gt; else > # some QEMU versions report multiple panic events > echo "PASS: guest panicked" > + echo "EXIT: STATUS=1" > ret=1 > fi > > -- > 2.45.1 > Acked-by: Andrew Jones

Re: [kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status

2024-06-17 Thread Andrew Jones
On Fri, Jun 14, 2024 at 10:56:02AM GMT, Nicholas Piggin wrote: > On Wed Jun 12, 2024 at 5:26 PM AEST, Andrew Jones wrote: > > On Wed, Jun 12, 2024 at 03:23:17PM GMT, Nicholas Piggin wrote: > > > run_qemu_status() looks for "EXIT: STATUS=%d" if the harness command > &

Re: [kvm-unit-tests PATCH v10 12/15] scripts/arch-run.bash: Fix run_panic() success exit status

2024-06-12 Thread Andrew Jones
On Wed, Jun 12, 2024 at 03:23:17PM GMT, Nicholas Piggin wrote: > run_qemu_status() looks for "EXIT: STATUS=%d" if the harness command > returned 1, to determine the final status of the test. In the case of > panic tests, QEMU should terminate before successful exit status is > known, so the run_pan

Re: [kvm-unit-tests PATCH] build: retain intermediate .aux.o targets

2024-06-12 Thread Andrew Jones
2 +- > riscv/Makefile | 2 +- > s390x/Makefile | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > Acked-by: Andrew Jones

Re: [kvm-unit-tests PATCH v9 29/31] powerpc: Remove remnants of ppc64 directory and build structure

2024-06-04 Thread Andrew Jones
+1,111 @@ > > -include $(SRCDIR)/$(TEST_DIR)/Makefile.$(ARCH) > > +# > > +# powerpc makefile > > +# > > +# Authors: Andrew Jones > > I'd maybe drop that e-mail address now since it it not valid anymore. > Andrew, do want to see your new mail address here? No n

Re: [kvm-unit-tests PATCH v9 01/31] doc: update unittests doc

2024-05-06 Thread Andrew Jones
check > - > -check = =< > +check = = > > Check a file for a particular value before running a test. The check line > can contain multiple files to check separated by a space, but each check > parameter needs to be of the form = > + > +The path and value can not contain space, =, or shell wildcard characters. > -- > 2.43.0 > Reviewed-by: Andrew Jones

Re: [kvm-unit-tests PATCH v9 02/31] report: Add known failure reporting option

2024-05-06 Thread Andrew Jones
On Mon, May 06, 2024 at 09:25:37AM GMT, Thomas Huth wrote: > On 04/05/2024 14.28, Nicholas Piggin wrote: > > There are times we would like to test a function that is known to fail > > in some conditions due to a bug in implementation (QEMU, KVM, or even > > hardware). It would be nice to count thes

Re: [kvm-unit-tests PATCH v8 13/35] doc: start documentation directory with unittests.cfg doc

2024-04-05 Thread Andrew Jones
On Fri, Apr 05, 2024 at 06:35:14PM +1000, Nicholas Piggin wrote: > Consolidate unittests.cfg documentation in one place. > > Suggested-by: Andrew Jones > Signed-off-by: Nicholas Piggin > --- > arm/unittests.cfg | 26 ++--- > docs/

Re: [kvm-unit-tests PATCH v8 04/35] (arm|s390): Use migrate_skip in test cases

2024-04-05 Thread Andrew Jones
> previously. > > Reviewed-by: Thomas Huth > Signed-off-by: Nicholas Piggin > --- > arm/gic.c | 21 - > s390x/migration-cmm.c | 8 > s390x/migration-skey.c | 4 +++- > s390x/migration.c | 1 + > 4 files changed, 20 insertio

[kvm-unit-tests PATCH v2 04/13] treewide: lib/stack: Make base_address arch specific

2024-03-05 Thread Andrew Jones
weak, such that an architecture may override it when necessary, to accommodate the image layout. Then, immediately supply the riscv override. Signed-off-by: Andrew Jones --- lib/riscv/stack.c | 18 ++ lib/stack.c | 8 lib/stack.h | 2 ++ 3 files changed, 24

[kvm-unit-tests PATCH v2 03/13] treewide: lib/stack: Fix backtrace

2024-03-05 Thread Andrew Jones
trace printing") Acked-by: Claudio Imbrenda Reviewed-by: Nicholas Piggin Signed-off-by: Andrew Jones --- lib/arm/stack.c | 13 + lib/arm64/stack.c | 12 +--- lib/riscv/stack.c | 12 +--- lib/s390x/stack.c | 12 +--- lib/stack.h | 24 +--

Re: [kvm-unit-tests PATCH 14/32] powerpc: general interrupt tests

2024-03-05 Thread Andrew Jones
On Tue, Mar 05, 2024 at 07:26:18AM +0100, Thomas Huth wrote: > On 05/03/2024 03.19, Nicholas Piggin wrote: > > On Fri Mar 1, 2024 at 10:41 PM AEST, Thomas Huth wrote: > > > On 26/02/2024 11.12, Nicholas Piggin wrote: > > > > Add basic testing of various kinds of interrupts, machine check, > > > > p

Re: [kvm-unit-tests PATCH 5/7] arch-run: Add a "continuous" migration option for tests

2024-03-04 Thread Andrew Jones
On Mon, Mar 04, 2024 at 07:17:35AM +0100, Thomas Huth wrote: > On 26/02/2024 10.38, Nicholas Piggin wrote: > > The cooperative migration protocol is very good to control precise > > pre and post conditions for a migration event. However in some cases > > its intrusiveness to the test program, can m

Re: [kvm-unit-tests PATCH 14/32] powerpc: general interrupt tests

2024-03-01 Thread Andrew Jones
On Fri, Mar 01, 2024 at 02:57:04PM +0100, Thomas Huth wrote: > On 01/03/2024 14.45, Andrew Jones wrote: > > On Fri, Mar 01, 2024 at 01:41:22PM +0100, Thomas Huth wrote: > > > On 26/02/2024 11.12, Nicholas Piggin wrote: > > > > Add basic testing of various kind

Re: [kvm-unit-tests PATCH 14/32] powerpc: general interrupt tests

2024-03-01 Thread Andrew Jones
On Fri, Mar 01, 2024 at 01:41:22PM +0100, Thomas Huth wrote: > On 26/02/2024 11.12, Nicholas Piggin wrote: > > Add basic testing of various kinds of interrupts, machine check, > > page fault, illegal, decrementer, trace, syscall, etc. > > > > This has a known failure on QEMU TCG pseries machines w

Re: [kvm-unit-tests PATCH 04/13] treewide: lib/stack: Make base_address arch specific

2024-02-29 Thread Andrew Jones
On Thu, Feb 29, 2024 at 01:49:58PM +1000, Nicholas Piggin wrote: > On Thu Feb 29, 2024 at 1:04 AM AEST, Andrew Jones wrote: > > Calculating the offset of an address is image specific, which is > > architecture specific. Until now, all architectures and architecture > > config

Re: [kvm-unit-tests PATCH 03/13] treewide: lib/stack: Fix backtrace

2024-02-29 Thread Andrew Jones
On Thu, Feb 29, 2024 at 01:31:52PM +1000, Nicholas Piggin wrote: > On Thu Feb 29, 2024 at 1:04 AM AEST, Andrew Jones wrote: ... > > diff --git a/lib/stack.h b/lib/stack.h > > index 10fc2f793354..6edc84344b51 100644 > > --- a/lib/stack.h > > +++ b/lib/stack.h > >

[kvm-unit-tests PATCH 04/13] treewide: lib/stack: Make base_address arch specific

2024-02-28 Thread Andrew Jones
architecture specific, since the architecture's image layout already is. Signed-off-by: Andrew Jones --- lib/arm64/stack.c | 17 + lib/riscv/stack.c | 18 ++ lib/stack.c | 19 ++- lib/stack.h | 2 ++ lib/x86/stack.c

[kvm-unit-tests PATCH 03/13] treewide: lib/stack: Fix backtrace

2024-02-28 Thread Andrew Jones
trace printing") Signed-off-by: Andrew Jones --- lib/arm/stack.c | 13 + lib/arm64/stack.c | 12 +--- lib/riscv/stack.c | 12 +--- lib/s390x/stack.c | 12 +--- lib/stack.h | 24 +--- lib/x86/stack.c | 12 +--- 6 files c

Re: [kvm-unit-tests PATCH 32/32] powerpc: gitlab CI update

2024-02-28 Thread Andrew Jones
On Mon, Feb 26, 2024 at 08:12:18PM +1000, Nicholas Piggin wrote: > This adds testing for the powernv machine, and adds a gitlab-ci test > group instead of specifying all tests in .gitlab-ci.yml. > > Signed-off-by: Nicholas Piggin > --- > .gitlab-ci.yml| 16 ++-- > powerpc/uni

Re: [kvm-unit-tests PATCH 30/32] configure: Make arch_libdir a first-class entity

2024-02-28 Thread Andrew Jones
ir heuristic and just require > everybody sets arch_libdir correctly. Fail if the lib/arch or > lib/arch/asm directories can not be found. > > Cc: Alexandru Elisei > Cc: Andrew Jones > Cc: Claudio Imbrenda > Cc: David Hildenbrand > Cc: Eric Auger > Cc: Janosch Fr

Re: [kvm-unit-tests PATCH 29/32] configure: Fail on unknown arch

2024-02-28 Thread Andrew Jones
a missing test directory to disambiguate > the error in out of tree builds. > > Cc: Alexandru Elisei > Cc: Andrew Jones > Cc: Claudio Imbrenda > Cc: David Hildenbrand > Cc: Eric Auger > Cc: Janosch Frank > Cc: Laurent Vivier > Cc: Nico Böhr > Cc: Paolo Bonzini &g

  1   2   >