Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp958000imu; Fri, 16 Nov 2018 13:07:45 -0800 (PST) X-Google-Smtp-Source: AJdET5fwZws3AR93wQeD2M94tYZ7O7smEPJoK9S0vuSmSEb3b1dpIaqCv9X9gUZBA88uFOaWBApj X-Received: by 2002:a65:6491:: with SMTP id e17mr11310490pgv.418.1542402465087; Fri, 16 Nov 2018 13:07:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y68-v6si34837377pfi.61.2018.11.16.13.07.28; Fri, 16 Nov 2018 13:07:45 -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; arc=fail (body hash mismatch); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726074AbeKQHUv convert rfc822-to-8bit (ORCPT + 99 others); Sat, 17 Nov 2018 02:20:51 -0500 Received: from sender-of-o53.zoho.com ([135.84.80.218]:21771 "EHLO sender-of-o53.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbeKQHUv (ORCPT ); Sat, 17 Nov 2018 02:20:51 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1542402396; cv=none; d=zoho.com; s=zohoarc; b=Vhbg/k+WWIdXNOhy4eXFAnRaDhu5a0ACDD09USJ1C7DscYplNDZAdpN732+gF7DQ7omvzizQI0h9vEFor2JNj63WTw+gxwYM+APmLEHfTrlvnFOUbs03Q1rYoTUs07ICZWch0Pg6xahKAnUh0ZlHqQzCoRVjHXq1JXKngmYM+Pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1542402396; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=MokZj39AinDCRmdSKKljWwTriRDPBu5RvYl+huNjliU=; b=MTEd0BvORE8F+msoX3TWxOY6xvM3Ax+DFyXw/vhIFfURY0lQt24RNX4Xe/eovlM52Jnsc0VArmR8lGztZpYUXd9aKz+K8cdMUZihZfaUEW9RyXb3OtmXiArw3FNZjqKdp7mUNPdXLo794t8f0/FBTZ83fZPFEZoNjzwil71TokI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=mniewoehner.de; spf=pass smtp.mailfrom=linux@mniewoehner.de; dmarc=pass header.from= header.from= Received: from z3r0 (31.187.91.78 [31.187.91.78]) by mx.zohomail.com with SMTPS id 1542402392185349.79672657272124; Fri, 16 Nov 2018 13:06:32 -0800 (PST) Message-ID: Subject: Re: [BUG] Nuvoton NCPT650 TPM 2.0 mode not working From: Michael =?ISO-8859-1?Q?Niew=F6hner?= To: Mimi Zohar , James Bottomley , peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, jgg@ziepe.ca, arnd@arndb.de, linux-integrity@vger.kernel.org, linux-kernel , Nayna Jain In-Reply-To: <4f7cc7152f2266d8d0782889db2375d4c1c71987.camel@mniewoehner.de> References: <776f384a81466642472beb4a34b10f26f1de88e9.camel@mniewoehner.de> <1541960689.3190.4.camel@HansenPartnership.com> <1541962653.3190.7.camel@HansenPartnership.com> <7d8cc5ad4bb7548d283f363de6f24c90d5d0a2b2.camel@mniewoehner.de> <1541968191.3190.12.camel@HansenPartnership.com> <3243d0325b3ea5878d3f86b0ee4fec1498f21dc1.camel@mniewoehner.de> <660b0934bc16c8d195a2724f8be4ba8dfbe71134.camel@mniewoehner.de> <1541972556.3734.90.camel@linux.ibm.com> <4f7cc7152f2266d8d0782889db2375d4c1c71987.camel@mniewoehner.de> Content-Type: text/plain; charset="UTF-8" Date: Fri, 16 Nov 2018 22:06:28 +0100 Mime-Version: 1.0 X-Mailer: Evolution 3.28.5 Content-Transfer-Encoding: 8BIT X-ZohoMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-11-14 at 21:46 +0100, Michael Niewöhner wrote: > Hi all, > > I tried that patch mentioned by Mimi but it does not change anything for me. > > Then I did some more tests with different kernel configs and finally got TPM > working by > a) compiling TPM as modules and rmmod tpm* and re-modprobe tpm_tis. > > (initramfs) dmesg | grep -i tpm > [ 0.000000] efi: ACPI 2.0=0x9ea7e000 ACPI=0x9ea7e000 SMBIOS=0x9f5eb000 > SMBIOS 3.0=0x9f5ea000 ESRT=0x9c07d918 MEMATTR=0x9bea3018 > TPMEventLog=0x97cbb018 > [ 0.003793] ACPI: TPM2 0x000000009EAB7F70 000034 (v03 LENOVO TC- > S06 00001260 AMI 00000000) > (initramfs) rmmod tpm_crb tpm_tis tpm_tis_core tpm > (initramfs) modprobe tpm_tis > [ 44.956905] tpm_tis MSFT0101:00: 2.0 TPM (device-id 0xFE, rev-id 2) > > b) compiling TPM-support in-kernel and manually bind the ACPI device > > (initramfs) dmesg | grep -i tpm > [ 0.000000] efi: ACPI 2.0=0x9ea7e000 ACPI=0x9ea7e000 SMBIOS=0x9f5eb000 > SMBIOS > 3.0=0x9f5ea000 ESRT=0x9c07d918 MEMATTR=0x9bea3018 TPMEventLog=0x97cbb018 > [ 0.003546] ACPI: TPM2 0x000000009EAB7F70 000034 (v03 LENOVO TC-S06 > 00001260 > AMI 00000000) > (initramfs) echo MSFT0101:00 >/sys/bus/platform/drivers/tpm_tis/bind > [ 233.076079] tpm_tis MSFT0101:00: 2.0 TPM (device-id 0xFE, rev-id 2) > > > It seems to me, the kernel tries to enable the TPM to early... > > > Michael Looks like the manual driver bind works more or less but e.g reading hwrng does not work... # echo MSFT0101:00 >/sys/bus/platform/drivers/tpm_tis/bind [ 148.293302] tpm_tis MSFT0101:00: 2.0 TPM (device-id 0xFE, rev-id 2) # cat /sys/devices/virtual/misc/hw_random/rng_current tpm-rng-0 # cat /dev/hwrng >/dev/null cat: /dev/hwrng: Operation not permitted