Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp910253ybv; Thu, 13 Feb 2020 11:51:12 -0800 (PST) X-Google-Smtp-Source: APXvYqw082DVgIYCSJ2meLKK1yqezkLddQ+9YM85hC/XEZgov9XMGz3IbwB1HdSYofiBigrN8QBy X-Received: by 2002:a05:6830:2361:: with SMTP id r1mr14062297oth.88.1581623472301; Thu, 13 Feb 2020 11:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581623472; cv=none; d=google.com; s=arc-20160816; b=yLgBP8Zjx8Oet5BHJ5OUQSv7qO5g7exVCZ4eWPwpZkMXL0TZDipSrt4gLkeHdltbu3 Fgft7+0Frj8pBtrf/0hK/EWkGQ1pG1So7WmW89XlG5wzSp/b0hVQUnpmvwiuqksAYR6D U/9yH+DTslj4byj+AKQATUjsyGq/jwS/kL8+p9CONpZWuDhlw2wqOPxvsn8FtldNXQRa ZuKFVTwkDPxhUwTAdNbciTs8cTvgxqOsMNZ+mpM3qGiDGq/tkMNFPdFXATazIwzybsDp /k1v379l3LdqUIUZ6nhtI8M0PHcfHczG/diYI9yxbAefsUYMrtqzqMXH9PpRG4ELZpZx wUnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XlaiOyPoTQiX3Vuk5cpUfnsu7dczUQOtR8OVBPBHL2Q=; b=wSdGWbFLGxZeDUPFc4LY0sIQ1z6DrJqd3WAb9K6s7ychp1FGPpXb7gywM+9MPl52pQ qWQFekrYvghpVZiP5B/ioStSgsLmvMlTrJrbBj0Z5vyjinSEtSxBmJsZg3L8kqVJHwaz t3JXhzdKRoYKRRwqlFzB2iVKLmBLryEudy1WqP/cx5g4t7dhfBUiB5xTFce6FAsMtzEn k61DU1Zwxv0kIjL/AvXVuui98Sun1FXm+ATT4AiXpf6iUfxtX/Pp+tY/typzB3U80PQV ZzaXvtXCPxdAURNZ4mJk7iZ2l7KinnPgKJ6rroL2TyvtBtwHjz+1psWxkkIjOY8ygQiJ S69g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=BEZPNvbe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si1585575otn.232.2020.02.13.11.51.00; Thu, 13 Feb 2020 11:51:12 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=BEZPNvbe; 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 S1727705AbgBMTjK (ORCPT + 99 others); Thu, 13 Feb 2020 14:39:10 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:41115 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbgBMTjK (ORCPT ); Thu, 13 Feb 2020 14:39:10 -0500 Received: by mail-qt1-f195.google.com with SMTP id l21so5278937qtr.8 for ; Thu, 13 Feb 2020 11:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=XlaiOyPoTQiX3Vuk5cpUfnsu7dczUQOtR8OVBPBHL2Q=; b=BEZPNvbeyYNK/rkYNeYs+pAx9VhBbGgIK42BBDiaeEZQFWkmSyPpZf/3OD6811cvPm MqFJoj9UFOrc+TNfmDilBfGC7JPw0kjXWKlPPNHAdyoYEZ955JrWn57xcemXy7p0gbtZ UWXdPAHWkS0HzgAPzlSKOonk6c+Qkd3lbZbjyWccVMfcUtrj55lP4L2Dw+0tsRo5hosR PsVHq+JPLxr1mS9wHSEOdM0wBaB89bLYeBqUpOLbHDcpLQtYWjj5vw3yWdAhmkU9qiUZ 7vdMLPiOvTuOprkvmTnZP2hRpY+GuWq7Tp2BwmktG1K8xAxVJlo/yDkvxe8+53Wac5++ DCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=XlaiOyPoTQiX3Vuk5cpUfnsu7dczUQOtR8OVBPBHL2Q=; b=Xb3ncrQWGmravpZr7HnDiOPdFppQgPX93h5dPfTm41iMygOvg0BU0M1N7ezLTCXncn 9P2Kq0PmDovgVckZk1LcONOaVoDWskvqW6WwtTUgOfPwUVhr7CXHVv/CFLZY3Zf1j+de ZMipyM0oc0LAUsYgt/Cz++lKfZo1rjO0D/PfOF1r5LFZHkWFIxqF74Qp3S7OJKBbAtnp iYjWG5e2xVa+mCo0B7rzW02enA+cVVftINnb/Kj2thH37WNDUWkBNri05AkHspLZxipj gl1xtNtdBMKFKh0/m+qXGePpwJUymPlMix9B73fmhyCJ8BkkfJvHpDNrQfehVYxKX96m xs4w== X-Gm-Message-State: APjAAAWkgmEKEvbWScq0UvXxUxdQsuwVSt0RdRH5f6GU8wcnGhyGsPK6 GAhGMXfg4jMyFnKsOpPKKUcwwg== X-Received: by 2002:ac8:1ac1:: with SMTP id h1mr13069458qtk.255.1581622749372; Thu, 13 Feb 2020 11:39:09 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id d18sm1847436qke.75.2020.02.13.11.39.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Feb 2020 11:39:08 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1j2KKK-0005Oy-Bd; Thu, 13 Feb 2020 15:39:08 -0400 Date: Thu, 13 Feb 2020 15:39:08 -0400 From: Jason Gunthorpe To: Stefan Berger Cc: Nayna , Stefan Berger , linux-integrity@vger.kernel.org, aik@ozlabs.ru, david@gibson.dropbear.id.au, linux-kernel@vger.kernel.org, gcwilson@linux.ibm.com Subject: Re: [PATCH 3/3] tpm: ibmvtpm: Add support for TPM 2 Message-ID: <20200213193908.GP31668@ziepe.ca> References: <20200204132706.3220416-1-stefanb@linux.vnet.ibm.com> <20200204132706.3220416-4-stefanb@linux.vnet.ibm.com> <20200213183508.GL31668@ziepe.ca> <20200213191108.GO31668@ziepe.ca> <1e301947-a8f3-0b7d-d86c-5bfe04a68a75@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1e301947-a8f3-0b7d-d86c-5bfe04a68a75@linux.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 02:15:03PM -0500, Stefan Berger wrote: > On 2/13/20 2:11 PM, Jason Gunthorpe wrote: > > On Thu, Feb 13, 2020 at 02:04:12PM -0500, Stefan Berger wrote: > > > On 2/13/20 1:35 PM, Jason Gunthorpe wrote: > > > > On Thu, Feb 13, 2020 at 01:20:12PM -0500, Stefan Berger wrote: > > > > > > > > > I don't want side effects for the TPM 1.2 case here, so I am only modifying > > > > > the flag for the case where the new TPM 2 is being used.  Here's the code > > > > > where it shows the effect. > > > > I'm surprised this driver is using AUTO_STARTUP, it was intended for > > > > embedded cases where their is no firmware to boot the TPM. > > > The TIS is also using it on any device. > > TIS is a generic driver, and can run on TPMs without firmware > > support. It doesn't know either way > > The following drivers are all using it: > > > drivers/char/tpm/st33zp24/st33zp24.c, line 493 > drivers/char/tpm/tpm-interface.c, line 374 > drivers/char/tpm/tpm_crb.c, line 421 > drivers/char/tpm/tpm_ftpm_tee.c, line 184 > drivers/char/tpm/tpm_i2c_atmel.c, line 139 > drivers/char/tpm/tpm_i2c_infineon.c, line 602 > drivers/char/tpm/tpm_i2c_nuvoton.c, line 465 > drivers/char/tpm/tpm_tis_core.c, line 917 > drivers/char/tpm/tpm_vtpm_proxy.c, line 435 > > https://elixir.bootlin.com/linux/latest/ident/TPM_OPS_AUTO_STARTUP These are all general purpose drivers. Though perhaps vtpm_proxy shouldn't include it, not sure. > > > > Chips using AUTO_STARTUP are basically useless for PCRs/etc. > > > > > > > > I'd expect somthing called vtpm to have been started and PCRs working > > > > before Linux is started?? > > > Yes, there's supposed to be firmware. > > > > > > I only see one caller to tpm2_get_cc_attrs_tbl(chip), which is necessary to > > > call. This caller happens to be in tpm2_auto_startup. > > That seems to be a mistake, proper startup of the driver should never > > require auto_startup. > > Is this IBM vTPM driver special that it should do things differently than > all those drivers listed above? From looking at the code is seems it is to > be set for the TPM 2.0 case. Any driver that knows the TPM must be started prior to Linux booting should not use the flag. vtpm drivers in general would seem to be the case where we can make this statement. If it was mandatory then it would not be a flag the driver has to specify. Jason