The NetBSD Project

CVS log for src/sys/dev/acpi/tpm_acpi.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / acpi

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.8.2.2 / (download) - annotate - [select for diffs], Wed Aug 3 16:00:47 2022 UTC (6 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.8.2.1: +4 -4 lines
Diff to previous 1.8.2.1 (colored) to branchpoint 1.8 (colored) next main 1.9 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1495):

	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->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.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Nov 14 21:18:30 2021 UTC (14 months, 3 weeks ago) by riastradh
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.13: +4 -4 lines
Diff to previous 1.13 (colored)

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.

Revision 1.11.8.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:43 2021 UTC (22 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.11: +24 -14 lines
Diff to previous 1.11 (colored) next main 1.12 (colored)

Sync with HEAD.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 29 15:24:00 2021 UTC (2 years ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.12: +23 -30 lines
Diff to previous 1.12 (colored)

Use acpi_compatible_match() / acpi_compatible_lookup().

Revision 1.12 / (download) - annotate - [select for diffs], Sat Jan 16 01:23:04 2021 UTC (2 years ago) by thorpej
Branch: MAIN
Changes since 1.11: +20 -3 lines
Diff to previous 1.11 (colored)

Match PNP0C31 as a TPM 1.2 device.  Works on my ThinkPad X260, and
eliminates the last of the devices that attach to "isa".

Revision 1.6.4.2 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:18 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.6.4.1: +57 -113 lines
Diff to previous 1.6.4.1 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.8.2.1 / (download) - annotate - [select for diffs], Wed Oct 16 09:52:38 2019 UTC (3 years, 3 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.8: +18 -39 lines
Diff to previous 1.8 (colored)

Pull up following revision(s) (requested by maxv in ticket #336):

	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.

Revision 1.11 / (download) - annotate - [select for diffs], Wed Oct 9 14:03:57 2019 UTC (3 years, 4 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: thorpej-futex
Changes since 1.10: +7 -14 lines
Diff to previous 1.10 (colored)

Provide a better abstraction for the TPM interface. Report it in the ioctl.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 9 07:30:58 2019 UTC (3 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored)

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.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 8 18:43:02 2019 UTC (3 years, 4 months ago) by maxv
Branch: MAIN
Changes since 1.8: +15 -31 lines
Diff to previous 1.8 (colored)

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.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jun 22 12:57:40 2019 UTC (3 years, 7 months ago) by maxv
Branch: MAIN
CVS Tags: netbsd-9-base
Branch point for: netbsd-9
Changes since 1.7: +54 -89 lines
Diff to previous 1.7 (colored)

Revamp the TPM driver

 * 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.

Revision 1.6.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:05 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

Sync with HEAD

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Wed Dec 26 14:01:47 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored) next main 1.7 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.7 / (download) - annotate - [select for diffs], Sun Dec 9 11:12:58 2018 UTC (4 years, 2 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, isaki-audio2-base, isaki-audio2
Changes since 1.6: +4 -4 lines
Diff to previous 1.6 (colored)

make compile on 64-bit archs after acpi_mem ar_length was changed
from uint32_t to bus_size_t in rev. 1.77 of acpivar.h

Revision 1.6 / (download) - annotate - [select for diffs], Thu Feb 22 01:50:26 2018 UTC (4 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.5: +4 -2 lines
Diff to previous 1.5 (colored)

notyet an unused variable.

Revision 1.3.10.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:36:58 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.3.10.1: +2 -2 lines
Diff to previous 1.3.10.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

update from HEAD

Revision 1.5 / (download) - annotate - [select for diffs], Sat Oct 28 04:53:55 2017 UTC (5 years, 3 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

Kill some more extern struct cfdriver declarations.

Down with externs in .c!

Revision 1.3.10.1 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:35 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.3.6.3 / (download) - annotate - [select for diffs], Thu May 22 11:40:19 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.3.6.2: +4 -3 lines
Diff to previous 1.3.6.2 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.3.14.1 / (download) - annotate - [select for diffs], Sun May 18 17:45:35 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored) next main 1.4 (colored)

sync with head

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 1 16:59:41 2014 UTC (8 years, 11 months ago) by maxv
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Some {} are missing. The behavior is thus wrong: the code always jumps to
out1.

Spotted by my code scanner.

ok christos@

Revision 1.3.6.2 / (download) - annotate - [select for diffs], Tue Apr 17 00:07:28 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.3.6.1: +206 -0 lines
Diff to previous 1.3.6.1 (colored) to branchpoint 1.3 (colored)

sync with head

Revision 1.3.4.2 / (download) - annotate - [select for diffs], Sat Feb 18 07:34:08 2012 UTC (10 years, 11 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.3.4.1: +206 -0 lines
Diff to previous 1.3.4.1 (colored) to branchpoint 1.3 (colored) next main 1.4 (colored)

merge to -current.

Revision 1.3.6.1, Sun Jan 22 20:25:25 2012 UTC (11 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.3: +0 -206 lines
FILE REMOVED

file tpm_acpi.c was added on branch yamt-pagecache on 2012-04-17 00:07:28 +0000

Revision 1.3.4.1, Sun Jan 22 20:25:25 2012 UTC (11 years ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.3: +0 -206 lines
FILE REMOVED

file tpm_acpi.c was added on branch jmcneill-usbmp on 2012-02-18 07:34:08 +0000

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 22 20:25:25 2012 UTC (11 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, khorben-n900, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys, rmind-smpnet, jmcneill-usbmp
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

make it never match for now.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jan 22 20:24:27 2012 UTC (11 years ago) by christos
Branch: MAIN
Changes since 1.1: +55 -33 lines
Diff to previous 1.1 (colored)

make it handle legacy devices too, although the ones in the table are not.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jan 22 06:44:28 2012 UTC (11 years ago) by christos
Branch: MAIN

add a tpm driver from bsssd.sourceforge.net

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>