Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp194472ybf; Thu, 27 Feb 2020 19:05:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzkEXAom898YX1odN65kou1Xzol1xun0Qpcly2SGuYPKRR5dNM1qLuHnHxt2xSlzPxGviMY X-Received: by 2002:a05:6830:150:: with SMTP id j16mr1590322otp.301.1582859125461; Thu, 27 Feb 2020 19:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582859125; cv=none; d=google.com; s=arc-20160816; b=Y58fgg8EH9OXXgT/gbtErDIJcBxgpa/I5HsAPKbv8h+vOupvhvIieWnLvQ1XcAOzWD 2JP1toV8aByFUGkIPIrr4F15DeDBRyaywY0fjyR7I7lxtpPkRSvamIofuiWHb2U8OERC AsqpKCYiv9BPUOZa9lAgSp4zFPlqDakIw7MdD4DvhCjGgljxbnOUoO/NqBMXm6apxP+O Tg7urkqhC/AYYr3EGNLHAa2Tya3eW5x7SHOnlhtYYgCRkP3heOaVpn/2/7B68gYNyI59 Gq2qA2iT2MS2zHeGzYLK7mEHsBHVMTdg36tDT7qbpHYByBkXGGRjJ8ET3MOpDn9L9p6u Vp0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZXz1vNLB8/3nlHC9N4OcdycspiXBE+FVYT8mp12OHEQ=; b=VvVwAb0ITexGp5LCGyu3rR3EyrQ87zYtECouNd45X5DuwWqb2X+gyPL8e+PlWucHbK TODW9Lhyxrh0Nm60PNfnCktXmI4t4dst3o1zQj9oHlY12VEzKvP4wPXI2sRX3NU0zI3J 1uNvFFphgNgFvmzKUx8WtzI26cfUvAx3BJ8qVSqdQ5+l8NMRjE9OK0MFHSbEL6m2JT94 CBXrWaRxYzEbpb92jUJLvLt9G3PUSJ1tZ0aRW7kmhfdEIYaitf+7/wbOkwy3rAj8Yi/f Redi6o1uaTRxovMpZWCR4w7X+oMx92dulZ8azhn2SsRbX/XA6l/zY+IApjm2XHdUzQko KtYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si1051959oif.256.2020.02.27.19.05.13; Thu, 27 Feb 2020 19:05:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730765AbgB1DEz (ORCPT + 99 others); Thu, 27 Feb 2020 22:04:55 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:22270 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730520AbgB1DEz (ORCPT ); Thu, 27 Feb 2020 22:04:55 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01S33k2c141895; Thu, 27 Feb 2020 22:04:49 -0500 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 2yepxantqx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Feb 2020 22:04:49 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01S32RkC032687; Fri, 28 Feb 2020 03:04:48 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma04dal.us.ibm.com with ESMTP id 2yepv2sn2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Feb 2020 03:04:48 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01S34ml053084438 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Feb 2020 03:04:48 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9230328094; Fri, 28 Feb 2020 03:04:45 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECD4C280BD; Fri, 28 Feb 2020 03:03:33 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 28 Feb 2020 03:03:33 +0000 (GMT) From: Stefan Berger To: jarkko.sakkinen@linux.intel.com, linux-integrity@vger.kernel.org Cc: aik@ozlabs.ru, david@gibson.dropbear.id.au, linux-kernel@vger.kernel.org, nayna@linux.vnet.ibm.com, gcwilson@linux.ibm.com, jgg@ziepe.ca, Stefan Berger Subject: [PATCH v5 1/3] tpm: of: Handle IBM,vtpm20 case when getting log parameters Date: Thu, 27 Feb 2020 22:03:28 -0500 Message-Id: <20200228030330.18081-2-stefanb@linux.vnet.ibm.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200228030330.18081-1-stefanb@linux.vnet.ibm.com> References: <20200228030330.18081-1-stefanb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-27_08:2020-02-26,2020-02-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 priorityscore=1501 adultscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002280026 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Berger A vTPM 2.0 is identified by 'IBM,vtpm20' in the 'compatible' node in the device tree. Handle it in the same way as 'IBM,vtpm'. The vTPM 2.0's log is written in little endian format so that for this aspect we can rely on existing code. Signed-off-by: Stefan Berger Acked-by: Jarkko Sakkinen --- drivers/char/tpm/eventlog/of.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/eventlog/of.c b/drivers/char/tpm/eventlog/of.c index af347c190819..a31a625ad44e 100644 --- a/drivers/char/tpm/eventlog/of.c +++ b/drivers/char/tpm/eventlog/of.c @@ -17,6 +17,12 @@ #include "../tpm.h" #include "common.h" +static const char * const compatibles[] = { + "IBM,vtpm", + "IBM,vtpm20", + NULL +}; + int tpm_read_log_of(struct tpm_chip *chip) { struct device_node *np; @@ -51,7 +57,7 @@ int tpm_read_log_of(struct tpm_chip *chip) * endian format. For this reason, vtpm doesn't need conversion * but physical tpm needs the conversion. */ - if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) { + if (!of_device_compatible_match(np, compatibles)) { size = be32_to_cpup((__force __be32 *)sizep); base = be64_to_cpup((__force __be64 *)basep); } else { -- 2.23.0