public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Cohen, Eugene" <eugene@hp.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Zhang, Chao B" <chao.b.zhang@intel.com>
Cc: "Bin, Sung-Uk (???)" <sunguk-bin@hp.com>,
	"Chae, Matthew" <matthew.chae@hp.com>
Subject: Re: [RFC] TPM non-MMIO Access
Date: Fri, 9 Nov 2018 23:11:44 +0000	[thread overview]
Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F3DF98C@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <CS1PR8401MB11890C611ADA1561093387CDB4C60@CS1PR8401MB1189.NAMPRD84.PROD.OUTLOOK.COM>

Hi Eugene
Complete agree.


1)      please ignore TpmCommLib. It is deprecated. :)


2)      we did notice there is non-MMIO TPM device before and abstract the device access via Tpm2DeviceLib and Tpm12DeviceLib library class. The Tpm2DeviceLibDTpm and Tpm12DeviceLibDTpm are the library instance for MMIO TIS access.

We do have other instance such as QuarkPlatformPkg\Library\Tpm12DeviceLibAtmelI2c or QuarkPlatformPkg\Library\Tpm12DeviceLibInfineonI2c.


3)      Tcg2Config is also a TPM device oriented driver. It is optional.
You may want to take a look at QuarkPlatformPkg\Quark.dsc to see different TPM device is chosen.

  #
  # TPM 1.2 Hardware.  Options are [NONE, LPC, ATMEL_I2C, INFINEON_I2C]
  #
  DEFINE TPM_12_HARDWARE      = NONE

Thank you
Yao Jiewen

From: Cohen, Eugene [mailto:eugene@hp.com]
Sent: Saturday, November 10, 2018 6:38 AM
To: edk2-devel@lists.01.org; Zhang, Chao B <chao.b.zhang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
Cc: Bin, Sung-Uk (빈성욱) <sunguk-bin@hp.com>; Chae, Matthew <matthew.chae@hp.com>
Subject: [RFC] TPM non-MMIO Access

Dear SecurityPkg maintainers,

We are trying to use the SecurityPkg TPM support (Tcg2Config, Tpm2DeviceLibDTpm, etc) and see that access to the TPM are using the MMIO routines such as MmioRead8().

Not all platforms support memory-mapped access to the TPM so we would like to propose that we create a library to abstract the TPM access, called the TpmIoLib.  One instance of the library would provide the Mmio (TpmIoLibMmio) method but others can use protocols like SPI (TpmIoLibSpi).

Before starting this work I wanted to check if you agree with the approach of replacing the Mmio calls with new TpmIoLib ones.  We can upstream the library header and mmio library instance (or you could do the work if you think it would be easier for you).

I counted up the number of instances of unique MMIO calls in the TPM libraries and got

Library/TpmCommLib/TisPc.c:7
Library/Tpm2DeviceLibDTpm/Tpm2Tis.c:13
Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c:29
Library/Tpm12DeviceLibDTpm/Tpm12Tis.c:16

Please let me know if this works for you and how you'd like to structure the change.

Thanks,

Eugene





  reply	other threads:[~2018-11-09 23:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-09 22:37 [RFC] TPM non-MMIO Access Cohen, Eugene
2018-11-09 23:11 ` Yao, Jiewen [this message]
2018-11-09 23:17 ` Yao, Jiewen
     [not found]   ` <AT5PR8401MB0897901965373899E2D9351DF4C10@AT5PR8401MB0897.NAMPRD84.PROD.OUTLOOK.COM>
2018-11-12  4:33     ` Yao, Jiewen
2018-11-12 13:58       ` Cohen, Eugene
2018-11-12 16:44         ` Kinney, Michael D
2018-11-12 20:23           ` Cohen, Eugene
2018-11-13  2:13             ` Bin, Sung-Uk (빈성욱)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74D8A39837DF1E4DA445A8C0B3885C503F3DF98C@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox