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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jennifer Herbert <jennifer.herbert@xxxxxxxxxx>
  • Date: Wed, 3 May 2023 00:29:49 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=nnOUfgqG72GzlNLoWtCu9JubUWnp35TFYzuwlitj5yg=; b=YuIuVMJWsBt5FmpTJVbUB4jUYSLJQ8sC+1doBAs0Mzlq45fs15kgqxMo04iz5usFdwzM1sb6yaXFJtf0Ug04RzJnkNsjLGZ5MLTgEvN4ED6Gr7+UQLzgpP39y63xta8A+wPvJvEfyGSvsUisALGw9o9Zol/ezOzM/atyP6Ze7KScrLANM041MbVRJnQW/HGPV1zoa7V+HpjjzN/8ThsWbiceDO27mHOg3bgTBXbc8IysSh0n+PFcIrbW8uRq1TDnH+iFMpdujMTDSmwn2HNwz68wgybunU4+sx7hQRjmD3MOf4nbScyKn6xOtQWd6F9oegPJZ5/LJkWC39F5BpfVKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LVR4DddfZ3VJmR/6dMjgtHSn1mo4zeA5vuSO0NwBDd0InMmvuZ7pCLPvzUynRO8Waqr0EWQZx53EV6C46UsPKJyOvdblBJfuWlm9zBm9jkMeYyNh1MUkkstTiudunpBKdbc1WfJkGdiIDOo2e5sqEtK71JTgO6aqZ0HzVNM9FDwdZooYxzM67NibvQvV+05/9ZMFk3KiN37R12dKM4PAlTTi7sGh7+pUCOrzaHxsUO/DOrl+V5tWo7IQFaNhbpFXYRBiyNJamJ64n98m36tJBfxBBpJCWe/IPeKwuDOs4fDs+I40+YOkOEmAmK2uiBTjnXafqnh3bVxGZRined8d1A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 02 May 2023 23:30:32 +0000
  • Ironport-data: A9a23:Da4lkqMDv4yCtgrvrR2/lsFynXyQoLVcMsEvi/4bfWQNrUp20mQHy GBOCmjQPfuIamL8ctEkYdyy8EoHu5WBzdRqHgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvPrRC9H5qyo42tF5gZmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0ttUAkpi1 +wfEwFOfgKkvO2c76i8FfY506zPLOGzVG8ekldJ6GiASNwAEdXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PpxujaCpOBy+OGF3N79eNGMQ8Rbk1zep m/c9WnjHjkRNcCFyCrD+XWp7gPKtXqjCNpPTuHnp5aGhnW8nn04GDE8b2KrsMGQm0jhBYldA G0br39GQa8asRbDosPGdx+yrWOAvxUcc8FNCOB84waIooLE7gDcCmUaQzppbN09qNRwVTEsz kWOnd7iGXpoqrL9dJ6G3rKdrDf3My5FK2YHPHYAVVFcvYilp5wvhBXSSNolCLSyktD+BTD3x XaNsTQ6gLIQy8UM0s1X4Gz6vt5lnbCRJiZd2+kddjv+hu+lTOZJv7CV1GU=
  • Ironport-hdrordr: A9a23:dAQUaq19z5GohPKf+9JByQqjBdVxeYIsimQD101hICG9Lfb0qy n+pp4mPEHP4wr5OEtOpTlPAtjmfZq6z+8O3WBxB8bYYOCCggeVxe5ZnOjfKlHbalTDH6tmpN 9dmstFeaLN5DpB7foSiTPQe7hA/DDEytHPuQ639QYQcegAUdAE0+4WMHf+LqQ7fnglOXJvf6 Dsm/av6gDQMEj+Ka+Adwo4dtmGg+eOuIPtYBYACRJiwA6SjQmw4Lq/PwmE0gwYWzZvx65n1W TeiQT26oiqrvn+k3bnpiLuxqUTvOGk5spIBcSKhMRQAjLwijywbIAkd6yesCszqOSP7k9vtN XXuR8vM+l69nuUVGCophnG3RXmzV8VmjXf4G7dpUGmjd3yRTo8BcYErYVFciHB405lmN1nyq pE00+QqpISVHr77W/AzumNcysvulu/oHIkn+JWp3tDUbEGYLsUiYAE5ktaHLoJASq/woE6F+ tFCt3a+Z9tABunRkGcmlMq7M2nX3w1EBvDak8euvaN2zwTp3x9x1tw/r1qol4wsLYGD7VU7e XNNapl0JtUSNUNUK57DOAdBeOqF23kW3v3QSOvCGWiMJtCF2PGqpbx7rlwzvqtYoY0wJw7n4 mEeE9EtFQ1Z1nlBaS1rdN2Gyj2MSaAtAnWu4NjD8ATgMy4eFOrC1zNdLkWqbrhnx1FaferH8 paO/ptcorexCXVaMF0NjbFKulvwEklIbMoU+kAKiOzS+LwW/rXX7/gAYDuDYuoNwoYcUXCJV ZGdATPBax7nzKWsznD8VTsZ08=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02/05/2023 14:41, Jan Beulich wrote:
On 25.04.2023 19:47, Jennifer Herbert wrote:
--- a/tools/libacpi/acpi2_0.h
+++ b/tools/libacpi/acpi2_0.h
@@ -121,6 +121,36 @@ struct acpi_20_tcpa {
  };
  #define ACPI_2_0_TCPA_LAML_SIZE (64*1024)
+/*
+ * TPM2
+ */
Nit: While I'm willing to accept the comment style violation here as
(apparently) intentional, ...

Well, I was trying to keep the file consistant.   As far as I can tell, this styling is used thoughout the file - unless I'm misunderstanding your 'Nit'. (You object to a multi-line coment used for a single line? )
But I'm codes style blind, so just say how you want it.


+struct acpi_20_tpm2 {
+    struct acpi_header header;
+    uint16_t platform_class;
+    uint16_t reserved;
+    uint64_t control_area_address;
+    uint32_t start_method;
+    uint8_t start_method_params[12];
+    uint32_t log_area_minimum_length;
+    uint64_t log_area_start_address;
+};
+#define TPM2_ACPI_CLASS_CLIENT      0
+#define TPM2_START_METHOD_CRB       7
+
+/* TPM register I/O Mapped region, location of which defined in the
+ * TCG PC Client Platform TPM Profile Specification for TPM 2.0.
+ * See table 9 - Only Locality 0 is used here. This is emulated by QEMU.
+ * Definition of Register space is found in table 12.
+ */
... this comment wants adjusting to hypervisor style (/* on its own line),
as that looks to be the aimed-at style in this file.

Will do.


@@ -352,6 +353,7 @@ static int construct_secondary_tables(struct acpi_ctxt 
*ctxt,
      struct acpi_20_tcpa *tcpa;
      unsigned char *ssdt;
      void *lasa;
+    struct acpi_20_tpm2 *tpm2;
Could I talk you into moving this up by two lines, such that it'll be
adjacent to "tcpa"?


No problem.


@@ -450,6 +452,43 @@ static int construct_secondary_tables(struct acpi_ctxt 
*ctxt,
                               tcpa->header.length);
              }
              break;
+
+        case 2:
+            /* Check VID stored in bits 37:32 (3rd 16 bit word) of CRB
+             * identifier register.  See table 16 of TCG PC client platform
+             * TPM profile specification for TPM 2.0.
+             */
Nit: This comment again wants a style adjustment.

ok


--- /dev/null
+++ b/tools/libacpi/ssdt_tpm2.asl
@@ -0,0 +1,36 @@
+/*
+ * ssdt_tpm2.asl
+ *
+ * Copyright (c) 2018-2022, Citrix Systems, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
While the full conversion to SPDX was done in the hypervisor only so far,
I think new tool stack source files would better use the much shorter
SPDX equivalent, too.

OK, this is where I get a bit confused.  I belive I copied the licence from ssdt_tpm.asl, for consistancy.

So I think i need to use a 'LGPL-2.1-only' but then it says its using exceptions on linking as discribed in LICENSE, but um, which LICENSE file?  So i'm not sure what exception I should be adding. Do you know?


Then on top of Jason's R-b,
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


Thanks,

-jenny




 


Rackspace

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