<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/mps, branch releng/14.1</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.1</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.1'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2024-01-02T00:29:55Z</updated>
<entry>
<title>mps: Handle errors from copyout() in ioctl handlers</title>
<updated>2024-01-02T00:29:55Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-12-26T01:42:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0e83222347c5a039bac43c45f174f9b4cdc90336'/>
<id>urn:sha1:0e83222347c5a039bac43c45f174f9b4cdc90336</id>
<content type='text'>
In preparation for adding a __result_use_check annotation to copyin()
and related functions, start checking for errors from copyout() in
the mps(4) user command handler.  This should make it easier to catch
bugs.

Reviewed by:	imp, asomers
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D43176

(cherry picked from commit bcf4a7c7ace21a01d10003de9c7692f0887526c1)
</content>
</entry>
<entry>
<title>Use xpt_path_sbuf() in few drivers</title>
<updated>2023-12-23T04:36:56Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2023-11-23T16:25:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=129c3aa4b2312e3e2d91e5688a4368fc3836db98'/>
<id>urn:sha1:129c3aa4b2312e3e2d91e5688a4368fc3836db98</id>
<content type='text'>
xpt_path_string() is now a wrapper around xpt_path_sbuf().  Using it
to than concatenate result to another sbuf makes no sense.  Just call
xpt_path_sbuf() directly.

MFC after:	1 month

(cherry picked from commit 8c4ee0b22c98fc1e208dd133f617bd329cd10728)
</content>
</entry>
<entry>
<title>mpr, mps:  Establish busdma boundaries for memory pools</title>
<updated>2023-12-20T15:40:42Z</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2023-12-14T20:05:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=504e85ade103b0c2cafefb2d9dea86e94aef779f'/>
<id>urn:sha1:504e85ade103b0c2cafefb2d9dea86e94aef779f</id>
<content type='text'>
Most all of the memory used by the cards in the mpr(4) and mps(4)
drivers is required, according to the specs and Broadcom developers,
to be within a 4GB segment of memory.

This includes:

System Request Message Frames pool
Reply Free Queues pool
ReplyDescriptorPost Queues pool
Chain Segments pool
Sense Buffers pool
SystemReply message pool

We got a bug report from Dwight Engen, who ran into data corruption
in the BAE port of FreeBSD:

&gt; We have a port of the FreeBSD mpr driver to our kernel and recently
&gt; I found an issue under heavy load where a DMA may go to the wrong
&gt; address. The test system is a Supermicro X10SRH-CLN4F with the
&gt; onboard SAS3008 controller setup with 2 enterprise Micron SSDs in
&gt; RAID 0 (striped). I have debugged the issue and narrowed down that
&gt; the errant DMA is one that has a segment that crosses a 4GB
&gt; physical boundary.  There are more details I can provide if you'd
&gt; like, but with the attached patch in place I can no longer
&gt; re-create the issue.

&gt; I'm not sure if this is a known limit of the card (have not found a
&gt; datasheet/programming docs for the chip) or our system is just
&gt; doing something a bit different. Any helpful info or insight would
&gt; be welcome.

&gt; Anyway, just thought this might be helpful info if you want to
&gt; apply a similar fix to FreeBSD. You can ignore/discard the commit
&gt; message as it is my internal commit (blkio is our own tool we use
&gt; to write/read every block of a device with CRC verification which
&gt; is how I found the problem).

The commit message was:

&gt; [PATCH 8/9] mpr: fix memory corrupting DMA when sg segment crosses
&gt; 4GB boundary

&gt; Test case was two SSD's in RAID 0 (stripe). The logical disk was
&gt; then partitioned into two partitions. One partition had lots of
&gt; filesystem I/O and the other was initially filled using blkio with
&gt; CRCable data and then read back with blkio CRC verify in a loop.
&gt; Eventually blkio would report a bad CRC block because the physical
&gt; page being read-ahead into didn't contain the right data. If the
&gt; physical address in the arq/segs was for example 0x500003000 the
&gt; data would actually be DMAed to 0x400003000.

The original patch was against mpr(4) before busdma templates were
introduced, and only affected the buffer pool (sc-&gt;buffer_dmat) in
the mpr(4) driver. After some discussion with Dwight and the
LSI/Broadcom developers and looking through the driver, it looks
like most of the queues in the driver are ok, because they limit
the memory used to memory below 4GB. The buffer queue and the chain
frames seem to be the exceptions.

This is pretty much the same between the mpr(4) and mps(4) drivers.

So, apply a 4GB boundary limitation for the buffer and chain frame pools
in the mpr(4) and mps(4) drivers.

Reported by:	Dwight Engen &lt;dwight.engen@gmail.com&gt;
Reviewed by:	imp
Obtained from:	Dwight Engen &lt;dwight.engen@gmail.com&gt;
Differential Revision:	&lt;https://reviews.freebsd.org/D43008&gt;

(cherry picked from commit 264610a86e14f8e123d94c3c3bd9632d75c078a3)
</content>
</entry>
<entry>
<title>mprutil: "fix user reply buffer (64)..." warnings</title>
<updated>2023-10-03T01:31:12Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2023-02-22T22:06:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c70a4185c637754428f36536af3bdc9181fa5155'/>
<id>urn:sha1:c70a4185c637754428f36536af3bdc9181fa5155</id>
<content type='text'>
Depending on the card's firmware version, it may return different length
responses for MPI2_FUNCTION_IOC_FACTS.  But the first part of the
response contains the length of the rest, so query it first to get the
length and then use that to size the buffer for the full response.

Also, correctly zero-initialize MPI2_IOC_FACTS_REQUEST.  It only worked
by luck before.

PR:		264848
Reported by:	Julien Cigar &lt;julien@perdition.city&gt;
Sponsored by:	Axcient
Reviewed by:	scottl, imp
Differential Revision: https://reviews.freebsd.org/D38739

(cherry picked from commit 7d154c4dc64e61af7ca536c4e9927fa07c675a83)
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>urn:sha1:685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:11Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:11Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=95ee2897e98f5d444f26ed2334cc7c439f9c16c6'/>
<id>urn:sha1:95ee2897e98f5d444f26ed2334cc7c439f9c16c6</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>urn:sha1:4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</content>
</entry>
<entry>
<title>mps: Fix a typo in a source code comment</title>
<updated>2023-04-28T10:01:58Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2023-04-28T10:01:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5bcbdb0b2eb4c14ef0a8671c996337acdefb7f72'/>
<id>urn:sha1:5bcbdb0b2eb4c14ef0a8671c996337acdefb7f72</id>
<content type='text'>
- s/feild/field/

MFC after:	3 days
</content>
</entry>
<entry>
<title>Fix kernel memory disclosures in mpr and mps</title>
<updated>2023-03-02T20:31:06Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2023-03-01T18:53:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=72aad3f9028af12e6c56a3a461b46a153abd7b24'/>
<id>urn:sha1:72aad3f9028af12e6c56a3a461b46a153abd7b24</id>
<content type='text'>
In every mpr and mps ioctl that copies kernel data to userland, validate
that the requested length does not exceed the size of the kernel's
buffer.

Note that all of these ioctls already required root access.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D38842
</content>
</entry>
<entry>
<title>mps(4): Remove a double word in a source code comment</title>
<updated>2022-09-04T11:48:21Z</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2022-09-04T11:48:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d6f9a3c0a8b11fa0e26e364266e37805ca1dcca2'/>
<id>urn:sha1:d6f9a3c0a8b11fa0e26e364266e37805ca1dcca2</id>
<content type='text'>
- s/the the/the/

MFC after:	3 days
</content>
</entry>
</feed>
