[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL v2 20/58] bios-tables-test: Add Q35/TPM-TIS test
From: |
Thomas Huth |
Subject: |
Re: [PULL v2 20/58] bios-tables-test: Add Q35/TPM-TIS test |
Date: |
Mon, 15 Jun 2020 12:22:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 15/06/2020 12.02, Philippe Mathieu-Daudé wrote:
> On Fri, Jun 12, 2020 at 5:00 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>>
>> From: Eric Auger <eric.auger@redhat.com>
>>
>> Test tables specific to the TPM-TIS instantiation.
>> The TPM2 is added in the framework. Also the DSDT
>> is updated with the TPM. The new function should be
>> be usable for CRB as well, later one.
>>
>> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>>
>> Message-Id: <20200609125409.24179-5-eric.auger@redhat.com>
>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>> tests/qtest/bios-tables-test.c | 58 ++++++++++++++++++++++++++++++++++
>> tests/qtest/Makefile.include | 1 +
>> 2 files changed, 59 insertions(+)
>>
>> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
>> index c9843829b3..53f104a9c5 100644
>> --- a/tests/qtest/bios-tables-test.c
>> +++ b/tests/qtest/bios-tables-test.c
>> @@ -57,6 +57,9 @@
>> #include "qemu/bitmap.h"
>> #include "acpi-utils.h"
>> #include "boot-sector.h"
>> +#include "tpm-emu.h"
>> +#include "hw/acpi/tpm.h"
>> +
>>
>> #define MACHINE_PC "pc"
>> #define MACHINE_Q35 "q35"
>> @@ -874,6 +877,60 @@ static void test_acpi_piix4_tcg_numamem(void)
>> free_test_data(&data);
>> }
>>
>> +uint64_t tpm_tis_base_addr;
>> +
>> +static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
>> + uint64_t base)
>> +{
>> + gchar *tmp_dir_name = g_strdup_printf("qemu-test_acpi_%s_tcg_%s.XXXXXX",
>> + machine, tpm_if);
>> + char *tmp_path = g_dir_make_tmp(tmp_dir_name, NULL);
>> + TestState test;
>> + test_data data;
>> + GThread *thread;
>> + char *args, *variant = g_strdup_printf(".%s", tpm_if);
>> +
>> + tpm_tis_base_addr = base;
>> +
>> + module_call_init(MODULE_INIT_QOM);
>> +
>> + test.addr = g_new0(SocketAddress, 1);
>> + test.addr->type = SOCKET_ADDRESS_TYPE_UNIX;
>> + test.addr->u.q_unix.path = g_build_filename(tmp_path, "sock", NULL);
>> + g_mutex_init(&test.data_mutex);
>> + g_cond_init(&test.data_cond);
>> + test.data_cond_signal = false;
>> +
>> + thread = g_thread_new(NULL, tpm_emu_ctrl_thread, &test);
>> + tpm_emu_test_wait_cond(&test);
>> +
>> + memset(&data, 0, sizeof(data));
>> + data.machine = machine;
>> + data.variant = variant;
>> +
>> + args = g_strdup_printf(
>> + " -chardev socket,id=chr,path=%s"
>> + " -tpmdev emulator,id=dev,chardev=chr"
>
> This test makes our CI fail:
> https://gitlab.com/qemu-project/qemu/-/jobs/593586369#L3466
Right. The problem seems to occur as soon as you run "configure" with
"--disable-tpm" ... I think you need some "#ifdef CONFIG_TPM" here?
Thomas
- [PULL v2 09/58] acpi: move aml builder code for serial device, (continued)
- [PULL v2 09/58] acpi: move aml builder code for serial device, Michael S. Tsirkin, 2020/06/12
- [PULL v2 11/58] acpi: move aml builder code for parallel device, Michael S. Tsirkin, 2020/06/12
- [PULL v2 13/58] acpi: tpm: Do not build TCPA table for TPM 2, Michael S. Tsirkin, 2020/06/12
- [PULL v2 15/58] acpi: Move build_tpm2() in the generic part, Michael S. Tsirkin, 2020/06/12
- [PULL v2 16/58] arm/acpi: TPM2 ACPI table support, Michael S. Tsirkin, 2020/06/12
- [PULL v2 12/58] tests/acpi: update DSDT expected files, Michael S. Tsirkin, 2020/06/12
- [PULL v2 19/58] tests: tpm-emu: Remove assert on TPM2_ST_NO_SESSIONS, Michael S. Tsirkin, 2020/06/12
- [PULL v2 21/58] bios-tables-test: Generate reference tables for Q35/TPM-TIS, Michael S. Tsirkin, 2020/06/12
- [PULL v2 20/58] bios-tables-test: Add Q35/TPM-TIS test, Michael S. Tsirkin, 2020/06/12
[PULL v2 24/58] virtio-balloon: unref the iothread when unrealizing, Michael S. Tsirkin, 2020/06/12
[PULL v2 22/58] virtio-balloon: fix free page hinting without an iothread, Michael S. Tsirkin, 2020/06/12
[PULL v2 23/58] virtio-balloon: fix free page hinting check on unrealize, Michael S. Tsirkin, 2020/06/12
[PULL v2 27/58] MAINTAINERS: Fix the classification of bios-tables-test-allowed-diff.h, Michael S. Tsirkin, 2020/06/12
[PULL v2 28/58] hw/pci/pcie: Move hot plug capability check to pre_plug callback, Michael S. Tsirkin, 2020/06/12
[PULL v2 29/58] pci: assert configuration access is within bounds, Michael S. Tsirkin, 2020/06/12
[PULL v2 26/58] virtio-balloon: Provide an interface for free page reporting, Michael S. Tsirkin, 2020/06/12
[PULL v2 33/58] hw/pci-host: Use the IEC binary prefix definitions, Michael S. Tsirkin, 2020/06/12