aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xen
Commit message (Collapse)AuthorAgeFilesLines
* xen: Use proper prototype for SYSINIT functionsZhenlei Huang2 days1-4/+2
| | | | | | | | | | 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)
* sys/xen: Use __printflike() instead of format(printf)Alex Richardson2026-01-041-1/+1
| | | | | | | | | | 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)
* x86/xen: fix accounted interrupt timeRoger Pau Monné2025-06-251-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | 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->td_intr_nesting_level >= 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 <mgrooms@shrew.net> Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter') Sponsored by: Cloud Software Group Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com> (cherry picked from commit f750dce972efaea614aa6d03ecdb24aa962a38a4)
* xen/blk{front,back}: fix usage of sector sizes different than 512bRoger Pau Monné2024-10-152-18/+47
| | | | | | | | | | | | | | | | | | | | | | 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)
* xen-netfront: attempt to make cleanup idempotentRoger Pau Monné2024-10-111-5/+22
| | | | | | | | | | | | | | | | | | 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&D (cherry picked from commit 318bbb6d5a1eae77eb5dc687bcc63c0f99558e21)
* xen: fix initialization of grant table frame arrayRoger Pau Monné2024-10-111-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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&D (cherry picked from commit 1a12f0aea81b57d0dd2374047b8f4c97a037a8df)
* xen/netfront: Decouple XENNET tags from mbuf lifetimesMark Johnston2024-08-201-1/+9
| | | | | | | | | | | | | | | | | | | | | | 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)
* gntdev: Handle errors from suword32() in gntdev_alloc_gref()Mark Johnston2024-01-021-5/+7
| | | | | | | | | | | | | | | | 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)
* xen: improve shutdown hookMitchell Horne2023-12-081-5/+11
| | | | | | | | | | | | | | | 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)
* netfront: fix the support for disabling LRO at boot timeDoug Rabson2023-11-121-2/+6
| | | | | | | | | | | | | | | | 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)
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1622-44/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-129-9/+9
| | | | | | | | | 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
* Mechanically convert Xen netfront/netback(4) to IfAPIJustin Hibbits2023-04-242-150/+153
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37800
* xen/intr: move sys/x86/xen/xen_intr.c to sys/dev/xen/bus/Julien Grall2023-04-141-0/+1131
| | | | | | | | | | | | The event channel source code or equivalent is needed on all architectures. Since much of this is viable to share, get this moved out of x86-land. Each interrupt interface then needs a distinct back-end implementation. Reviewed by: royger Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com> Original implementation: Julien Grall <julien@xen.org>, 2014-01-13 17:41:04 Differential Revision: https://reviews.freebsd.org/D30236
* xen/intr: move interrupt allocation/release to architectureElliott Mitchell2023-04-141-0/+3
| | | | | | | | | | | | | | | | Simply moving the interrupt allocation and release functions into files which belong to the architecture. Since x86 interrupt handling is quite distinct from other architectures, this is a crucial necessary step. Identifying the border between x86 and architecture-independent is actually quite tricky. Similarly, getting the prototypes for the border right is also quite tricky. Inspired by the work of Julien Grall <julien@xen.org>, 2015-10-20 09:14:56, but heavily adjusted. Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D30936
* xen/intr: move x86 PIC interface to xen_arch_intr.c, introduce wrappersJulien Grall2023-04-141-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The x86 PIC interface is very much x86-specific and not used by other architectures. Since most of xen_intr.c can be shared with other architectures, the PIC interface needs to be broken off. Introduce wrappers for calls into the architecture-dependent interrupt layer. All architectures need roughly the same functionality, but the interface is slightly different between architectures. Due to the wrappers being so thin, all of them are implemented as inline in arch-intr.h. The original implementation was done by Julien Grall in 2015, but this has required major updating. Removal of PVHv1 meant substantial portions disappeared. The original implementation took care of moving interrupt allocation to xen_arch_intr.c, but this has required massive rework and was broken off. In the original implementation the wrappers were normal functions. Some had empty stubs in xen_intr.c and were removed. Reviewed by: royger Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com> Original implementation: Julien Grall <julien@xen.org>, 2015-10-20 09:14:56 Differential Revision: https://reviews.freebsd.org/D30909
* xen/intr: move evtchn_type to intr-internal.hElliott Mitchell2023-04-141-0/+9
| | | | | | | | | | | | The evtchn_type enum is only touched by the Xen interrupt code. Other event channel uses no longer need the value, so that has been moved to restrict its use. Copyright note. The current evtchn_type was introduced at 76acc41fb7c7 by Justin T. Gibbs. This in turn appears to have been heavily inspired by 30d1eefe3937 done by Kip Macy. Reviewed by: royger
* xen/intr: introduce dev/xen/bus/intr-internal.hJulien Grall2023-04-141-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the xenisrc structure which needs to be shared between the core Xen interrupt code and architecture-dependent code into a separate header. A similar situation exists for the NR_EVENT_CHANNELS constant. Turn xi_intsrc into a type definition named xi_arch to reflect the new purpose of being an architectural variable for the interrupt source. This was originally implemented by Julien Grall, but has been heavily modified. The core side was renamed "intr-internal.h" and is #include'd by "arch-intr.h" instead of the other way around. This allows the architecture to add function definitions which use struct xenisrc. The original version only moved xi_intsrc into xen_arch_isrc_t. Moving xi_vector was done by the submitter. The submitter had also moved xi_activehi and xi_edgetrigger into xen_arch_isrc_t. Those disappeared with the removal of PVHv1 support. Copyright note. The current xenisrc structure was introduced at 76acc41fb7c7 by Justin T. Gibbs. Traces remain, but the strength of Copyright claims from before 2013 seem pretty weak. Reviewed by: royger Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>, 2021-03-17 19:09:01 Original implementation: Julien Grall <julien@xen.org>, 2015-10-20 09:14:56 Differential Revision: https://reviews.freebsd.org/D30648 [royger] - Adjust some line lengths - Fix comment about NR_EVENT_CHANNELS after movement. - Use #include instead of symlinks.
* xen/intr: adjust xen_intr_handle_upcall() to match driver filterElliott Mitchell2023-04-141-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xen_intr_handle_upcall() has two interfaces. It needs to be called by the x86 assembly code invoked by the APIC. Second, it needs to be called as a driver_filter_t for the XenPCI code and for architectures besides x86. Unfortunately the driver_filter_t interface was implemented as a wrapper around the x86-APIC interface. Now create a simple wrapper for the x86-APIC code, which calls an architecture-independent xen_intr_handle_upcall(). When called via intr_event_handle(), driver_filter_t functions expect preemption to be disabled. This removes the need for critical_enter()/critical_exit() when called this way. The lapic_eoi() call is only needed on x86 in some cases when invoked directly as an APIC vector handler. Additionally driver_filter_t functions have no need to handle interrupt counters. The intrcnt_add() calling function was reworked to match the current situation. intrcnt_add() is now only called via one path. The increment/decrement of curthread->td_intr_nesting_level had previously been left out. Appears this was mostly harmless, but this was noticed during implementation and has been added. CONFIG_X86 is a leftover from use with Linux. While the barrier isn't needed for FreeBSD on x86, it will be needed for FreeBSD on other architectures. Copyright note. xen_intr_intrcnt_add() was introduced at 76acc41fb7c7 by Justin T. Gibbs. xen_intrcnt_init() was introduced at fd036deac1695 by John Baldwin. sys/x86/xen/xen_arch_intr.c was originally created by Julien Grall in 2015 for the purpose of holding the x86 interrupt interface. Later it was found xen_intr_handle_upcall() was better earlier, and the x86 interrupt interface better later. As such the filename and header list belong to Julien Grall, but what those were created for is later. Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D30006
* xen: introduce XEN_CPUID_TO_VCPUID()/XEN_VCPUID()Julien Grall2023-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Part of the series for allowing FreeBSD/ARM to run on Xen. On ARM the function is a trivial pass-through, other architectures need distinct implementations. While implementing XEN_VCPUID() as a call to XEN_CPUID_TO_VCPUID() works, that involves multiple accesses to the PCPU region. As such make this a distinct macro. Only callers in machine independent code have been switched. Add a wrapper for the x86 PIC interface to use matching the old prototype. Partially inspired by the work of Julien Grall <julien@xen.org>, 2015-08-01 09:45:06, but XEN_VCPUID() was redone by Elliott Mitchell on 2022-06-13 12:51:57. Reviewed by: royger Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com> Original implementation: Julien Grall <julien@xen.org>, 2014-04-19 08:57:40 Original implementation: Julien Grall <julien@xen.org>, 2014-04-19 14:32:01 Differential Revision: https://reviews.freebsd.org/D29404
* xen: switch to using core atomics for synchronizationElliott Mitchell2023-03-292-20/+16
| | | | | | | | | | | | | | Now that the atomic macros are always genuinely atomic on x86, they can be used for synchronization with Xen. A single core VM isn't too unusual, but actual single core hardware is uncommon. Replace an open-coding of evtchn_clear_port() with the inline. Substantially inspired by work done by Julien Grall <julien@xen.org>, 2014-01-13 17:40:58. Reviewed by: royger MFC after: 1 week
* xen: bump used interface versionRoger Pau Monné2023-03-093-7/+5
| | | | | | | | | This is required for a further change that will make use of a field that was added in version 0x00040d00. No functional change expected. Sponsored by: Citrix Systems R&D
* xen/timer: rename "timer.c" to "xen_timer.c"Elliott Mitchell2023-02-051-1/+1
| | | | | | | | | The better to avoid conflicting with other files given how "timer.c" isn't a very unique name. ARM and RISC-V both have timer.c files. Reviewed by: royger, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/609 Differential Revision: https://reviews.freebsd.org/D36258
* xen/acpi: only evaluate Processor objects matching online CPUsRoger Pau Monné2022-11-291-0/+29
| | | | | | | | | | | | | | | | Current Xen Processor driver will evaluate any Processor object on the ACPI tables regardless of whether the processor is online or not. Avoid doing so for processors that are not online, as evaluating methods of processors that are not online could lead to accesses to invalid memory, and in any case the data that the driver fetches from the Processor ACPI object only makes sense for processors that are online. Note the CPU related data fetched from Xen using XENPF_get_cpuinfo hypercall could be cached, I leave that as a future optimization. Sponsored by: Citrix Systems R&D Fixes: b93f47eaeef7 ('xen/acpi: upload Cx and Px data to Xen')
* xen/netfront: deal with mbuf data crossing a page boundaryRoger Pau Monné2022-11-031-56/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's been a report recently of mbufs with data that crosses a page boundary. It seems those mbufs are generated by the iSCSI target system: https://lists.xenproject.org/archives/html/xen-devel/2021-12/msg01581.html In order to handle those mbufs correctly on netfront use the bus_dma interface and explicitly request that segments must not cross a page boundary. No other requirements are necessary, so it's expected that bus_dma won't need to bounce the data and hence it shouldn't introduce a too big performance penalty. Using bus_dma requires some changes to netfront, mainly in order to accommodate for the fact that now ring slots no longer have a 1:1 match with mbufs, as a single mbuf can use two ring slots if the data buffer crosses a page boundary. Store the first packet of the mbuf chain in every ring slot that's used, and use a mbuf tag in order to store the bus_dma related structures and a refcount to keep track of the pending slots before the mbuf chain can be freed. Reported by: G.R. Tested by: G.R. MFC: 1 week Differential revision: https://reviews.freebsd.org/D33876
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-221-2/+2
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* Adjust function definitions in xen's control.c to avoid clang 15 warningsDimitry Andric2022-07-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | With clang 15, the following -Werror warnings are produced: sys/dev/xen/control/control.c:188:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] xctrl_poweroff() ^ void sys/dev/xen/control/control.c:194:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] xctrl_reboot() ^ void sys/dev/xen/control/control.c:207:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] xctrl_suspend() ^ void sys/dev/xen/control/control.c:344:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] xctrl_crash() ^ void This is because xctrl_poweroff(), xctrl_reboot(), xctrl_suspend(), and xctrl_crash() are declared with (void) argument lists, but defined with empty argument lists. Make the definitions match the declarations. MFC after: 3 days
* Fix unused variable warning in xen's blkback.cDimitry Andric2022-07-261-3/+0
| | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/dev/xen/blkback/blkback.c:1561:12: error: variable 'req_seg_idx' set but not used [-Werror,-Wunused-but-set-variable] u_int req_seg_idx; ^ The 'req_seg_idx' variable was used in the for loop later in the xbb_dispatch_io() function, but refactoring in 112cacaee408 got rid of it. Remove the variable since it no longer serves any purpose. MFC after: 3 days
* Fix unused variable warning in xen's blkfront.cDimitry Andric2022-07-261-2/+1
| | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/dev/xen/blkfront/blkfront.c:602:6: error: variable 'sbp' set but not used [-Werror,-Wunused-but-set-variable] int sbp; ^ The 'sbp' variable was used in the for loop later in the xb_dump() function, but refactoring in e4808c4b2dba got rid of it. Remove the variable since it no longer serves any purpose. MFC after: 3 days
* xen/blkback: do not use x86 CPUID in generic codeRoger Pau Monné2022-06-281-6/+1
| | | | | | | | | Move checker for whether Xen creates IOMMU mappings for foreign pages into a helper that's defined in arch-specific code. Reported by: Elliott Mitchell <ehem+freebsd@m5p.com> Fixes: 1d528f95e8ce ('xen/blkback: remove bounce buffering mode') Sponsored by: Citrix Systems R&D
* xen/blkback: remove bounce buffering modeRoger Pau Monné2022-06-071-178/+22
| | | | | | | | | | | | | | Remove bounce buffering code for blkback and only attach if Xen creates IOMMU entries for grant mapped pages. Such bounce buffering consumed a non trivial amount of memory and CPU resources to do the memory copy, when it's been a long time since Xen has been creating IOMMU entries for grant maps. Refuse to attach blkback if Xen doesn't advertise that IOMMU entries are created for grant maps. Sponsored by: Citrix Systems R&D
* xen/blkback: fix tear-down issuesRoger Pau Monné2022-06-071-33/+30
| | | | | | | | | | | | | | Handle tearing down a blkback that hasn't been fully initialized. This requires carefully checking that fields are allocated before trying to access them. Also communication memory is allocated before setting XBBF_RING_CONNECTED, so gating it's freeing on XBBF_RING_CONNECTED being set is wrong and will lead to memory leaks. Also stop using xbb_disconnect() in error paths. Use xenbus_dev_fatal and let the normal disconnection procedure take care of the cleanup. Reported by: Ze Dupsys <zedupsys@gmail.com> Sponsored by: Citrix Systems R&D
* kerneldump: remove physical argument from d_dumperMitchell Horne2022-05-131-2/+1
| | | | | | | | | | | The physical address argument is essentially ignored by every dumper method. In addition, the dump routines don't actually pass a real address; every call to dump_append() passes a value of zero for physical. Reviewed by: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35173
* xen: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0619-54/+20
|
* xen: Use devclass_find to lookup devclasses in identify.John Baldwin2022-04-252-4/+4
| | | | | | | | While here, use driver->name instead of hardcoding the xenpv and xen_et strings both for devclass_find() and BUS_ADD_CHILD(). Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com>, imp, royger Differential Revision: https://reviews.freebsd.org/D35001
* xen/acpi: upload Cx and Px data to XenRoger Pau Monné2022-04-121-0/+605
| | | | | | | | | | | | | | | | | | | | | | When FreeBSD is running as dom0 (initial domain) on a Xen system it has access to the native ACPI tables and is the OSPM. However the hypervisor is the entity in charge of the CPU idle and frequency states, and in order to perform this duty it requires information found the ACPI dynamic tables that can only be parsed by the OSPM. Introduce a new Xen specific ACPI driver to fetch the Processor related information and upload it to Xen. Note that this driver needs to take precedence over the generic ACPI CPU driver when running as dom0, so downgrade the probe score of the native driver to BUS_PROBE_DEFAULT in order for the Xen specific driver to use BUS_PROBE_SPECIFIC. Tested on an Intel NUC to successfully parse and upload both the Cx and Px states to Xen. Sponsored by: Citrix Systems R&D Reviewed by: jhb kib Differential revision: https://reviews.freebsd.org/D34841
* xen netback: Remove write-only variables.John Baldwin2022-04-062-11/+5
|
* stack_zero is not needed before stack_saveEric van Gyzen2022-03-261-1/+0
| | | | | | | The man page was recently clarified to commit to this contract. MFC after: 1 week Sponsored by: Dell EMC Isilon
* vfs: NDFREE(&nd, NDF_ONLY_PNBUF) -> NDFREE_PNBUF(&nd)Mateusz Guzik2022-03-241-1/+1
|
* xen: switch to use headers in contribElliott Mitchell2022-02-079-15/+15
| | | | | | | | | | These headers originate with the Xen project and shouldn't be mixed with the main portion of the FreeBSD kernel. Notably they shouldn't be the target of clean-up commits. Switch to use the headers in sys/contrib/xen. Reviewed by: royger
* xen/grant-table: remove explicit linear mapping additionsRoger Pau Monné2022-02-071-22/+6
| | | | | | | | | | | | | | There's no need to explicitly add linear mappings for the grant table area, as the memory is allocated using xenmem_alloc and it should already have a linear mapping that can be obtained using rman_get_virtual. While there also remove the return value of gnttab_map, since there's no return value anymore. Sponsored by: Citrix Systems R&D Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com> Differential revision: https://reviews.freebsd.org/D29602
* xen: use an hypercall for shutdown and rebootRoger Pau Monné2022-01-131-12/+6
| | | | | | | | | | | | | | | When running as a Xen guest it's easier to use an hypercall in order to do power management operations (power off, power cycle). Do this for all supported guest types (HVM and PVH). Note that for HVM the power operation could also be done using ACPI, but there's no reason to differentiate between PVH and HVM. While there fix the shutdown handler to properly differentiate between power cycle and power off requests. Reported by: Freddy DISSAUX MFC: 1 week Sponsored by: Citrix Systems R&D
* xen/blkfront: Remove CTLFLAG_NEEDGIANT from sysctl.Alexander Motin2021-12-261-1/+1
| | | | | | It only converts bit field into string. It does not need locking. MFC after: 1 week
* xen: plug some of set-but-not-used varsMateusz Guzik2021-12-157-14/+7
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* Create wrapper for Giant taken for newbusWarner Losh2021-12-101-5/+4
| | | | | | | | | | | Create a wrapper for newbus to take giant and for busses to take it too. bus_topo_lock() should be called before interacting with newbus routines and unlocked with bus_topo_unlock(). If you need the topology lock for some reason, bus_topo_mtx() will provide that. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31831
* xen/dev: remove write-only variableElliott Mitchell2021-11-301-3/+1
| | | | | | | | This was found while looking for driver_filter_t functions which got the trap frame from the argument. This particular instance it isn't even used, so remove now lest someone else get to it first. Reviewed by: mhorne
* xen(4): Fix two typos in source code commentsGordon Bergling2021-11-301-2/+2
| | | | | | - s/segement/segment/ MFC after: 3 days
* vfs: remove the unused thread argument from NDINIT*Mateusz Guzik2021-11-251-1/+1
| | | | | | See b4a58fbf640409a1 ("vfs: remove cn_thread") Bump __FreeBSD_version to 1400043.
* xen/privcmd: fix MMAP_RESOURCE ioctl to copy out resultsRoger Pau Monné2021-11-181-5/+3
| | | | | | | | | | | The current definition for the MMAP_RESOURCE ioctl was wrong as it didn't copy back the result to the caller. Fix the definition and also remove the bogus attempt to copy the result in the implementation. Note such copy back is only needed when querying the size of a resource. Sponsored by: Citrix Systems R&D