vchiq: Rename timer func so they do not conflict with linuxkpi
vchi: rename bitset macros to avoid collision with bitset(9)An upcoming change to include bitset(9) macros from vm_page.hcauses a macro name collision with vchi's custom bitset macros.This chang
vchi: rename bitset macros to avoid collision with bitset(9)An upcoming change to include bitset(9) macros from vm_page.hcauses a macro name collision with vchi's custom bitset macros.This change was performed mechanically by: sed -i .orig s/BITSET/VCHI_BITSET/g $(grep -rl BITSET sys/contrib/vchiq)Reviewed by: andrewApproved by: scottl (implicit)MFC after: 1 weekSponsored by: Ampere Computing, Inc.Differential Revision: https://reviews.freebsd.org/D26177
show more ...
Change synchonization rules for vm_page reference counting.There are several mechanisms by which a vm_page reference is held,preventing the page from being freed back to the page allocator. Inpa
Change synchonization rules for vm_page reference counting.There are several mechanisms by which a vm_page reference is held,preventing the page from being freed back to the page allocator. Inparticular, holding the page's object lock is sufficient to prevent thepage from being freed; holding the busy lock or a wiring is sufficent aswell. These references are protected by the page lock, which musttherefore be acquired for many per-page operations. This results infalse sharing since the page locks are external to the vm_pagestructures themselves and each lock protects multiple structures.Transition to using an atomically updated per-page reference counter.The object's reference is counted using a flag bit in the counter. Asecond flag bit is used to atomically block new references viapmap_extract_and_hold() while removing managed mappings of a page.Thus, the reference count of a page is guaranteed not to increase if thepage is unbusied, unmapped, and the object's write lock is held. Asa consequence of this, the page lock no longer protects a page'sidentity; operations which move pages between objects are nowsynchronized solely by the objects' locks.The vm_page_wire() and vm_page_unwire() KPIs are changed. The formerrequires that either the object lock or the busy lock is held. Thelatter no longer has a return value and may free the page if it releasesthe last reference to that page. vm_page_unwire_noq() behaves the sameas before; the caller is responsible for checking its return value andfreeing or enqueuing the page as appropriate. vm_page_wire_mapped() isintroduced for use in pmap_extract_and_hold(). It fails if the page isconcurrently being unmapped, typically triggering a fallback to thefault handler. vm_page_wire() no longer requires the page lock andvm_page_unwire() now internally acquires the page lock when releasingthe last wiring of a page (since the page lock still protects a page'squeue state). In particular, synchronization details are no longerleaked into the caller.The change excises the page lock from several frequently executed codepaths. In particular, vm_object_terminate() no longer bounces betweenpage locks as it releases an object's pages, and direct I/O andsendfile(SF_NOCACHE) completions no longer require the page lock. Inthese latter cases we now get linear scalability in the common scenariowhere different threads are operating on different files.__FreeBSD_version is bumped. The DRM ports have been updated toaccomodate the KPI changes.Reviewed by: jeff (earlier version)Tested by: gallatin (earlier version), phoSponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D20486
Merge the vm_page hold and wire mechanisms.The hold_count and wire_count fields of struct vm_page are separatereference counters with similar semantics. The remaining essentialdifferences are th
Merge the vm_page hold and wire mechanisms.The hold_count and wire_count fields of struct vm_page are separatereference counters with similar semantics. The remaining essentialdifferences are that holds are not counted as a reference with respectto LRU, and holds have an implicit free-on-last unhold semantic whereasvm_page_unwire() callers must explicitly determine whether to free thepage once the last reference to the page is released.This change removes the KPIs which directly manipulate hold_count.Functions such as vm_fault_quick_hold_pages() now return wired pagesinstead. Since r328977 the overhead of maintaining LRU for wired pagesis lower, and in many cases vm_fault_quick_hold_pages() callers wouldswap holds for wirings on the returned pages anyway, so with this changewe remove a number of page lock acquisitions.No functional change is intended. __FreeBSD_version is bumped.Reviewed by: alc, kibDiscussed with: jeffDiscussed with: jhb, np (cxgbe)Tested by: pho (previous version)Sponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D19247
Extract eventfilter declarations to sys/_eventfilter.hThis allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea
Extract eventfilter declarations to sys/_eventfilter.hThis allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces headerpollution substantially.EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .cfiles into appropriate headers (e.g., sys/proc.h, powernv/opal.h).As a side effect of reduced header pollution, many .c files and headers nolonger contain needed definitions. The remainder of the patch addressesadding appropriate includes to fix those files.LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required bysys/mutex.h since r326106 (but silently protected by header pollution priorto this change).No functional change (intended). Of course, any out of tree modules thatrelied on header pollution for sys/eventhandler.h, sys/lock.h, orsys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
sx: retire SX_NOADAPTIVEThe flag is not used by anything for years and supporting it requires anexplicit read from the lock when entering slow path.Flag value is left unused on purpose.Sponsor
sx: retire SX_NOADAPTIVEThe flag is not used by anything for years and supporting it requires anexplicit read from the lock when entering slow path.Flag value is left unused on purpose.Sponsored by: The FreeBSD Foundation
vchiq: Use mallocarray() to provide kcalloc()This means we now also provide integer overflow protection, like theLinux kcalloc().
Modernize the use of vm_page_unwire(). Since r288122, vm_page_unwire()has returned TRUE when the wire count transitions to zero, eliminatingthe need for callers to inspect the page's wire count.
Modernize the use of vm_page_unwire(). Since r288122, vm_page_unwire()has returned TRUE when the wire count transitions to zero, eliminatingthe need for callers to inspect the page's wire count.MFC after: 1 week
Remove unneeded include of vm_phys.h.
Stop including sys/types.h from arm's machine/atomic.h, fix the placeswhere atomic.h was being included without ensuring that types.h (viaparam.h) was included first, as required by atomic(9).
[vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded stringAlthough vchiq_build_date and vchiq_build_time are not used in currentvchi driver at the moment, make sure these value will n
[vchi] replace non-reproducible __DATE__/__TIME__ with hardcoded stringAlthough vchiq_build_date and vchiq_build_time are not used in currentvchi driver at the moment, make sure these value will not leak intobuild later on if at some point they will be refered in some newimported codePR: 215494Reported by: emasteMFC after: 1 week
Reduce dmesg verbosity.
Fix improper use of "its".Sponsored by: Dell EMC Isilon
Make VCHI driver compatible with upstream DT- Add compatibility string- Compensate difference in base address between our custom DTB and upstream one
Update VCHIQ driver to upstream version 4eda74f2PR: 211525Submitted by: Sylvain Garrigues <[email protected]>
ARM: Use new ARMv6 naming conventions for cache and TLB functionsin all but ARMv4 specific files.Expand ARMv6 compatibility stubs in cpu-v4.h. Use physical addressin L2 cache functions if ARM_L2_P
ARM: Use new ARMv6 naming conventions for cache and TLB functionsin all but ARMv4 specific files.Expand ARMv6 compatibility stubs in cpu-v4.h. Use physical addressin L2 cache functions if ARM_L2_PIPT is defined.
Fix order of last two arguments of mtx_initSpotted by: [email protected]
Fix inconsistent use of malloc type for cdev private data.Remove M_VCHIQ malloc type, now not used anywhere.Reviewed by: gonzoApproved by: kib (mentor)
Fix slots DMA memory handling. It's similar to r290553.Discussed with: gonzoApproved by: kib (mentor)
Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocatedby bus_dmamem_alloc() which creates associated bus_dmamap_t map for us.When this memory is freed by bus_dmamem_free(), the ma
Fix pagelist bus_dmamap_t map handling. Memory for pagelist is allocatedby bus_dmamem_alloc() which creates associated bus_dmamap_t map for us.When this memory is freed by bus_dmamem_free(), the map is freed as well.Thus there is no need to free it explicitly by bus_dmamap_destroy(),which leads to double freeing.Discussed with: gonzoApproved by: kib (mentor)
vchiq interrupt is MP safe, add respective flag to bus_setup_intr
Fix locking for VCHI driver by matching sleepable/non-sleepable APIs:- Emulate Linux mutex API using sx(9) locks with only exclusive operations instead of mutex(9), in Linux mutexes are sleepab
Fix locking for VCHI driver by matching sleepable/non-sleepable APIs:- Emulate Linux mutex API using sx(9) locks with only exclusive operations instead of mutex(9), in Linux mutexes are sleepable.- Emulate Linux rwlock_t using rwlock(9) instead of sx(9). rwlock_t in Linux are spin locks
Fix cache issues with bulk transfers- Use pmap_quick_enter_page/pmap_quick_remove_page to bounce non-cacheline aligned head and tail fragments- Switch from static fragment size to configurable
Fix cache issues with bulk transfers- Use pmap_quick_enter_page/pmap_quick_remove_page to bounce non-cacheline aligned head and tail fragments- Switch from static fragment size to configurable one, newer firmware passes cache line size as cache_line_size DTB parameter.With these changes both RPi and RPi2 pass functinal part of vchiq_test
Synchronize with latest upstream VCHI code:- Add LIB_VERSION ioctl- Add CLOSE_DELIVERED ioctl- Bump code versionUpstream version: 3782f2ad42c08f4d32f64138f8be7341afc380f5
Fix BULK read transfer if destination buffer is not cache line-aligned.We can't use copyout because destination memory is userland addressin another process but we have reference to respective pag
Fix BULK read transfer if destination buffer is not cache line-aligned.We can't use copyout because destination memory is userland addressin another process but we have reference to respective page so mapthe page into kernel address space and copy fragments there
12