<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/tpm, branch releng/12.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2020-02-04T20:09:25Z</updated>
<entry>
<title>MFC r357349:</title>
<updated>2020-02-04T20:09:25Z</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2020-02-04T20:09:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=be39f9d9344c9c86d1dc752d6dfdf9be2c2df147'/>
<id>urn:sha1:be39f9d9344c9c86d1dc752d6dfdf9be2c2df147</id>
<content type='text'>
Merge r357348 from the clang 10.0.0 import branch:

Disable new clang 10.0.0 warnings about converting the result of shift
operations to a boolean in tpm(4):

sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '&lt;&lt;' to a boolean; did you mean '(1 &lt;&lt; (0)) != 0'? [-Werror,-Wint-in-bool-context]
        WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
                                      ^
sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
#define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
                                        ^
sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
#define BIT(x) (1 &lt;&lt; (x))
                  ^

Such warnings can be useful in C++ contexts, but not so much in kernel
drivers, where this type of bit twiddling is commonplace.  So disable it
for this case.

MFC r357366:

Revert r357349, since the clang 10.0.0 warning was actually correct, and
the ! operator should have been a ~ instead:

  Merge r357348 from the clang 10.0.0 import branch:

  Disable new clang 10.0.0 warnings about converting the result of
  shift operations to a boolean in tpm(4):

  sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '&lt;&lt;' to a boolean; did you mean '(1 &lt;&lt; (0)) != 0'? [-Werror,-Wint-in-bool-context]
	  WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
					^
  sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
  #define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
					  ^
  sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
  #define BIT(x) (1 &lt;&lt; (x))
		    ^

  Such warnings can be useful in C++ contexts, but not so much in kernel
  drivers, where this type of bit twiddling is commonplace.  So disable
  it for this case.

Noticed by:	cem

MFC r357367:

Fix new clang 10.0.0 warnings about converting the result of shift
operations to a boolean in tpm(4):

  sys/dev/tpm/tpm_crb.c:301:32: error: converting the result of '&lt;&lt;' to a boolean; did you mean '(1 &lt;&lt; (0)) != 0'? [-Werror,-Wint-in-bool-context]
	  WR4(sc, TPM_CRB_CTRL_CANCEL, !TPM_CRB_CTRL_CANCEL_CMD);
					^
  sys/dev/tpm/tpm_crb.c:73:34: note: expanded from macro 'TPM_CRB_CTRL_CANCEL_CMD'
  #define TPM_CRB_CTRL_CANCEL_CMD         BIT(0)
					  ^
  sys/dev/tpm/tpm20.h:60:19: note: expanded from macro 'BIT'
  #define BIT(x) (1 &lt;&lt; (x))
		    ^

In this case, the intent was to clear the zeroth bit, and leave the rest
unaffected.  Therefore, the ~ operator should be used instead.

Noticed by:	cem

MFC r357388:

Amend r357367 by using register values from the TPM datasheet.

As Ian Lepore noted, writing ~1 to a register might have a completely
different effect than doing a regular read-modify-write operation.

Follow the TCG_PC_Client_Platform_TPM_Profile_PTP_2.0_r1.03_v22
datasheet instead, and use the actual values mentioned there:
(uint32_t)1 to cancel the command, (uint32_t)0 to clear the field.

MFC r357391 (by kib):

Fix build.

Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>MFC r345438,r345842,r346259,r346261: TPM as possible entropy source</title>
<updated>2019-04-26T01:41:55Z</updated>
<author>
<name>Marcin Wojtas</name>
<email>mw@FreeBSD.org</email>
</author>
<published>2019-04-26T01:41:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=092bc1f24282107d75f2418474234563ed7be80e'/>
<id>urn:sha1:092bc1f24282107d75f2418474234563ed7be80e</id>
<content type='text'>
r345438:
Allow using TPM as entropy source

TPM has a built-in RNG, with its own entropy source.
The driver was extended to harvest 16 random bytes from TPM every 10 seconds.
A new build option "TPM_HARVEST" was introduced - for now, however, it
is not enabled by default in the GENERIC config.

r345842:
Add a cv_wait to the TPM2.0 harvesting function

r346259:
tpm: Prevent session hijack

r346261:
Improve tpm20 style

Submitted by: Kornel Duleba &lt;mindal@semihalf.com&gt;
Obtained from: Semihalf
Sponsored by: Stormshield
</content>
</entry>
<entry>
<title>MFC r343438: Use ACPI TPM2 table to probe tpmtis and tpmcrb device</title>
<updated>2019-04-26T01:29:00Z</updated>
<author>
<name>Marcin Wojtas</name>
<email>mw@FreeBSD.org</email>
</author>
<published>2019-04-26T01:29:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=90305687f89599101693552724ebb3ee0cf48d3c'/>
<id>urn:sha1:90305687f89599101693552724ebb3ee0cf48d3c</id>
<content type='text'>
Sponsored by: Stormshield
</content>
</entry>
<entry>
<title>MFC r342084,r342251,r342271,r342285: Introduce TPM2.0 driver</title>
<updated>2019-04-26T01:02:14Z</updated>
<author>
<name>Marcin Wojtas</name>
<email>mw@FreeBSD.org</email>
</author>
<published>2019-04-26T01:02:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=32866af6371ccebfe2468efdc9ebe5bf2908f2cf'/>
<id>urn:sha1:32866af6371ccebfe2468efdc9ebe5bf2908f2cf</id>
<content type='text'>
r342084
Introduce driver for TPM 2.0 in CRB and FIFO (TIS) modes

r342251
Include the new TPM 2.0 driver in the TPM module.

r342271
Fix obtaining RSP address in TPM CRB for non-amd64 platforms

r342285
tpm(4): Fix GCC build after r342084 (TPM 2.0 driver commit)

Submitted by: Kornel Duleba &lt;mindal@semihalf.com&gt;
Obtained from: Semihalf
Sponsored by: Stormshield
</content>
</entry>
<entry>
<title>Remove dead code.</title>
<updated>2017-04-06T22:21:49Z</updated>
<author>
<name>David E. O'Brien</name>
<email>obrien@FreeBSD.org</email>
</author>
<published>2017-04-06T22:21:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9b6f7440b52ef1ce76d408a54ba5c9f68d6c0bd9'/>
<id>urn:sha1:9b6f7440b52ef1ce76d408a54ba5c9f68d6c0bd9</id>
<content type='text'>
The #ifdef __FreeBSD__ section within the OpenBSD tpm_attach() implementation
can never be active.
</content>
</entry>
<entry>
<title>Consistently use `device_t`</title>
<updated>2016-08-09T19:32:06Z</updated>
<author>
<name>Jean-Sébastien Pédron</name>
<email>dumbbell@FreeBSD.org</email>
</author>
<published>2016-08-09T19:32:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bd937497ea2a1111d9cf6ff1cdbe698b3cdd430a'/>
<id>urn:sha1:bd937497ea2a1111d9cf6ff1cdbe698b3cdd430a</id>
<content type='text'>
Several files use the internal name of `struct device` instead of
`device_t` which is part of the public API. This patch changes all
`struct device *` to `device_t`.

The remaining occurrences of `struct device` are those referring to the
Linux or OpenBSD version of the structure, or the code is not built on
FreeBSD and it's unclear what to do.

Submitted by:	Matthew Macy &lt;mmacy@nextbsd.org&gt; (previous version)
Approved by:	emaste, jhibbits, sbruno
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D7447
</content>
</entry>
<entry>
<title>sys/dev: minor spelling fixes.</title>
<updated>2016-05-03T03:41:25Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2016-05-03T03:41:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=453130d9bfc1c6d68b366dfcb041689d69f81295'/>
<id>urn:sha1:453130d9bfc1c6d68b366dfcb041689d69f81295</id>
<content type='text'>
Most affect comments, very few have user-visible effects.
</content>
</entry>
<entry>
<title>In sys/dev/tpm/tpm.c, #if 0 an unused static function.</title>
<updated>2013-12-29T19:55:06Z</updated>
<author>
<name>Dimitry Andric</name>
<email>dim@FreeBSD.org</email>
</author>
<published>2013-12-29T19:55:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=29deb2257c325991fff8ff0e7c1f6a803d63d25c'/>
<id>urn:sha1:29deb2257c325991fff8ff0e7c1f6a803d63d25c</id>
<content type='text'>
MFC after:	3 days
</content>
</entry>
<entry>
<title>Add tpm(4) driver for Trusted Platform Module.</title>
<updated>2010-08-12T00:16:18Z</updated>
<author>
<name>Takanori Watanabe</name>
<email>takawata@FreeBSD.org</email>
</author>
<published>2010-08-12T00:16:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=97f24f666faf69a512fc3c2bd8ee3d11b41e51ef'/>
<id>urn:sha1:97f24f666faf69a512fc3c2bd8ee3d11b41e51ef</id>
<content type='text'>
You may want to look at http://bsssd.sourceforge.net/ .

Submitted by: Hans-Joerg Hoexer &lt;Hans-Joerg_Hoexer@genua.de&gt;
</content>
</entry>
</feed>
