<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/arm64, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>gic_v3: Correctly handle GICC GIGR Base Address case</title>
<updated>2025-12-15T17:56:36+00:00</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2024-12-09T21:55:06+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d00f1d6858a0caca5c52f819da8381a6be11e3a9'/>
<id>d00f1d6858a0caca5c52f819da8381a6be11e3a9</id>
<content type='text'>
When using the GICR Base Address field from each GICC structure instead
of GICR structures, the field gives the address of a single
redistributor page. However, that does not mean that they are not
contiguous, and so GICR_TYPER.Last could be clear on them. Thus we must
ignore GICR_TYPER.Last in this case and always treat each region as
having a single page. Normally we'd do that as a result of checking
against the rman's size (though that's a rather roundabout and iffy way
of achieving it), but for whatever reason this is bigger on the Qualcomm
Snapdragon X Elite (I assume the MADT reports GICv4 but TYPER doesn't
report VLPIS and so there is a mismatch between the rman size and the
stride used) and we end up walking off the region's mapping.

Reviewed by:	andrew, phk
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47560

(cherry picked from commit f8c90b704189c94275d22d7cc204d1d74e821d86)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When using the GICR Base Address field from each GICC structure instead
of GICR structures, the field gives the address of a single
redistributor page. However, that does not mean that they are not
contiguous, and so GICR_TYPER.Last could be clear on them. Thus we must
ignore GICR_TYPER.Last in this case and always treat each region as
having a single page. Normally we'd do that as a result of checking
against the rman's size (though that's a rather roundabout and iffy way
of achieving it), but for whatever reason this is bigger on the Qualcomm
Snapdragon X Elite (I assume the MADT reports GICv4 but TYPER doesn't
report VLPIS and so there is a mismatch between the rman size and the
stride used) and we end up walking off the region's mapping.

Reviewed by:	andrew, phk
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47560

(cherry picked from commit f8c90b704189c94275d22d7cc204d1d74e821d86)
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: prevent panic when using syscall mux + large arg call (mmap)</title>
<updated>2025-08-25T15:23:12+00:00</updated>
<author>
<name>John-Mark Gurney</name>
<email>jmg@FreeBSD.org</email>
</author>
<published>2025-08-18T20:25:37+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=98ac13c4baf5deb84010d632cb3b96dacd8c4eb6'/>
<id>98ac13c4baf5deb84010d632cb3b96dacd8c4eb6</id>
<content type='text'>
if the syscall muxes are used, up to two additional arguments
may be required.  This means that the 8 required for mmap increases
up to 10 (for __syscall).

Sponsored by:   Juniper Networks, Inc.

(cherry picked from commit 740b879c6ade531adebeba7cd2f261bbe650797f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if the syscall muxes are used, up to two additional arguments
may be required.  This means that the 8 required for mmap increases
up to 10 (for __syscall).

Sponsored by:   Juniper Networks, Inc.

(cherry picked from commit 740b879c6ade531adebeba7cd2f261bbe650797f)
</pre>
</div>
</content>
</entry>
<entry>
<title>rk_i2c: use the register read mode even if the read ends with IIC_M_NOSTOP</title>
<updated>2025-08-06T05:55:34+00:00</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2024-06-27T07:48:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f8f0cae5e06bc3598cc97a618aad62e8c5671bfd'/>
<id>f8f0cae5e06bc3598cc97a618aad62e8c5671bfd</id>
<content type='text'>
Tested with max44009(4).

(cherry picked from commit a743e280ea0541163afa7d1c320504925a02f80b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tested with max44009(4).

(cherry picked from commit a743e280ea0541163afa7d1c320504925a02f80b)
</pre>
</div>
</content>
</entry>
<entry>
<title>rk_i2c: emulate repeated start</title>
<updated>2025-08-06T05:55:24+00:00</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2024-06-27T07:40:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e71f019b82f4d4e623fa75aca647cf7103d89b54'/>
<id>e71f019b82f4d4e623fa75aca647cf7103d89b54</id>
<content type='text'>
rk_i2c_send_stop is modified so that it sends a stop condition, like it
always did, if there is no IIC_M_NOSTOP flag.
But if the flag is set then the function completely resets the control
register and sets the driver state to transfer completed.
Something like this was previously done for a write with IIC_M_NOSTOP.
Now it is done for a read with IIC_M_NOSTOP as well.

Linux code says that the hardware does not support the repeated start
condition and the documentation, indeed, does not mention it.
But according to the Linux driver clearing the control register and then
sending a start condition acts as if it were a repeated start.

While here, add braces around a single-line 'if' branch to balance it
with a multi-line 'else' branch.

Tested with max44009(4).

(cherry picked from commit 0deaf4be346f7f343bd2cf771bbf5d172d1c0d2a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
rk_i2c_send_stop is modified so that it sends a stop condition, like it
always did, if there is no IIC_M_NOSTOP flag.
But if the flag is set then the function completely resets the control
register and sets the driver state to transfer completed.
Something like this was previously done for a write with IIC_M_NOSTOP.
Now it is done for a read with IIC_M_NOSTOP as well.

Linux code says that the hardware does not support the repeated start
condition and the documentation, indeed, does not mention it.
But according to the Linux driver clearing the control register and then
sending a start condition acts as if it were a repeated start.

While here, add braces around a single-line 'if' branch to balance it
with a multi-line 'else' branch.

Tested with max44009(4).

(cherry picked from commit 0deaf4be346f7f343bd2cf771bbf5d172d1c0d2a)
</pre>
</div>
</content>
</entry>
<entry>
<title>if_genet: Plug memory leaks</title>
<updated>2025-07-31T10:11:52+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-07-19T17:07:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=aee028cb4e96541150c528767c1aeb0ca3869d37'/>
<id>aee028cb4e96541150c528767c1aeb0ca3869d37</id>
<content type='text'>
The rx_buf_tag should be checked when destroying rx dma mappings.

PR:		288309
Reviewed by:	zlei
Submitted by:	Mike Belanger &lt;mibelanger@qnx.com&gt;
MFC after:	3 days

(cherry picked from commit f46e95ae3addc9f7b975c187f71125825a38ffb1)
(cherry picked from commit 337c3e9859e7b5d971e84bf546a51c2cf9a9e44f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rx_buf_tag should be checked when destroying rx dma mappings.

PR:		288309
Reviewed by:	zlei
Submitted by:	Mike Belanger &lt;mibelanger@qnx.com&gt;
MFC after:	3 days

(cherry picked from commit f46e95ae3addc9f7b975c187f71125825a38ffb1)
(cherry picked from commit 337c3e9859e7b5d971e84bf546a51c2cf9a9e44f)
</pre>
</div>
</content>
</entry>
<entry>
<title>if_genet: Consistently use the boolean form</title>
<updated>2025-07-31T10:11:51+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-07-19T17:07:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8c49d0a9f825a1915a3ff8eb5ef8ee8223b5d5f1'/>
<id>8c49d0a9f825a1915a3ff8eb5ef8ee8223b5d5f1</id>
<content type='text'>
The variable eaddr_found is declared as bool. This change improves
readability a little.

No functional change intended.

MFC after:	3 days

(cherry picked from commit 2fc051d090933203e1af6a8452cdd87a4c76ad5b)
(cherry picked from commit 97d5f16c6966e2ae261ddabe1f16a9675dedf43a)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The variable eaddr_found is declared as bool. This change improves
readability a little.

No functional change intended.

MFC after:	3 days

(cherry picked from commit 2fc051d090933203e1af6a8452cdd87a4c76ad5b)
(cherry picked from commit 97d5f16c6966e2ae261ddabe1f16a9675dedf43a)
</pre>
</div>
</content>
</entry>
<entry>
<title>atomics: Constify loads</title>
<updated>2025-01-17T12:24:48+00:00</updated>
<author>
<name>Olivier Certner</name>
<email>olce@FreeBSD.org</email>
</author>
<published>2024-07-19T15:23:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e6e9e70e51d987c54535b8714dc040fae68ac148'/>
<id>e6e9e70e51d987c54535b8714dc040fae68ac148</id>
<content type='text'>
In order to match reality, allow using these functions with pointers on
const objects, and bring us closer to C11.

Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm
statement's constraint for '*p' (the value to load).  CMPXCHG8B always
writes back some value, even when the value exchange does not happen in
which case what was read is written back.  atomic_load_acq_64_i586()
further takes care of the operation atomically writing back the same
value that was read in any case.  All in all, this makes the inline
asm's write back undetectable by any other code, whether executing on
other CPUs or code on the same CPU before and after the call to
atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will
trigger a #GP(0) if the memory address is part of a read-only mapping.
This unfortunate property is however out of scope of the C abstract
machine, and in particular independent of whether the 'uint64_t' pointed
to is declared 'const' or not.

Approved by:    markj (mentor)
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46887

(cherry picked from commit 5e9a82e898d55816c366cfa3ffbca84f02569fe5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to match reality, allow using these functions with pointers on
const objects, and bring us closer to C11.

Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm
statement's constraint for '*p' (the value to load).  CMPXCHG8B always
writes back some value, even when the value exchange does not happen in
which case what was read is written back.  atomic_load_acq_64_i586()
further takes care of the operation atomically writing back the same
value that was read in any case.  All in all, this makes the inline
asm's write back undetectable by any other code, whether executing on
other CPUs or code on the same CPU before and after the call to
atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will
trigger a #GP(0) if the memory address is part of a read-only mapping.
This unfortunate property is however out of scope of the C abstract
machine, and in particular independent of whether the 'uint64_t' pointed
to is declared 'const' or not.

Approved by:    markj (mentor)
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46887

(cherry picked from commit 5e9a82e898d55816c366cfa3ffbca84f02569fe5)
</pre>
</div>
</content>
</entry>
<entry>
<title>smmu: Stop checking for failures from malloc(M_WAITOK)</title>
<updated>2024-09-30T05:05:32+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-09-03T10:25:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=91b6d79c2f39199d51f7642410418a8b10dcef0d'/>
<id>91b6d79c2f39199d51f7642410418a8b10dcef0d</id>
<content type='text'>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit f75ceecad2157a0d3aca61a4893ab78f2dec21ee)
(cherry picked from commit 49995f771b537064daeb2931ce86a13e78f9d977)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45852

(cherry picked from commit f75ceecad2157a0d3aca61a4893ab78f2dec21ee)
(cherry picked from commit 49995f771b537064daeb2931ce86a13e78f9d977)
</pre>
</div>
</content>
</entry>
<entry>
<title>arm64: Fix a typo in a source code comment</title>
<updated>2024-09-23T04:51:19+00:00</updated>
<author>
<name>Gordon Bergling</name>
<email>gbe@FreeBSD.org</email>
</author>
<published>2024-09-20T16:53:42+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=590a0f0d67a287f085a679fa2a32f5aaf44b4680'/>
<id>590a0f0d67a287f085a679fa2a32f5aaf44b4680</id>
<content type='text'>
- s/parametes/parameters/

(cherry picked from commit cc4997907714ec22498a454736974abfbc123beb)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- s/parametes/parameters/

(cherry picked from commit cc4997907714ec22498a454736974abfbc123beb)
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel: Make some compile time constant variables const</title>
<updated>2024-09-21T04:16:40+00:00</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2024-08-30T10:26:30+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e38f24446f09267647b3d893ae700c4c9e07bc78'/>
<id>e38f24446f09267647b3d893ae700c4c9e07bc78</id>
<content type='text'>
Those variables are not going to be changed at runtime. Make them const
to avoid potential overwriting. This will also help spotting accidental
global variables shadowing, since the variable's name such as `version`
is short and commonly used.

This change was inspired by reviewing khng's work D44760.

No functional change intended.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45227

(cherry picked from commit 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a)
(cherry picked from commit 497f577f460ba93dda38910bf49b390fa610480f)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those variables are not going to be changed at runtime. Make them const
to avoid potential overwriting. This will also help spotting accidental
global variables shadowing, since the variable's name such as `version`
is short and commonly used.

This change was inspired by reviewing khng's work D44760.

No functional change intended.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45227

(cherry picked from commit 356be1348dac94ba0d2dc1f479bc1f8a2ebaa03a)
(cherry picked from commit 497f577f460ba93dda38910bf49b390fa610480f)
</pre>
</div>
</content>
</entry>
</feed>
