<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/sys/dev, 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>Implement logging for rwlock_enter() and rwlock_exit(), move from do-while macros to dedicated functions to allow for return values.</title>
<updated>2023-03-16T22:26:30+00:00</updated>
<author>
<name>Merlin Scholz</name>
<email>merlin@scholz.ruhr</email>
</author>
<published>2023-03-16T22:26:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=776ee58682b55a490930b73105b3596dde1f16fa'/>
<id>776ee58682b55a490930b73105b3596dde1f16fa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement file and line logging for mutex locks</title>
<updated>2023-03-16T02:03:49+00:00</updated>
<author>
<name>Merlin Scholz</name>
<email>merlin@scholz.ruhr</email>
</author>
<published>2023-03-16T02:03:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=bf1ce4ce265b9f38a71f0bca82d8f0e8c055233a'/>
<id>bf1ce4ce265b9f38a71f0bca82d8f0e8c055233a</id>
<content type='text'>
This commit implements proper file and line logging as a proof of concept for mutex locks. The previous versions only logged the location inside the mutex_enter function, which was useless.

To get correct filenames, calls to mutex_enter (which usually go directly to ASM) are replaced through the macro defined in lockdoc.h. This logs the according information and passes on the function call to the old ASM code.

Furthermore, some other things like apm.c or patch.c had to be modified, to keep the code compilable, even with this new replacement macro.

Also, the old logging methods in lockdebug.h have been removed, since we can not get the proper file and line by going through there.

This commit only implements these changes for mutex_enter, mutex_spin_enter, mutex_exit and mutex_spin_exit, and serves as a template for changes in the other lock functions and types.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit implements proper file and line logging as a proof of concept for mutex locks. The previous versions only logged the location inside the mutex_enter function, which was useless.

To get correct filenames, calls to mutex_enter (which usually go directly to ASM) are replaced through the macro defined in lockdoc.h. This logs the according information and passes on the function call to the old ASM code.

Furthermore, some other things like apm.c or patch.c had to be modified, to keep the code compilable, even with this new replacement macro.

Also, the old logging methods in lockdebug.h have been removed, since we can not get the proper file and line by going through there.

This commit only implements these changes for mutex_enter, mutex_spin_enter, mutex_exit and mutex_spin_exit, and serves as a template for changes in the other lock functions and types.
</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by riastradh in ticket #1493):</title>
<updated>2022-08-03T16:21:55+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T16:21:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=43ac304d423636d57e0d86a78ce7ead8140a1fd3'/>
<id>43ac304d423636d57e0d86a78ce7ead8140a1fd3</id>
<content type='text'>
	sys/dev/usb/ucom.c: revision 1.129

ucom(4): Fix earlier mistake causing pipes not to be closed.

In revision 1.123, mrg@ changed what he thought was a double-close,
but was actually abort&amp;close (as is appropriate) to just abort (which
is not enough -- leaks the pipe).  This restores the abort&amp;close.

The original `bug' was found by code inspection, whereas this bug was
found by asserting in usb_subr.c that no pipes are open on device
disconnection after detach; the asserts actually triggered with
several ucom(4) devices, and no longer trigger with this change.

XXX pullup-9</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/usb/ucom.c: revision 1.129

ucom(4): Fix earlier mistake causing pipes not to be closed.

In revision 1.123, mrg@ changed what he thought was a double-close,
but was actually abort&amp;close (as is appropriate) to just abort (which
is not enough -- leaks the pipe).  This restores the abort&amp;close.

The original `bug' was found by code inspection, whereas this bug was
found by asserting in usb_subr.c that no pipes are open on device
disconnection after detach; the asserts actually triggered with
several ucom(4) devices, and no longer trigger with this change.

XXX pullup-9</pre>
</div>
</content>
</entry>
<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 riastradh in ticket #1492):</title>
<updated>2022-08-03T15:50:03+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T15:50:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f1d2435af19ed80ab9726916c6a3370fcc67ebcb'/>
<id>f1d2435af19ed80ab9726916c6a3370fcc67ebcb</id>
<content type='text'>
	sys/dev/usb/ukbd.c: revision 1.154

ukbd(4): Wait for callouts and blinking to complete in detach.

This detach routine (and whole driver) has got a lotta other
problems, but let's fix 'em one at a time...</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/usb/ukbd.c: revision 1.154

ukbd(4): Wait for callouts and blinking to complete in detach.

This detach routine (and whole driver) has got a lotta other
problems, but let's fix 'em one at a time...</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by riastradh in ticket #1490):</title>
<updated>2022-08-03T15:44:24+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T15:44:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=0ab3990ac5ddd2972f00db1d14bb283e5091c9bf'/>
<id>0ab3990ac5ddd2972f00db1d14bb283e5091c9bf</id>
<content type='text'>
	sys/dev/acpi/thinkpad_acpi.c: revision 1.48

With the recent change of the EC address space handler, we no longer get
an ACPI_INTEGER in host byte order but a byte sized buffer with little
endian data.

Extract only the low 8 bits from buffer to get the fan speed again.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/acpi/thinkpad_acpi.c: revision 1.48

With the recent change of the EC address space handler, we no longer get
an ACPI_INTEGER in host byte order but a byte sized buffer with little
endian data.

Extract only the low 8 bits from buffer to get the fan speed again.</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by riastradh in ticket #1485):</title>
<updated>2022-08-03T10:55:44+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-03T10:55:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=c302d5ea31d36c462babff41e49adeb9467d8bf5'/>
<id>c302d5ea31d36c462babff41e49adeb9467d8bf5</id>
<content type='text'>
	sys/dev/pci/if_iwi.c: revision 1.117
	sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401
	sys/dev/scsipi/ses.c: revision 1.52
	sys/dev/isa/mcd.c: revision 1.121

sys/dev: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure.  If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/pci/if_iwi.c: revision 1.117
	sys/dev/raidframe/rf_netbsdkintf.c: revision 1.401
	sys/dev/scsipi/ses.c: revision 1.52
	sys/dev/isa/mcd.c: revision 1.121

sys/dev: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure.  If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.

I think the iwi(4), mcd(4), and ses(4) changes actually plug leaks;
the raidframe(4) change probably doesn't (but doesn't hurt).</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up following revision(s) (requested by rin in ticket #1483):</title>
<updated>2022-08-01T09:36:06+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-08-01T09:36:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=4a1f1950a1b763ad19f6ebf0aaa0989c67d569f9'/>
<id>4a1f1950a1b763ad19f6ebf0aaa0989c67d569f9</id>
<content type='text'>
	sys/dev/usb/uslsa.c: revision 1.32

PR kern/56946
Baud rate must be in little endian for SLSA_R_SET_BAUDRATE request.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/usb/uslsa.c: revision 1.32

PR kern/56946
Baud rate must be in little endian for SLSA_R_SET_BAUDRATE request.</pre>
</div>
</content>
</entry>
<entry>
<title>regen for ticket #1482</title>
<updated>2022-07-27T14:41:16+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-07-27T14:41:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=8f0d9cb64742890aada5a144950eb871e85269ec'/>
<id>8f0d9cb64742890aada5a144950eb871e85269ec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Pull up the following revisions, requested by msaitoh in ticket #1482:</title>
<updated>2022-07-27T14:40:07+00:00</updated>
<author>
<name>martin</name>
<email>martin@NetBSD.org</email>
</author>
<published>2022-07-27T14:40:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=ffc49d34599599b8c0bd83195ef2e513bdf44e3e'/>
<id>ffc49d34599599b8c0bd83195ef2e513bdf44e3e</id>
<content type='text'>
	sys/dev/pci/pcidevs				1.1422,1.1445-1.1460
							via patch
	sys/arch/x86/pci/amdsmn.c			1.13

Update pcidevs:
- Add Intel Alder Lake devices and Intel 600 Series PCH devices.
- Add some Intel Xeon Scalable / Skylake-E devices.
- Fix AMD F16_HB from 0x1568 to 0x1538.
- Add some devices for AMD and improve some descriptions to clarify.
- Add VMware AHCI and NVMe.
- Update Intel 700 series Ethernet devices.
- Add some Broadcom devices.
- Add some Broadcom / LSI RAID cards.
- Fix typos and whitespace.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	sys/dev/pci/pcidevs				1.1422,1.1445-1.1460
							via patch
	sys/arch/x86/pci/amdsmn.c			1.13

Update pcidevs:
- Add Intel Alder Lake devices and Intel 600 Series PCH devices.
- Add some Intel Xeon Scalable / Skylake-E devices.
- Fix AMD F16_HB from 0x1568 to 0x1538.
- Add some devices for AMD and improve some descriptions to clarify.
- Add VMware AHCI and NVMe.
- Update Intel 700 series Ethernet devices.
- Add some Broadcom devices.
- Add some Broadcom / LSI RAID cards.
- Fix typos and whitespace.</pre>
</div>
</content>
</entry>
</feed>
