Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2765264imu; Mon, 19 Nov 2018 05:51:33 -0800 (PST) X-Google-Smtp-Source: AJdET5eTTIKjPRO2a2EKZkTkfxSA3CJXDozt5TWrIfXs5kh5gaYP+6n2bV/GkrCpvQsWBJ8Lj8Fn X-Received: by 2002:a17:902:a81:: with SMTP id 1-v6mr22554905plp.20.1542635493032; Mon, 19 Nov 2018 05:51:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542635492; cv=none; d=google.com; s=arc-20160816; b=zpjXT51K8wuAj9P6dq36RExEQmrwxT1hEI2/2hIi28FI2oCGHOGXnag24IxEHXv5mt BuDex3l3DozOcy9cfjkc45BFPxfcnntC92h8xOeMgXv8lPkR6kvLAohcboWG/g9s0CTU ewkfJCReW2/TvRi7Bsq4cVPaYr+1Mt/MXVuYTukbeHABm7DHo/y9oOF5q3M+SQGWWtHL I+NXJOQr0u7MD65ZpbHp3JuqJgJDZibJxQW0HZTsulq/zPs73wZAwkspuv1SccR9nWGH Tdq2kGjgHDUz1fASgswN27mBfVpsj7OYI3E5FbSVsTjRYYaoVHFY/vt2hgcsX5WGUsN2 Qyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Rfu+2ecJVJ7q5WzeoxTRby2Trcns7xpe1cemQ45e6p8=; b=uBfFf/z3hKIQbSaBjP5ECjw9PHc8w0qIB+QPIvUV/JBr0FWLEbxiJKqP+NiM619agU FJ+QofDCHKhh/qoQS1lVD9nsSlY/arG4bZpi4tRKLCo9J5FVQoTzdobXWCJeq4//xhBs fndyBFDRhdriPAmkTHUCz8IW8e/iZFDEFShWBGluf7rpD7F6DS5bZ9DjJTxPO3Cbjdo7 Q+AGm5l/Ef1D1aOO4jt6UrFXv0WHFxcK92lKtbOJx3F4VaUL3ab3HNgRMwxnJhyPhTc+ Enh0XDMeDxmhmlhOSnqheiiAvGQla39E0OJsBQFdz9w5VSgsM1CpaajHEPE9zXbH5AJn xG9A== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si20070152pfb.152.2018.11.19.05.51.18; Mon, 19 Nov 2018 05:51:32 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729442AbeKTANl (ORCPT + 99 others); Mon, 19 Nov 2018 19:13:41 -0500 Received: from mga04.intel.com ([192.55.52.120]:17006 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727310AbeKTANl (ORCPT ); Mon, 19 Nov 2018 19:13:41 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Nov 2018 05:50:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,252,1539673200"; d="scan'208";a="282350706" Received: from tmuluk-mobl4.ger.corp.intel.com (HELO localhost) ([10.249.254.135]) by fmsmga006.fm.intel.com with ESMTP; 19 Nov 2018 05:49:57 -0800 Date: Mon, 19 Nov 2018 15:49:56 +0200 From: Jarkko Sakkinen To: Michael =?iso-8859-1?Q?Niew=F6hner?= Cc: Mimi Zohar , James Bottomley , peterhuewe@gmx.de, jgg@ziepe.ca, arnd@arndb.de, linux-integrity@vger.kernel.org, linux-kernel , Nayna Jain Subject: Re: [BUG] Nuvoton NCPT650 TPM 2.0 mode not working Message-ID: <20181119134956.GD8755@linux.intel.com> References: <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> <20181118081833.GH5897@linux.intel.com> <467833cc47247a55595d72426f46eeac1406eb04.camel@mniewoehner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <467833cc47247a55595d72426f46eeac1406eb04.camel@mniewoehner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 18, 2018 at 03:10:06PM +0100, Michael Niew?hner wrote: > On Sun, 2018-11-18 at 10:18 +0200, Jarkko Sakkinen wrote: > > On Fri, Nov 16, 2018 at 10:06:28PM +0100, Michael Niew?hner wrote: > > > 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 > > > > Can you check with trace-cmd start -p function -l 'tpm*'? > > > > /Jarkko > > > Hi Jarko, > > what output do you need exactly? TPM gets added with tpm_add_hwrng() and the callback that is called by hwrng subsystem is tpm_hwrng_read(). Obviously the former gets called (can be seen from the sysfs file). Just wondering if it ever reaches tpm_hwrng_read(). /Jarkko