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

Re: [PATCH 2/2] acpi: Add TPM2 interface definition.


  • To: Jennifer Herbert <jennifer.herbert@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 19 Sep 2022 12:30:46 +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=dr+IfXt0NMB0EKOt8VY3rXX1XSMAnYxBCKrKyzgMbOU=; b=iw/SRyyTaIvfm9HKSlEm/UivwFY4i2f7jcjFKi/z6Qhx5QjqNAk4joz+2gGCuTz7j+O3/noJ7WQxhMIg1ITAB1AkD4JC7V1kP4e8oS/EhJAh1ZS4e27pVPO4ZUKFqvW5UFtXdTHcxbXEjb8henxk7R8p53iYRsLukWXRai+qtV4qL6qvKrNFoAd6SbyiL6/T7oLlAyU8BgBjymXQ083yVERufGrSWULGX8CjvZry/rGasFyot9CL8o31uvswIyNX/ojkBdHGK1NKkca1t3Tovo/xw1OB+WIQYMoRboenKFdG95vEhiliAlZoVT2OkCSJR/cA+MGhVO/soyRTTHJk6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hExYrSg6/TBs4hlj3oNh/4rKbOfYZayuMElHZAe6Xg4qT3rqbMPhSvXuxeXie5Lv7ylCZZ/eqTbLH/JgdkLWvpKHOw74shi9SAGAehKur22AsIPKuW3FglrzsTgfRjo9BEJf6rMtJo+yKLxLB8C1J9cjNFlslHij6NWQ3CAOM51/Tb4StoIxOh0qvxldKchWIIvTCDZW6fsbIMcKRTJ8cCthUN/HNNOSKDRPR94S8ZoODUWVgl0wGpdkPy8MW4cN+m8Oq8vy5awWarCiQceemrzAJJRrvkvdGWSZz7mex1p0XFQLRXBcyY4mORV9Pq0pjUyOnOBUrTpovirGHQwzVQ==
  • 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:30:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.09.2022 22:40, Jennifer Herbert wrote:
> --- a/tools/firmware/hvmloader/config.h
> +++ b/tools/firmware/hvmloader/config.h
> @@ -56,6 +56,7 @@ extern uint8_t ioapic_version;
>  #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
>  
>  #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL
> +#define ACPI_CRB_HDR_ADDRESS 0xFED40034UL

I understand it may not be feasible to express this here as a proper
derivation from other constants, but then you want to have a
BUILD_BUG_ON() somewhere making (and guaranteeing) the connection.
Thi may of course involve moving the #define to a header which both
hvmloader and libacpi can (legitimately) include.

> --- a/tools/firmware/hvmloader/util.c
> +++ b/tools/firmware/hvmloader/util.c
> @@ -1009,6 +1009,13 @@ void hvmloader_acpi_build_tables(struct acpi_config 
> *config,
>          config->table_flags |= ACPI_HAS_TPM;
>          config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
>          break;
> +    case 2:
> +        config->table_flags |= ACPI_HAS_TPM;
> +        config->crb_hdr = (uint16_t *)ACPI_CRB_HDR_ADDRESS;
> +
> +        mem_hole_populate_ram(TPM_LOG_AREA_ADDRESS >> PAGE_SHIFT, 
> TPM_LOG_SIZE >> PAGE_SHIFT);

Nit: Long line.

> +        memset((void *)(TPM_LOG_AREA_ADDRESS), 0, TPM_LOG_SIZE);

No need to parenthesize the operand of the cast?

Jan



 


Rackspace

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