From: Stefan Berger <stefanb@linux.ibm.com>
To: Eric Auger <eric.auger@redhat.com>,
eric.auger.pro@gmail.com, qemu-devel@nongnu.org,
qemu-arm@nongnu.org, peter.maydell@linaro.org
Cc: marcandre.lureau@redhat.com, lersek@redhat.com, ardb@kernel.org,
philmd@redhat.com
Subject: Re: [PATCH v3 09/10] test: tpm-tis: Get prepared to share tests between ISA and sysbus devices
Date: Wed, 26 Feb 2020 08:39:25 -0500 [thread overview]
Message-ID: <bea97d7f-cae2-20ad-b3f0-b1822f5857a9@linux.ibm.com> (raw)
In-Reply-To: <20200226102549.12158-10-eric.auger@redhat.com>
On 2/26/20 5:25 AM, Eric Auger wrote:
> ISA and sysbus TPM-TIS devices will share their tests. Only
> the main() will change (instantiation option is different).
> Also the base address of the TPM-TIS device is going to be
> different. on x86 it is located at 0xFED40000 while on ARM
> it can be located at any location, discovered through the
> device tree description.
>
> So we put shared test functions in a new object module.
> Each test needs to set tpm_tis_base_addr global variable.
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> ---
> tests/qtest/Makefile.include | 2 +-
> tests/qtest/tpm-crb-swtpm-test.c | 3 +
> tests/qtest/tpm-crb-test.c | 2 +
> tests/qtest/tpm-tis-swtpm-test.c | 3 +
> tests/qtest/tpm-tis-test.c | 414 +----------------------------
> tests/qtest/tpm-tis-util.c | 433 +++++++++++++++++++++++++++++++
> tests/qtest/tpm-tis-util.h | 23 ++
> tests/qtest/tpm-util.c | 3 -
> tests/qtest/tpm-util.h | 5 +
> 9 files changed, 473 insertions(+), 415 deletions(-)
> create mode 100644 tests/qtest/tpm-tis-util.c
> create mode 100644 tests/qtest/tpm-tis-util.h
>
> diff --git a/tests/qtest/Makefile.include b/tests/qtest/Makefile.include
> index 028af5b782..44aac68b25 100644
> --- a/tests/qtest/Makefile.include
> +++ b/tests/qtest/Makefile.include
> @@ -302,7 +302,7 @@ tests/qtest/tpm-crb-swtpm-test$(EXESUF): tests/qtest/tpm-crb-swtpm-test.o tests/
> tests/qtest/tpm-crb-test$(EXESUF): tests/qtest/tpm-crb-test.o tests/qtest/tpm-emu.o $(test-io-obj-y)
> tests/qtest/tpm-tis-swtpm-test$(EXESUF): tests/qtest/tpm-tis-swtpm-test.o tests/qtest/tpm-emu.o \
> tests/qtest/tpm-util.o tests/qtest/tpm-tests.o $(test-io-obj-y)
> -tests/qtest/tpm-tis-test$(EXESUF): tests/qtest/tpm-tis-test.o tests/qtest/tpm-emu.o $(test-io-obj-y)
> +tests/qtest/tpm-tis-test$(EXESUF): tests/qtest/tpm-tis-test.o tests/qtest/tpm-tis-util.o tests/qtest/tpm-emu.o $(test-io-obj-y)
>
> # QTest rules
>
> diff --git a/tests/qtest/tpm-crb-swtpm-test.c b/tests/qtest/tpm-crb-swtpm-test.c
> index 5228cb7af4..ac92f08bee 100644
> --- a/tests/qtest/tpm-crb-swtpm-test.c
> +++ b/tests/qtest/tpm-crb-swtpm-test.c
> @@ -18,6 +18,9 @@
> #include "libqtest.h"
> #include "qemu/module.h"
> #include "tpm-tests.h"
> +#include "hw/acpi/tpm.h"
> +
> +uint64_t tpm_tis_base_addr = TPM_TIS_ADDR_BASE;
>
> typedef struct TestState {
> char *src_tpm_path;
> diff --git a/tests/qtest/tpm-crb-test.c b/tests/qtest/tpm-crb-test.c
> index 632fb7fbd8..cdd09e5396 100644
> --- a/tests/qtest/tpm-crb-test.c
> +++ b/tests/qtest/tpm-crb-test.c
> @@ -19,6 +19,8 @@
> #include "qemu/module.h"
> #include "tpm-emu.h"
>
> +uint64_t tpm_tis_base_addr = TPM_TIS_ADDR_BASE;
> +
Since crb shouldn't need it, can you add a comment 'Not used but needed
for linking'? Same in tpm-crb-swtpm-test.c.
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
next prev parent reply other threads:[~2020-02-26 13:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 10:25 [PATCH v3 00/10] vTPM for aarch64 Eric Auger
2020-02-26 10:25 ` [PATCH v3 01/10] tpm: rename TPM_TIS into TPM_TIS_ISA Eric Auger
2020-02-26 10:25 ` [PATCH v3 02/10] tpm: Use TPMState as a common struct Eric Auger
2020-02-26 10:25 ` [PATCH v3 03/10] tpm: Separate tpm_tis common functions from isa code Eric Auger
2020-02-26 10:25 ` [PATCH v3 04/10] tpm: Separate TPM_TIS and TPM_TIS_ISA configs Eric Auger
2020-02-26 10:25 ` [PATCH v3 05/10] tpm: Add the SysBus TPM TIS device Eric Auger
2020-02-26 10:25 ` [PATCH v3 06/10] hw/arm/virt: vTPM support Eric Auger
2020-02-26 13:19 ` Stefan Berger
2020-02-26 10:25 ` [PATCH v3 07/10] docs/specs/tpm: Document TPM_TIS sysbus device for ARM Eric Auger
2020-02-26 13:17 ` Stefan Berger
2020-02-26 10:25 ` [PATCH v3 08/10] test: tpm: pass optional machine options to swtpm test functions Eric Auger
2020-02-26 12:28 ` Stefan Berger
2020-02-26 10:25 ` [PATCH v3 09/10] test: tpm-tis: Get prepared to share tests between ISA and sysbus devices Eric Auger
2020-02-26 13:39 ` Stefan Berger [this message]
2020-02-26 10:25 ` [PATCH v3 10/10] test: tpm-tis: Add Sysbus TPM-TIS device test Eric Auger
2020-02-26 13:44 ` Stefan Berger
2020-02-26 13:32 ` [PATCH v3 00/10] vTPM for aarch64 Stefan Berger
2020-02-26 17:47 ` Auger Eric
2020-02-26 17:53 ` Stefan Berger
2020-02-26 18:18 ` Auger Eric
2020-02-26 20:01 ` Stefan Berger
2020-02-26 20:17 ` Auger Eric
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bea97d7f-cae2-20ad-b3f0-b1822f5857a9@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=ardb@kernel.org \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=lersek@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).