qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v3 09/10] test: tpm-tis: Get prepared to share tests between


From: Stefan Berger
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1

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 <address@hidden>
---
  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 <address@hidden>





reply via email to

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