<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/xen, branch release/14.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-01-31T18:25:02Z</updated>
<entry>
<title>xen: Use proper prototype for SYSINIT functions</title>
<updated>2026-01-31T18:25:02Z</updated>
<author>
<name>Zhenlei Huang</name>
<email>zlei@FreeBSD.org</email>
</author>
<published>2025-10-13T10:12:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=65b07ecacc58b69a32d6421caa138daead009eaf'/>
<id>urn:sha1:65b07ecacc58b69a32d6421caa138daead009eaf</id>
<content type='text'>
The only possible return value of function xen_intr_init() is 0. Make
it return void to match the prototype of SYSINIT.

MFC after:	1 week

(cherry picked from commit 19061a898ac809c8e9a30839b7200ff13a6eb9c0)
(cherry picked from commit a1efb352f24f2e86c99a4ca94b64384cd991bc09)
</content>
</entry>
<entry>
<title>sys/xen: Use __printflike() instead of format(printf)</title>
<updated>2026-01-04T01:46:52Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2025-09-16T04:54:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=21961607e631a9c00a6a8aa1a20d3b2034f834ae'/>
<id>urn:sha1:21961607e631a9c00a6a8aa1a20d3b2034f834ae</id>
<content type='text'>
The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:	1 week

(cherry picked from commit 4cd7be3e81863bd22aacccc34fc2e8b2cfcb14d9)
</content>
</entry>
<entry>
<title>x86/xen: fix accounted interrupt time</title>
<updated>2025-06-25T08:31:14Z</updated>
<author>
<name>Roger Pau Monné</name>
<email>royger@FreeBSD.org</email>
</author>
<published>2024-03-05T13:15:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fad4064226b2aa3de6a6c83adb7e0e0108e69bd3'/>
<id>urn:sha1:fad4064226b2aa3de6a6c83adb7e0e0108e69bd3</id>
<content type='text'>
The current addition to the interrupt nesting level in
xen_arch_intr_handle_upcall() needs to be compensated in
xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler
end up seeing a td_intr_nesting_level of 2 or more, which makes them assume
there's been an interrupt nesting.

Such extra interrupt nesting count lead to statclock() reporting idle time as
interrupt, as the call from interrupt context will always be seen as a nested
one (td-&gt;td_intr_nesting_level &gt;= 2) due to the nesting count increase done by
both xen_arch_intr_handle_upcall() and intr_execute_handlers().

Fix this by adjusting the nested interrupt count before dispatching interrupts
from xen_intr_handle_upcall().

PR: 277231
Reported by: Matthew Grooms &lt;mgrooms@shrew.net&gt;
Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter')
Sponsored by: Cloud Software Group
Reviewed by: Elliott Mitchell &lt;ehem+freebsd@m5p.com&gt;

(cherry picked from commit f750dce972efaea614aa6d03ecdb24aa962a38a4)
</content>
</entry>
<entry>
<title>xen/blk{front,back}: fix usage of sector sizes different than 512b</title>
<updated>2024-10-15T08:12:19Z</updated>
<author>
<name>Roger Pau Monné</name>
<email>royger@FreeBSD.org</email>
</author>
<published>2024-08-26T11:57:36Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=11432d8f076579adbfad6363f0440ebafc5971e5'/>
<id>urn:sha1:11432d8f076579adbfad6363f0440ebafc5971e5</id>
<content type='text'>
The units of the size reported in the 'sectors' xenbus node is always 512b,
regardless of the value of the 'sector-size' node.  The sector offsets in
the ring requests are also always based on 512b sectors, regardless of the
'sector-size' reported in xenbus.

Fix both blkfront and blkback to assume 512b sectors in the required fields.

The blkif.h public header has been recently updated in upstream Xen repository
to fix the regressions in the specification introduced by later modifications,
and clarify the base units of xenstore and shared ring fields.

PR: 280884
Reported by: Christian Kujau
MFC after: 1 week
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D46756

(cherry picked from commit e7fe85643735ffdcf18ebef81343eaac9b8d2584)
</content>
</entry>
<entry>
<title>xen-netfront: attempt to make cleanup idempotent</title>
<updated>2024-10-11T07:06:25Z</updated>
<author>
<name>Roger Pau Monné</name>
<email>royger@FreeBSD.org</email>
</author>
<published>2023-11-03T09:28:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c1782c2d28a59fab389aa6457f109afe3e9b43fc'/>
<id>urn:sha1:c1782c2d28a59fab389aa6457f109afe3e9b43fc</id>
<content type='text'>
Current cleanup code assumes that all the fields are allocated and/or setup by
the time cleanup is called, but this is not always true: a failure in mid-setup
of the device will cause the functions to be called with possibly uninitialized
fields.

Fix the functions to cope with such sate, while also attempting to make the
cleanup idempotent.

Finally fix an error path during setup that would not mark the device as
closed, and hence prevents the kernel from finishing booting.

Fixes: 96375eac945c ("xen-netfront: add multiqueue support")
Sponsored by: Citrix Systems R&amp;D

(cherry picked from commit 318bbb6d5a1eae77eb5dc687bcc63c0f99558e21)
</content>
</entry>
<entry>
<title>xen: fix initialization of grant table frame array</title>
<updated>2024-10-11T07:06:13Z</updated>
<author>
<name>Roger Pau Monné</name>
<email>royger@FreeBSD.org</email>
</author>
<published>2023-11-02T17:23:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=329a3b0844e6671a3119a3f4da98e826c1c6199e'/>
<id>urn:sha1:329a3b0844e6671a3119a3f4da98e826c1c6199e</id>
<content type='text'>
The current sizing of the array used to store grant table frames is broken, as
the calculation:

       max_nr_glist_frames = (boot_max_nr_grant_frames *
                              GREFS_PER_GRANT_FRAME /
                              (PAGE_SIZE / sizeof(grant_ref_t)));

Is plain bogus, for once grant_ref_t is the type of the grant reference, but
not the entry used to store such references in the grant frames.  But even if
the above calculation is switched to use grant_entry_v1_t, it would end up as:

       max_nr_glist_frames = (boot_max_nr_grant_frames *
                              (PAGE_SIZE / sizeof(grant_entry_v1_t)) /
                              (PAGE_SIZE / sizeof(grant_entry_v1_t)));

Which is pointless (note GREFS_PER_GRANT_FRAME has been expanded to (PAGE_SIZE
/ sizeof(grant_entry_v1_t))).

Just use boot_max_nr_grant_frames directly to size the grant table frames
array.

Fixes: 30d1eefe3937 ("Import OS interfaces to Xen services.")
Sponsored by: Citrix Systems R&amp;D

(cherry picked from commit 1a12f0aea81b57d0dd2374047b8f4c97a037a8df)
</content>
</entry>
<entry>
<title>xen/netfront: Decouple XENNET tags from mbuf lifetimes</title>
<updated>2024-08-20T13:27:05Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-08-02T13:09:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7178003234932e62dd552da9b39d2e6c35ed97f8'/>
<id>urn:sha1:7178003234932e62dd552da9b39d2e6c35ed97f8</id>
<content type='text'>
netmap's generic mode tries to improve performance by minimizing mbuf
allocations.  In service of this goal, it maintains an extra reference
to the mbuf and polls the counter to see if the driver has released its
reference by calling m_freem().  As a result, the extref destructor is
not called when expected by the netfront driver, and mbufs tags are not
freed.

Modify the tx path to release its mbuf tags promptly when reclaiming tx
descriptors.  They are drawn from a fixed-size pool, so otherwise are
quickly exhausted when a netfront interface is in netmap generic mode.

Co-authored by:	royger
MFC after:	2 weeks
Fixes:	dabb3db7a817 ("xen/netfront: deal with mbuf data crossing a page boundary")
Sponsored by:	Cloud Software Group
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor

(cherry picked from commit 2e4781cb12af2d13262ed5decf6fd95c8d58d9f5)
</content>
</entry>
<entry>
<title>gntdev: Handle errors from suword32() in gntdev_alloc_gref()</title>
<updated>2024-01-02T00:29:56Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2023-12-26T01:42:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=494fe2e050a69455f33f76a365bd884f3a32842b'/>
<id>urn:sha1:494fe2e050a69455f33f76a365bd884f3a32842b</id>
<content type='text'>
Try to copy out output values before handling errors, and check that we
did so successfully.  In particular, it doesn't seem sensible to ignore
errors here, otherwise userspace won't have any way to refer to the
allocations.

This is in preparation for annotating copyin() and related functions
with __result_use_check.

Reviewed by:	royger
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43145

(cherry picked from commit 6cdff09c0d70f780a738dbd3d87deb3b13ec8446)
</content>
</entry>
<entry>
<title>xen: improve shutdown hook</title>
<updated>2023-12-08T22:02:44Z</updated>
<author>
<name>Mitchell Horne</name>
<email>mhorne@FreeBSD.org</email>
</author>
<published>2023-11-23T15:27:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c13f564f9176c3d946e61519ddbfa0c1e23114ab'/>
<id>urn:sha1:c13f564f9176c3d946e61519ddbfa0c1e23114ab</id>
<content type='text'>
Make better use of the shutdown flags. In particular this now handles
standard reboot where RB_POWERCYCLE is not set, and indicates a crash
when the system has panicked.

While here, give the function a prefix.

Reviewed by:	royger, markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D42343

(cherry picked from commit 9e0b0f5de67fd46bddf0e12ef7b71d76a7ec1667)
</content>
</entry>
<entry>
<title>netfront: fix the support for disabling LRO at boot time</title>
<updated>2023-11-12T10:37:16Z</updated>
<author>
<name>Doug Rabson</name>
<email>dfr@FreeBSD.org</email>
</author>
<published>2023-08-12T13:19:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=61ba094af4b4798bf2887c30af5c14d66ead706f'/>
<id>urn:sha1:61ba094af4b4798bf2887c30af5c14d66ead706f</id>
<content type='text'>
The driver has a tunable hw.xn.enable_lro which is intended to control
whether LRO is enabled. This is currently non-functional - even if its
set to zero, the driver still requests LRO support from the backend.
This change fixes the feature so that if enable_lro is set to zero, LRO
no longer appears in the interface capabilities and LRO is not requested
from the backend.

PR:		273046
MFC after:	1 week
Reviewed by:	royger
Differential Revision: https://reviews.freebsd.org/D41439

(cherry picked from commit da4b0d6eb06d730487d48e15d2d5e10c56266fd9)
</content>
</entry>
</feed>
