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

Re: [PATCH 1/2] acpi: Make TPM version configurable.


  • To: Jennifer Herbert <jennifer.herbert@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 19 Sep 2022 12:19:26 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xw+BMow05VRz5iuOzQEnbtb0xxj8OkDZVK3R17H9mro=; b=m6TlVWkYl//Z7eM0JQhuOK+1hBCeKnlEbT69b8rth0tEGAJG8J/kOSsM0y+sbTt7KcgyRz3rbBUQ5Xe+SsO94JbjHgO7EJi9woCyq86VhcFmlFv4AlK/fqrw1m8kQ5ewbJtEMDoYhoawRkc0BWBS23H1sb3+hlnS8tvj6Ec8sICeab2Q7TsgpBH+m0LneHwKqZ4gw+RWa3Nvb1DxqywJfDPsG+fpnhVBUhQltMgMcrd5otGtGu4mKq4au1oHsH5JvySa3U0pPZtv/LKsrH0CPRfPIDGn8f7hWFLC7QiOgMaNgMJcyCszexmKofZ+9L39SWTl0XccfQccmsYa55qY2g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WujtaAusYGVYRNW8sBTyZY1UrcnqrKmqECpEa1jim+dzGR+YCpvYwmEJko6yVaKrAZGGbi+y6gR5JWFhOjh5MLfkUctbKJSzfaSXmtg+yD6Z5chZQE898eEKmIJhljJjMDWxHjVnE8P+4Rl/BH1deusb7mhYco6SMVDhT6zHuOrTc2IrOdtksQtkCILcXOodUFJSpB7lbn5+Xv/jjrWSErpRZA5+kTfThiCnk+QJMwk6S6OkjqNbQy8Xx1swkxEaXctVyZ8r1JGrgLEkYR57LA2Ac3z0ASJxMP/eDHC4+Kjq/e952Bu9ny8bOImtCQma3pdbNB9lJFYEGBuqrrsAKg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, wl@xxxxxxx, roger.pau@xxxxxxxxxx
  • Delivery-date: Mon, 19 Sep 2022 10:19:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.09.2022 22:40, Jennifer Herbert wrote:

First of all - please follow patch submission guidelines and
send patches To: the list only, with maintainers Cc:-ed.

> --- a/tools/firmware/hvmloader/util.c
> +++ b/tools/firmware/hvmloader/util.c
> @@ -994,13 +994,22 @@ void hvmloader_acpi_build_tables(struct acpi_config 
> *config,
>      if ( !strncmp(xenstore_read("platform/acpi_laptop_slate", "0"), "1", 1)  
> )
>          config->table_flags |= ACPI_HAS_SSDT_LAPTOP_SLATE;
>  
> -    config->table_flags |= (ACPI_HAS_TCPA | ACPI_HAS_IOAPIC |
> +    config->table_flags |= (ACPI_HAS_TPM | ACPI_HAS_IOAPIC |
>                              ACPI_HAS_WAET | ACPI_HAS_PMTIMER |
>                              ACPI_HAS_BUTTONS | ACPI_HAS_VGA |
>                              ACPI_HAS_8042 | ACPI_HAS_CMOS_RTC);

Did you not mean to drop ACPI_HAS_TPM here when ...

>      config->acpi_revision = 4;
>  
> -    config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
> +    s = xenstore_read("platform/tpm_version", "0");
> +    config->tpm_version = strtoll(s, NULL, 0);
> +
> +    switch( config->tpm_version )
> +    {
> +    case 1:
> +        config->table_flags |= ACPI_HAS_TPM;

... you now OR it in here? Or else what use is this statement?

As to the use of strtoll() - I realize we have nothing else in
hvmloader, but I'm still weary of the overflow potential. Just
a remark, not really something to act upon.

> @@ -78,8 +78,8 @@ struct acpi_config {
>      struct acpi_numa numa;
>      const struct hvm_info_table *hvminfo;
>  
> +    uint8_t tpm_version;
>      const uint16_t *tis_hdr;
> -
>      /*
>       * Address where acpi_info should be placed.
>       * This must match the OperationRegion(BIOS, SystemMemory, ....)

Please don't remove the blank line here.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.