qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/7] tests/tcg: Add tests for prefixed load/store instruction


From: Alex Bennée
Subject: Re: [PATCH 3/7] tests/tcg: Add tests for prefixed load/store instructions
Date: Mon, 05 Oct 2020 17:26:51 +0100
User-agent: mu4e 1.5.5; emacs 28.0.50

Gustavo Romero <gromero@linux.ibm.com> writes:

> From: Michael Roth <mdroth@linux.vnet.ibm.com>
>
> This commit adds various tests to exercise the implementation of prefixed
> load/store instructions on POWER10.
>
> It adds a softmmu Makefile so tests can be built for the ppc64-softmmu
> target correctly with:
>
> $ make build-tcg-tests-ppc64-softmmu
>
> Moreover it fixes missing BUILD_DIR variable in Makefile.include when
> calling Makefile.qemu, otherwise config-$(TARGET).mak is not found (include
> fails silently) in Makefile.qemu and build finishes with no errors but no
> test is build. It also fixes quiet-command in Makefile.qemu, because it's
> not defined when cross-build-guest-tests target calls it, so no command is
> executed in fact, hence no test is build after make finishes.

Hmm the context of the make should already be in BUILD_DIR anyway. This
seems a little bogus and also unrelated to the main patch so please
split so it can be reviewed separately.

> Currently check-tcg target is not working, so '$ make check-tcg' fails
> because such a target will try to run the generated test binary as if
> it were a raw VM image, which is not the case. It's not a bootable image
> either, so the binary can't be loaded by SLOF, so after the build it's
> necessary to copy the test binary manually and execute it in a VM or a
> real POWER10 machine (e.g. for comparison) with support for prefixed
> instructions.
>
> Signed-off-by: Michael Roth <mroth@lamentation.net>
> [ gromero - fix to avoid alignment interrupt, don't cross 64-byte boundary
>           - fix displacement for pl{bz,hz,ha,wz,wa,d} to skip branch insn.
>           - tweaks in debug output
>           - add Makefile for ppc64-softmmu target
>           - build fixes in Makefile.{qemu,include}
>           - commit log ]
> Signed-off-by: Gustavo Romero <gromero@linux.ibm.com>
> ---
<snip>
>  
>  .PHONY: build-tcg
> diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
> index 0332bad10f..b531da19dc 100644
> --- a/tests/tcg/Makefile.qemu
> +++ b/tests/tcg/Makefile.qemu
> @@ -26,6 +26,8 @@ include $(SRC_PATH)/tests/docker/Makefile.include
>  
>  ifdef CROSS_CC_GUEST
>  
> +quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, 
> @$1))
> +

This is a separate fix which I think is already merged anyway. 

>  .PHONY: cross-build-guest-tests
>  cross-build-guest-tests:
>       $(call quiet-command, \
> diff --git a/tests/tcg/ppc64 b/tests/tcg/ppc64
> new file mode 120000
> index 0000000000..e25d62b735
> --- /dev/null
> +++ b/tests/tcg/ppc64
> @@ -0,0 +1 @@
> +ppc64le/
> \ No newline at end of file
> diff --git a/tests/tcg/ppc64le/Makefile.softmmu-target 
> b/tests/tcg/ppc64le/Makefile.softmmu-target
> new file mode 100644
> index 0000000000..2c869a81ab
> --- /dev/null
> +++ b/tests/tcg/ppc64le/Makefile.softmmu-target
> @@ -0,0 +1,13 @@
> +# -*- Mode: makefile -*-
> +#
> +# PPC - included from tests/tcg/Makefile.qemu
> +#
> +
> +VPATH += $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/instruction-tests
> +
> +PPC_TESTS = test-prefixed-load-store
> +
> +TESTS += $(PPC_TESTS)
> +
> +test-prefixed-load-store: test-prefixed-load-store.c
> +     gcc $< -o test-prefixed-load-store
> diff --git a/tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c 
> b/tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c
> new file mode 100644
> index 0000000000..f5948ada85
> --- /dev/null
> +++ b/tests/tcg/ppc64le/instruction-tests/test-prefixed-load-store.c
> @@ -0,0 +1,945 @@
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <stdint.h>
> +#include <stdbool.h>
> +#include <assert.h>
> +#include <endian.h>
> +#include <string.h>
> +
> +bool debug = false;
> +
> +#define dprintf(...) \
> +    do { \
> +        if (debug == true) { \
> +            fprintf(stderr, "%s: ", __func__); \
> +            fprintf(stderr, __VA_ARGS__); \
> +        } \
> +    } while (0);

This is not a softmmu test. Surely this is a linux-user test?

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]