<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/dev/acpi/tpm_acpi.c, branch lockdoc-9.3-vfs</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>Pull up following revision(s) (requested by riastradh in ticket #1495):</title>
<updated>2022-08-03T16:00:47+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T16:00:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=041f0bae70183514e3e452cbce4a36c3f0137745'/>
<id>041f0bae70183514e3e452cbce4a36c3f0137745</id>
<content type='text'>
	share/man/man4/tpm.4: revision 1.7
	sys/dev/ic/tpm.c: revision 1.17
	sys/dev/ic/tpmvar.h: revision 1.10
	sys/dev/ic/tpm.c: revision 1.18
	sys/dev/ic/tpm.c: revision 1.19
	sys/dev/acpi/tpm_acpi.c: revision 1.14
	sys/dev/ic/tpmreg.h: revision 1.10
	sys/dev/ic/tpmreg.h: revision 1.11
	sys/dev/ic/tpm.c: revision 1.21
	sys/dev/ic/tpm.c: revision 1.22
	sys/dev/ic/tpm.c: revision 1.23
	sys/dev/ic/tpm.c: revision 1.24
	sys/dev/ic/tpm.c: revision 1.25
	sys/dev/ic/tpmreg.h: revision 1.7
	sys/dev/ic/tpmreg.h: revision 1.8
	sys/dev/ic/tpmreg.h: revision 1.9
	sys/dev/ic/tpmvar.h: revision 1.8
	sys/dev/ic/tpmvar.h: revision 1.9

dev/ic/tpm: Tidy up headers.
- Add include guards.
- Add necessary includes.
- Sort includes.
- Use _BYTE_ORDER, not BYTE_ORDER, for public header.

dev/ic/tpm: Add missing line break in attach output.

dev/ic/tpm: Take advantage of entropy source if available.

If the tpm is deactivated, though, detach the entropy source so we
don't continue to try polling it -- it can't be activated without a
reboot anyway.

Add note about enabling TPM and rnd(4) source.

tpm(4): Handle TPM 2.0 random source too, and loop on short reads.
Tested on ThinkPad T480.

tpm(4): Preserve error if any on ending commands.
This way we don't spuriously suppress an error, such as
TPM_DEACTIVATED, in a loop where we rely on it.

tpm@acpi: Require only one locality's worth of register space.
We don't actually use the registers for the other localities, and
some older TPMs only have the first locality exposed via ACPI.


tpm(4): Fix disabling of rnd source if tpm is deactivated.

Nothing prevents a second worker from being queued when the first one
is about to do rnd_detach_source.  Instead, just set a flag so future
requests don't bother running a new thread; if there's a concurrent
one that's already been scheduled on another CPU, well, too bad, we
get a couple extra log messages but that's fine.

A better way to do this would probably be to detect whether the tpm
is deactivated at attach time, but that requires reading more of the
tpm spec than I care to do when there are alternative ways to
procrastinate like scrubbing the toilet.


tpm(4): Fix suspend and rework I/O transaction lock.

Use sc-&gt;sc_lock over individual I/O transactions, not open/close of
the whole device.  This way there is a bounded time before the tpm is
unbusied even if userland is getting at it, so userland can't hold up
suspend indefinitely.  Of course, the tpm might be suspended and
resumed in the middle of the user's session this way -- tough.

This limits the response buffer to 1024 bytes -- which is already a
bit hefty to have on the stack (but it's probably not very deep on
the stack from userland so maybe not a big deal).  If it turns out we
need more, we can use kmem to allocate a buffer on the heap, with the
caveat that it might fail.  This is necessary so that suspend doesn't
block indefinitely on uiomove in tpmread.


tpm(4): Nix TPM_BE16/TPM_BE32.  Just use sys/endian.h.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	share/man/man4/tpm.4: revision 1.7
	sys/dev/ic/tpm.c: revision 1.17
	sys/dev/ic/tpmvar.h: revision 1.10
	sys/dev/ic/tpm.c: revision 1.18
	sys/dev/ic/tpm.c: revision 1.19
	sys/dev/acpi/tpm_acpi.c: revision 1.14
	sys/dev/ic/tpmreg.h: revision 1.10
	sys/dev/ic/tpmreg.h: revision 1.11
	sys/dev/ic/tpm.c: revision 1.21
	sys/dev/ic/tpm.c: revision 1.22
	sys/dev/ic/tpm.c: revision 1.23
	sys/dev/ic/tpm.c: revision 1.24
	sys/dev/ic/tpm.c: revision 1.25
	sys/dev/ic/tpmreg.h: revision 1.7
	sys/dev/ic/tpmreg.h: revision 1.8
	sys/dev/ic/tpmreg.h: revision 1.9
	sys/dev/ic/tpmvar.h: revision 1.8
	sys/dev/ic/tpmvar.h: revision 1.9

dev/ic/tpm: Tidy up headers.
- Add include guards.
- Add necessary includes.
- Sort includes.
- Use _BYTE_ORDER, not BYTE_ORDER, for public header.

dev/ic/tpm: Add missing line break in attach output.

dev/ic/tpm: Take advantage of entropy source if available.

If the tpm is deactivated, though, detach the entropy source so we
don't continue to try polling it -- it can't be activated without a
reboot anyway.

Add note about enabling TPM and rnd(4) source.

tpm(4): Handle TPM 2.0 random source too, and loop on short reads.
Tested on ThinkPad T480.

tpm(4): Preserve error if any on ending commands.
This way we don't spuriously suppress an error, such as
TPM_DEACTIVATED, in a loop where we rely on it.

tpm@acpi: Require only one locality's worth of register space.
We don't actually use the registers for the other localities, and
some older TPMs only have the first locality exposed via ACPI.


tpm(4): Fix disabling of rnd source if tpm is deactivated.

Nothing prevents a second worker from being queued when the first one
is about to do rnd_detach_source.  Instead, just set a flag so future
requests don't bother running a new thread; if there's a concurrent
one that's already been scheduled on another CPU, well, too bad, we
get a couple extra log messages but that's fine.

A better way to do this would probably be to detect whether the tpm
is deactivated at attach time, but that requires reading more of the
tpm spec than I care to do when there are alternative ways to
procrastinate like scrubbing the toilet.


tpm(4): Fix suspend and rework I/O transaction lock.

Use sc-&gt;sc_lock over individual I/O transactions, not open/close of
the whole device.  This way there is a bounded time before the tpm is
unbusied even if userland is getting at it, so userland can't hold up
suspend indefinitely.  Of course, the tpm might be suspended and
resumed in the middle of the user's session this way -- tough.

This limits the response buffer to 1024 bytes -- which is already a
bit hefty to have on the stack (but it's probably not very deep on
the stack from userland so maybe not a big deal).  If it turns out we
need more, we can use kmem to allocate a buffer on the heap, with the
caveat that it might fail.  This is necessary so that suspend doesn't
block indefinitely on uiomove in tpmread.


tpm(4): Nix TPM_BE16/TPM_BE32.  Just use sys/endian.h.</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by maxv in ticket #336):</title>
<updated>2019-10-16T09:52:38+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2019-10-16T09:52:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=85935dea48302919c228f438691c4576c7d9a81c'/>
<id>85935dea48302919c228f438691c4576c7d9a81c</id>
<content type='text'>
	sys/dev/isa/tpm_isa.c: revision 1.6
	sys/dev/ic/tpm.c: revision 1.16
	sys/dev/isa/tpm_isa.c: revision 1.7
	sys/dev/acpi/tpm_acpi.c: revision 1.10
	sys/dev/acpi/tpm_acpi.c: revision 1.11
	sys/dev/ic/tpmreg.h: revision 1.5
	sys/dev/ic/tpmreg.h: revision 1.6
	sys/dev/acpi/tpm_acpi.c: revision 1.9
	sys/dev/ic/tpmvar.h: revision 1.5
	sys/dev/ic/tpmvar.h: revision 1.6
	sys/dev/ic/tpmvar.h: revision 1.7
	sys/dev/ic/tpm.c: revision 1.14
	share/man/man4/tpm.4: revision 1.5
	sys/dev/isa/tpm_isa.c: revision 1.5
	sys/dev/ic/tpm.c: revision 1.15

Improvements in tpm(4):
  - Remove interrupt support, do polling only, avoids unnecessary trouble.
  - Simplify a few things.
  - Fix the suspend function, the SaveState command is 0x98, not 0x9C.
  - Make the driver MP-safe.
  - Sync the man page with reality.

 -

Add suspend support for TPM 2.0 chips. Check the TPM response also for 1.2
chips. Unfortunately I cannot really test this change since ACPI suspend
does not work on any of my laptops.

 -

Provide a better abstraction for the TPM interface. Report it in the ioctl.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/isa/tpm_isa.c: revision 1.6
	sys/dev/ic/tpm.c: revision 1.16
	sys/dev/isa/tpm_isa.c: revision 1.7
	sys/dev/acpi/tpm_acpi.c: revision 1.10
	sys/dev/acpi/tpm_acpi.c: revision 1.11
	sys/dev/ic/tpmreg.h: revision 1.5
	sys/dev/ic/tpmreg.h: revision 1.6
	sys/dev/acpi/tpm_acpi.c: revision 1.9
	sys/dev/ic/tpmvar.h: revision 1.5
	sys/dev/ic/tpmvar.h: revision 1.6
	sys/dev/ic/tpmvar.h: revision 1.7
	sys/dev/ic/tpm.c: revision 1.14
	share/man/man4/tpm.4: revision 1.5
	sys/dev/isa/tpm_isa.c: revision 1.5
	sys/dev/ic/tpm.c: revision 1.15

Improvements in tpm(4):
  - Remove interrupt support, do polling only, avoids unnecessary trouble.
  - Simplify a few things.
  - Fix the suspend function, the SaveState command is 0x98, not 0x9C.
  - Make the driver MP-safe.
  - Sync the man page with reality.

 -

Add suspend support for TPM 2.0 chips. Check the TPM response also for 1.2
chips. Unfortunately I cannot really test this change since ACPI suspend
does not work on any of my laptops.

 -

Provide a better abstraction for the TPM interface. Report it in the ioctl.</pre>
</div>
</content>
</entry>
<entry>
<title>Revamp the TPM driver</title>
<updated>2019-06-22T12:57:40+00:00</updated>
<author>
<name>maxv</name>
<email>maxv@NetBSD.org</email>
</author>
<published>2019-06-22T12:57:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=69d99d6c46a1ca5017d3969676bf2f3657f2289b'/>
<id>69d99d6c46a1ca5017d3969676bf2f3657f2289b</id>
<content type='text'>
 * Fix several bugs, and clean up.
 * Drop the "legacy" interface, it relied on an undocumented global
   variable that was never initialized. It likely had never been tested
   either, so good riddance.
 * Add support for TPM 2.0 chips via ACPI. For these we use the TIS1.2
   interface, same as TPM 1.2.
 * Provide an ioctl to fetch TPM information from the driver.

Tested on a Lenovo desktop with ACPI-TPM2.0, an HP laptop ACPI-TPM2.0, a
Dell laptop with ISA-TPM1.2.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 * Fix several bugs, and clean up.
 * Drop the "legacy" interface, it relied on an undocumented global
   variable that was never initialized. It likely had never been tested
   either, so good riddance.
 * Add support for TPM 2.0 chips via ACPI. For these we use the TIS1.2
   interface, same as TPM 1.2.
 * Provide an ioctl to fetch TPM information from the driver.

Tested on a Lenovo desktop with ACPI-TPM2.0, an HP laptop ACPI-TPM2.0, a
Dell laptop with ISA-TPM1.2.</pre>
</div>
</content>
</entry>
<entry>
<title>make compile on 64-bit archs after acpi_mem ar_length was changed</title>
<updated>2018-12-09T11:12:58+00:00</updated>
<author>
<name>jdolecek</name>
<email>jdolecek@NetBSD.org</email>
</author>
<published>2018-12-09T11:12:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=c55efb6ae66c8a8fb6eacbe224a9036d5d0f4cb8'/>
<id>c55efb6ae66c8a8fb6eacbe224a9036d5d0f4cb8</id>
<content type='text'>
from uint32_t to bus_size_t in rev. 1.77 of acpivar.h</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
from uint32_t to bus_size_t in rev. 1.77 of acpivar.h</pre>
</div>
</content>
</entry>
<entry>
<title>notyet an unused variable.</title>
<updated>2018-02-22T01:50:26+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2018-02-22T01:50:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f4a1bad99bea04fe5da619cf747a9c0bd108ad83'/>
<id>f4a1bad99bea04fe5da619cf747a9c0bd108ad83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Kill some more extern struct cfdriver declarations.</title>
<updated>2017-10-28T04:53:54+00:00</updated>
<author>
<name>riastradh</name>
<email>riastradh@NetBSD.org</email>
</author>
<published>2017-10-28T04:53:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=1d42e734b20ce6cfd2a44769b94a21755899e3e9'/>
<id>1d42e734b20ce6cfd2a44769b94a21755899e3e9</id>
<content type='text'>
Down with externs in .c!</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Down with externs in .c!</pre>
</div>
</content>
</entry>
<entry>
<title>Some {} are missing. The behavior is thus wrong: the code always jumps to</title>
<updated>2014-03-01T16:59:41+00:00</updated>
<author>
<name>maxv</name>
<email>maxv@NetBSD.org</email>
</author>
<published>2014-03-01T16:59:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=2d55e7ed835ee8d18747cb66c1d0af2152ec23a7'/>
<id>2d55e7ed835ee8d18747cb66c1d0af2152ec23a7</id>
<content type='text'>
out1.

Spotted by my code scanner.

ok christos@</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
out1.

Spotted by my code scanner.

ok christos@</pre>
</div>
</content>
</entry>
<entry>
<title>make it never match for now.</title>
<updated>2012-01-22T20:25:25+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2012-01-22T20:25:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=6d62b701f72f201953fe12dd1d31fa72f4a50dad'/>
<id>6d62b701f72f201953fe12dd1d31fa72f4a50dad</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>make it handle legacy devices too, although the ones in the table are not.</title>
<updated>2012-01-22T20:24:27+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2012-01-22T20:24:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=fbdab42252da66c18c1d33590e492261840160e2'/>
<id>fbdab42252da66c18c1d33590e492261840160e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add a tpm driver from bsssd.sourceforge.net</title>
<updated>2012-01-22T06:44:28+00:00</updated>
<author>
<name>christos</name>
<email>christos@NetBSD.org</email>
</author>
<published>2012-01-22T06:44:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=abaecc26de107d54e5462721d73ddf9d4496f0ad'/>
<id>abaecc26de107d54e5462721d73ddf9d4496f0ad</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
