From nobody Thu May 2 03:54:53 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623461135668837.1140405086944; Fri, 11 Jun 2021 18:25:35 -0700 (PDT) Received: from localhost ([::1]:46852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrsP0-00076e-L8 for importer2@patchew.org; Fri, 11 Jun 2021 21:25:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsLA-0003Lg-4Q for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsL6-0004mN-KC for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:35 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15C13XPb115235 for ; Fri, 11 Jun 2021 21:21:31 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 394hmbhnuy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 Jun 2021 21:21:31 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15C1G7uj188875 for ; Fri, 11 Jun 2021 21:21:30 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 394hmbhnup-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jun 2021 21:21:30 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15C1Bu8f000323; Sat, 12 Jun 2021 01:21:29 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma04dal.us.ibm.com with ESMTP id 3900wahdhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 12 Jun 2021 01:21:29 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15C1LTrK29884892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 Jun 2021 01:21:29 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E06F0112064; Sat, 12 Jun 2021 01:21:28 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6A9F11206B; Sat, 12 Jun 2021 01:21:28 +0000 (GMT) Received: from localhost.localdomain (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 12 Jun 2021 01:21:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=s5tIOR2SHzn676rLMft8dQeAuHoI4E5PKQBUu8sFdbg=; b=hgrq9uKFEXLbUJIZmrAJicY9864ab2Rd/wz7RaWUuo2CuHzGohzGEOI83T8ZzIygyQmL aOrnt8KX2C3ba/abJOITg338/yNK57huwUiqfaNgBFoMfjxEb66UqZcWMAPA5V+x31XG kTHFhq5pIaqe1PlXtO7hyYUnlGrsBrDYaj7c1p4E74Dg6ZSs60xM/BlrY32rJ3EPnLfN O2jZlUn3wjY6p0y7UZDJnhmU+eP89U6c3fIU7vCCb3S3rLbmJOXG4XVQkXUjC/80xE2C ZExTenraITO4C1ivBFzcfhmxS2dUIkgdGzFAt/N84m1aUA4t+4teXCrVm8swzjXdCu2r JQ== From: Stefan Berger To: armbru@redhat.com, qemu-devel@nongnu.org Subject: [RFC PATCH V1 1/3] acpi: Eliminate all TPM related code if CONFIG_TPM is not set Date: Fri, 11 Jun 2021 21:21:00 -0400 Message-Id: <20210612012102.1820063-2-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210612012102.1820063-1-stefanb@linux.ibm.com> References: <20210612012102.1820063-1-stefanb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: rRzjlthlY0ukQ-DsHElMf_gelh3ez0js X-Proofpoint-ORIG-GUID: 2JMVHzNGFwEirwRE2Inaw91hUj6okF89 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-11_06:2021-06-11, 2021-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106120006 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , "M : Michael S . Tsirkin" , philmd@redhat.com, Stefan Berger Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Cc: M: Michael S. Tsirkin Cc: Igor Mammedov Signed-off-by: Stefan Berger --- hw/acpi/aml-build.c | 2 ++ hw/arm/virt-acpi-build.c | 2 ++ hw/i386/acpi-build.c | 20 ++++++++++++++++++++ include/hw/acpi/tpm.h | 4 ++++ stubs/tpm.c | 4 ---- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index f0035d2b4a..d5103e6d7b 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -2044,6 +2044,7 @@ build_hdr: "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_= id); } =20 +#ifdef CONFIG_TPM /* * build_tpm2 - Build the TPM2 table as specified in * table 7: TCG Hardware Interface Description Table Format for TPM 2.0 @@ -2101,6 +2102,7 @@ void build_tpm2(GArray *table_data, BIOSLinker *linke= r, GArray *tcpalog, (void *)(table_data->data + tpm2_start), "TPM2", table_data->len - tpm2_start, 4, oem_id, oem_tabl= e_id); } +#endif =20 Aml *build_crs(PCIHostState *host, CrsRangeSet *range_set, uint32_t io_off= set, uint32_t mmio32_offset, uint64_t mmio64_offset, diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 60fe2e65a7..6b3c1fdb0a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -745,11 +745,13 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuild= Tables *tables) build_iort(tables_blob, tables->linker, vms); } =20 +#ifdef CONFIG_TPM if (tpm_get_version(tpm_find()) =3D=3D TPM_VERSION_2_0) { acpi_add_table(table_offsets, tables_blob); build_tpm2(tables_blob, tables->linker, tables->tcpalog, vms->oem_= id, vms->oem_table_id); } +#endif =20 /* XSDT is pointed to by RSDP */ xsdt =3D tables_blob->len; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 80bee00da6..796ffc6f5c 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -107,7 +107,9 @@ typedef struct AcpiPmInfo { typedef struct AcpiMiscInfo { bool is_piix4; bool has_hpet; +#ifdef CONFIG_TPM TPMVersion tpm_version; +#endif const unsigned char *dsdt_code; unsigned dsdt_size; uint16_t pvpanic_port; @@ -286,7 +288,9 @@ static void acpi_get_misc_info(AcpiMiscInfo *info) } =20 info->has_hpet =3D hpet_find(); +#ifdef CONFIG_TPM info->tpm_version =3D tpm_get_version(tpm_find()); +#endif info->pvpanic_port =3D pvpanic_port(); info->applesmc_io_base =3D applesmc_port(); } @@ -1371,7 +1375,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, uint32_t nr_mem =3D machine->ram_slots; int root_bus_limit =3D 0xFF; PCIBus *bus =3D NULL; +#ifdef CONFIG_TPM TPMIf *tpm =3D tpm_find(); +#endif int i; VMBusBridge *vmbus_bridge =3D vmbus_bridge_find(); =20 @@ -1604,10 +1610,12 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } } =20 +#ifdef CONFIG_TPM if (TPM_IS_TIS_ISA(tpm_find())) { aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); } +#endif aml_append(scope, aml_name_decl("_CRS", crs)); =20 /* reserve GPE0 block resources */ @@ -1753,6 +1761,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, /* Scan all PCI buses. Generate tables to support hotplug. */ build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en); =20 +#ifdef CONFIG_TPM if (TPM_IS_TIS_ISA(tpm)) { if (misc->tpm_version =3D=3D TPM_VERSION_2_0) { dev =3D aml_device("TPM"); @@ -1780,11 +1789,13 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, =20 aml_append(scope, dev); } +#endif =20 aml_append(sb_scope, scope); } } =20 +#ifdef CONFIG_TPM if (TPM_IS_CRB(tpm)) { dev =3D aml_device("TPM"); aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); @@ -1799,6 +1810,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, =20 aml_append(sb_scope, dev); } +#endif =20 aml_append(dsdt, sb_scope); =20 @@ -1828,6 +1840,7 @@ build_hpet(GArray *table_data, BIOSLinker *linker, co= nst char *oem_id, "HPET", sizeof(*hpet), 1, oem_id, oem_table_id); } =20 +#ifdef CONFIG_TPM static void build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog, const char *oem_id, const char *oem_table_id) @@ -1854,6 +1867,7 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker= , GArray *tcpalog, (void *)(table_data->data + tcpa_start), "TCPA", sizeof(*tcpa), 2, oem_id, oem_table_id); } +#endif =20 #define HOLE_640K_START (640 * KiB) #define HOLE_640K_END (1 * MiB) @@ -2403,6 +2417,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) build_hpet(tables_blob, tables->linker, x86ms->oem_id, x86ms->oem_table_id); } +#ifdef CONFIG_TPM if (misc.tpm_version !=3D TPM_VERSION_UNSPEC) { if (misc.tpm_version =3D=3D TPM_VERSION_1_2) { acpi_add_table(table_offsets, tables_blob); @@ -2414,6 +2429,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState= *machine) x86ms->oem_id, x86ms->oem_table_id); } } +#endif if (pcms->numa_nodes) { acpi_add_table(table_offsets, tables_blob); build_srat(tables_blob, tables->linker, machine); @@ -2605,8 +2621,10 @@ void acpi_setup(void) AcpiBuildTables tables; AcpiBuildState *build_state; Object *vmgenid_dev; +#ifdef CONFIG_TPM TPMIf *tpm; static FwCfgTPMConfig tpm_config; +#endif =20 if (!x86ms->fw_cfg) { ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); @@ -2638,6 +2656,7 @@ void acpi_setup(void) acpi_add_rom_blob(acpi_build_update, build_state, tables.linker->cmd_blob, ACPI_BUILD_LOADER_FILE); =20 +#ifdef CONFIG_TPM fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, tables.tcpalog->data, acpi_data_len(tables.tcpalog)); =20 @@ -2651,6 +2670,7 @@ void acpi_setup(void) fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config", &tpm_config, sizeof tpm_config); } +#endif =20 vmgenid_dev =3D find_vmgenid_dev(); if (vmgenid_dev) { diff --git a/include/hw/acpi/tpm.h b/include/hw/acpi/tpm.h index 1a2a57a21f..559ba6906c 100644 --- a/include/hw/acpi/tpm.h +++ b/include/hw/acpi/tpm.h @@ -21,6 +21,8 @@ #include "hw/acpi/aml-build.h" #include "sysemu/tpm.h" =20 +#ifdef CONFIG_TPM + #define TPM_TIS_ADDR_BASE 0xFED40000 #define TPM_TIS_ADDR_SIZE 0x5000 =20 @@ -209,4 +211,6 @@ REG32(CRB_DATA_BUFFER, 0x80) =20 void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev); =20 +#endif /* CONFIG_TPM */ + #endif /* HW_ACPI_TPM_H */ diff --git a/stubs/tpm.c b/stubs/tpm.c index b1dc6370a5..524e534cb1 100644 --- a/stubs/tpm.c +++ b/stubs/tpm.c @@ -17,7 +17,3 @@ int tpm_init(void) void tpm_cleanup(void) { } - -void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev) -{ -} --=20 2.31.1 From nobody Thu May 2 03:54:53 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623461018709795.6586055295401; Fri, 11 Jun 2021 18:23:38 -0700 (PDT) Received: from localhost ([::1]:43536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrsN7-0004sH-KA for importer2@patchew.org; Fri, 11 Jun 2021 21:23:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsL9-0003Ku-DV for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:7690 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsL6-0004mG-7B for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:35 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15C1BFCD016382; Fri, 11 Jun 2021 21:21:30 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 394he6hqs2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jun 2021 21:21:30 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15C1Bkds017213; Fri, 11 Jun 2021 21:21:30 -0400 Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 394he6hqrr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jun 2021 21:21:30 -0400 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15C1Bhr3031283; Sat, 12 Jun 2021 01:21:29 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03wdc.us.ibm.com with ESMTP id 3900wamduq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 12 Jun 2021 01:21:29 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15C1LTBk11469616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 Jun 2021 01:21:29 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0CC48112061; Sat, 12 Jun 2021 01:21:29 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9B2B112062; Sat, 12 Jun 2021 01:21:28 +0000 (GMT) Received: from localhost.localdomain (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 12 Jun 2021 01:21:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=7/ioXR/riVFYSCqi/dL7Zdgg5fuGeBmvHmnV8GGkww0=; b=Mw4bpdDxqHu3M3ZM5LwXXjGmA/LYUbzX84YG/JAY/ERBVeRX9lHBrrKjcOIwx3cytIPL vJ+MdpUx1eaY17sca0c4roMXtSIHMisRkXXSybKaG8ck+ZAGJhv4oiQPlefYsEUOiGy5 9LmoCA9N4Kls3ZhhOA6sSHo0VNsiiAzIL0b+TBBxbReoAehsCAi+gjVN9ZbDAjTVyRnF +X4/Kjph3RnAzJEK2k8DH5HBAOsCq8ieppeFRArsdQZBPnVmwxOw1AemCynUO+8OcZjo m1AVbREZUYW1HKoX0yGPtDr6V1AJUmUdfrc9+Ikfcn9BnQvTlAjKcndPIueDlUqpSPj8 0A== From: Stefan Berger To: armbru@redhat.com, qemu-devel@nongnu.org Subject: [RFC PATCH V1 2/3] arm: Eliminate all TPM related code if CONFIG_TPM is not set Date: Fri, 11 Jun 2021 21:21:01 -0400 Message-Id: <20210612012102.1820063-3-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210612012102.1820063-1-stefanb@linux.ibm.com> References: <20210612012102.1820063-1-stefanb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: pxoRldQHGPso2suqswdupIQeJqKtlQpZ X-Proofpoint-GUID: HtGRH1DWWqoT6MzuLgV7ekjv_77WkzUv X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-11_06:2021-06-11, 2021-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 phishscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106120006 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , philmd@redhat.com, Stefan Berger Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Cc: Peter Maydell Signed-off-by: Stefan Berger --- hw/arm/sysbus-fdt.c | 4 ++++ hw/arm/virt-acpi-build.c | 4 ++++ hw/arm/virt.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c index 6b6906f4cf..48c5fe9bf1 100644 --- a/hw/arm/sysbus-fdt.c +++ b/hw/arm/sysbus-fdt.c @@ -437,6 +437,7 @@ static bool vfio_platform_match(SysBusDevice *sbdev, =20 #endif /* CONFIG_LINUX */ =20 +#ifdef CONFIG_TPM /* * add_tpm_tis_fdt_node: Create a DT node for TPM TIS * @@ -467,6 +468,7 @@ static int add_tpm_tis_fdt_node(SysBusDevice *sbdev, vo= id *opaque) g_free(nodename); return 0; } +#endif =20 static int no_fdt_node(SysBusDevice *sbdev, void *opaque) { @@ -488,7 +490,9 @@ static const BindingEntry bindings[] =3D { TYPE_BINDING(TYPE_VFIO_AMD_XGBE, add_amd_xgbe_fdt_node), VFIO_PLATFORM_BINDING("amd,xgbe-seattle-v1a", add_amd_xgbe_fdt_node), #endif +#ifdef CONFIG_TPM TYPE_BINDING(TYPE_TPM_TIS_SYSBUS, add_tpm_tis_fdt_node), +#endif TYPE_BINDING(TYPE_RAMFB_DEVICE, no_fdt_node), TYPE_BINDING("", NULL), /* last element */ }; diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 6b3c1fdb0a..f1024843dd 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -205,6 +205,7 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMap= Entry *gpio_memmap, aml_append(scope, dev); } =20 +#ifdef CONFIG_TPM static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) { PlatformBusDevice *pbus =3D PLATFORM_BUS_DEVICE(vms->platform_bus_dev); @@ -236,6 +237,7 @@ static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineSt= ate *vms) aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); } +#endif =20 static void build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) @@ -642,7 +644,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) } =20 acpi_dsdt_add_power_button(scope); +#ifdef CONFIG_TPM acpi_dsdt_add_tpm(scope, vms); +#endif =20 aml_append(dsdt, scope); =20 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 840758666d..9122e22ee0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2599,7 +2599,9 @@ static void virt_machine_class_init(ObjectClass *oc, = void *data) machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_AMD_XGBE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_PLATFORM); +#ifdef CONFIG_TPM machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); +#endif mc->block_default_type =3D IF_VIRTIO; mc->no_cdrom =3D 1; mc->pci_allow_0_address =3D true; --=20 2.31.1 From nobody Thu May 2 03:54:53 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1623461012; cv=none; d=zohomail.com; s=zohoarc; b=KcJ3JbLTB0/QDIMUmocsBYgn0x7cAUjEbClbSp3mKvDsUKhW+9FCHoKPpMBsa2+0M0Pj6RX4Xj0QyUopgRqMcyitoyJUStt6kg7K0Ftt8NHOixj9i2BV5WSQ79jvf8NANfybJf9nVn+ULnTveV9yohAloFmq4Bo5DU/AlFJuios= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623461012; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h1o7KKgUStOdLLysRc4MxZJlHgqrrn4DT6m5rrt2cIg=; b=LXLB315Ljkrb4HCt8ZGLO5m6NC9lVph+6pEnlWEXE+greB55iEF3BZoHa5KfmetYIJ4xUIGMDT/pyp7N92JSpnvdvPxDXyd7IF3sdK3j26TtS/PGc5IEu5s+J07rGtIOUjoMYJg8rntmivCvPiDXtyl06YZ6d3aoB/LWCtHLf+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623461012837720.5979991163341; Fri, 11 Jun 2021 18:23:32 -0700 (PDT) Received: from localhost ([::1]:43396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrsN1-0004m5-Qa for importer2@patchew.org; Fri, 11 Jun 2021 21:23:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsL8-0003Kf-94 for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:5650 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrsL6-0004mB-22 for qemu-devel@nongnu.org; Fri, 11 Jun 2021 21:21:34 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15C14BtM130955 for ; Fri, 11 Jun 2021 21:21:30 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 394fjx443t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 11 Jun 2021 21:21:30 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 15C14RO5131833 for ; Fri, 11 Jun 2021 21:21:30 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 394fjx443q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Jun 2021 21:21:30 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15C1DFwB026051; Sat, 12 Jun 2021 01:21:29 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01wdc.us.ibm.com with ESMTP id 3900w9vd8p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 12 Jun 2021 01:21:29 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15C1LThg9175558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 12 Jun 2021 01:21:29 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A57A112062; Sat, 12 Jun 2021 01:21:29 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0DCE8112063; Sat, 12 Jun 2021 01:21:29 +0000 (GMT) Received: from localhost.localdomain (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 12 Jun 2021 01:21:29 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=h1o7KKgUStOdLLysRc4MxZJlHgqrrn4DT6m5rrt2cIg=; b=WBZwX/mO0EKctcpZ2bjEe/WFlG4h3W10VBr5EKdv3f8I9y8LtKntO8+jEpMtdhpvyvrt 0e9CqcN0RkKDfycpDTrZ2OeV44K+LIT1HLw6tXXVRqPixqelSMkCmXtV5lu3fQ0RM4iP UAfl6Och/4YYB6O+puQ9DST37InSQJBpTfICjd/CUiCx57/s3iUsoNmplJ34i2MZk1xQ dOLV7+hWlNOA62AX71MmGZJZKGX3qzdrsKegcQez+F0jcakCvfff8s7mK9E1Mk69i7zG y8lrpJD7ZmgCwgz0y2aUcCquKTa9Que6gr/qynhc7nrVYozPRjj9UMShwFqeHBT1lghS tg== From: Stefan Berger To: armbru@redhat.com, qemu-devel@nongnu.org Subject: [RFC PATCH V1 3/3] sysemu: Make TPM structures inaccessible if CONFIG_TPM is not defined Date: Fri, 11 Jun 2021 21:21:02 -0400 Message-Id: <20210612012102.1820063-4-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210612012102.1820063-1-stefanb@linux.ibm.com> References: <20210612012102.1820063-1-stefanb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: E88AAAZ1Y3r91xlbCHeZa7I_PzIu_n8T X-Proofpoint-ORIG-GUID: rdrK42gYxYArienyGtvTCoJ9tgkSI42n X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-11_06:2021-06-11, 2021-06-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106120006 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=stefanb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, Stefan Berger Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @ibm.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Stefan Berger Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/sysemu/tpm.h | 6 +++++- include/sysemu/tpm_backend.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 1a85564e47..2ca3fa32ee 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -15,10 +15,12 @@ #include "qapi/qapi-types-tpm.h" #include "qom/object.h" =20 -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); int tpm_init(void); void tpm_cleanup(void); =20 +#ifdef CONFIG_TPM +int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); + typedef enum TPMVersion { TPM_VERSION_UNSPEC =3D 0, TPM_VERSION_1_2 =3D 1, @@ -73,4 +75,6 @@ static inline TPMVersion tpm_get_version(TPMIf *ti) return TPM_IF_GET_CLASS(ti)->get_version(ti); } =20 +#endif /* CONFIG_TPM */ + #endif /* QEMU_TPM_H */ diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 6f078f5f48..8fd3269c11 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -18,6 +18,8 @@ #include "sysemu/tpm.h" #include "qapi/error.h" =20 +#ifdef CONFIG_TPM + #define TYPE_TPM_BACKEND "tpm-backend" OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass, TPM_BACKEND) @@ -209,4 +211,6 @@ TPMInfo *tpm_backend_query_tpm(TPMBackend *s); =20 TPMBackend *qemu_find_tpm_be(const char *id); =20 -#endif +#endif /* CONFIG_TPM */ + +#endif /* TPM_BACKEND_H */ --=20 2.31.1