Convert remaining cap_rights_init users to cap_rights_init_onesemantic patch:@@expression rights, r;@@- cap_rights_init(&rights, r)+ cap_rights_init_one(&rights, r)
amd64: clean up empty lines in .c and .h files
Fix a few places that free a page from an object without busy held. This istightening constraints on busy as a precursor to lockless page lookup andshould largely be a NOP for these cases.Review
Fix a few places that free a page from an object without busy held. This istightening constraints on busy as a precursor to lockless page lookup andshould largely be a NOP for these cases.Reviewed by: alc, kib, markjDifferential Revision: https://reviews.freebsd.org/D22611
show more ...
(4/6) Protect page valid with the busy lock.Atomics are used for page busy and valid state when the shared busy isheld. The details of the locking protocol and valid and dirtysynchronization are
(4/6) Protect page valid with the busy lock.Atomics are used for page busy and valid state when the shared busy isheld. The details of the locking protocol and valid and dirtysynchronization are in the updated vm_page.h comments.Reviewed by: kib, markjTested by: phoSponsored by: Netflix, IntelDifferential Revision: https://reviews.freebsd.org/D21594
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
Add a return value to vm_page_remove().Use it to indicate whether the page may be safely freed followingits removal from the object. Also change vm_page_remove() to assumethat the page's object
Add a return value to vm_page_remove().Use it to indicate whether the page may be safely freed followingits removal from the object. Also change vm_page_remove() to assumethat the page's object pointer is non-NULL, and have callers performthis check instead.This is a step towards an implementation of an atomic reference counterfor each physical page structure.Reviewed by: alc, dougm, kibMFC after: 1 weekSponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D20758
Prevent loading SGX with incorrect EPC dataIt may happen on some machines, that even if SGX is disabledin firmware, the driver would still attach despite EPC base andsize equal zero. Such behavio
Prevent loading SGX with incorrect EPC dataIt may happen on some machines, that even if SGX is disabledin firmware, the driver would still attach despite EPC base andsize equal zero. Such behaviour causes a kernel panic when themodule is unloaded. Add a simple check to make sure weonly attach when these values are correctly set.Submitted by: Kornel Duleba <[email protected]>Reviewed by: brObtained from: SemihalfSponsored by: StormshieldDifferential Revision: https://reviews.freebsd.org/D19595
Fix refcount leaks in the SGX Linux compat ioctl handler.Some argument validation error paths would return without releasing thefile reference obtained at the beginning of the function.While her
Fix refcount leaks in the SGX Linux compat ioctl handler.Some argument validation error paths would return without releasing thefile reference obtained at the beginning of the function.While here, fix some style bugs and remove trivial debug prints.Reviewed by: kibMFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D19214
Rename assym.s to assym.incassym is only to be included by other .s files, and should neveractually be assembled by itself.Reviewed by: imp, bdrewery (earlier)Sponsored by: The FreeBSD Foundati
Rename assym.s to assym.incassym is only to be included by other .s files, and should neveractually be assembled by itself.Reviewed by: imp, bdrewery (earlier)Sponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D14180
Fix module unload when SGX support is not present in CPU.Sponsored by: DARPA, AFRL
Rename macro DEBUG to SGX_DEBUG.This fixes LINT kernel build.Reported by: lwhsuSponsored by: DARPA, AFRL
Add support for Intel Software Guard Extensions (Intel SGX).Intel SGX allows to manage isolated compartments "Enclaves" in user VAspace. Enclaves memory is part of processor reserved memory (PRM)
Add support for Intel Software Guard Extensions (Intel SGX).Intel SGX allows to manage isolated compartments "Enclaves" in user VAspace. Enclaves memory is part of processor reserved memory (PRM) andalways encrypted. This allows to protect user application code and datafrom upper privilege levels including OS kernel.This includes SGX driver and optional linux ioctl compatibility layer.Intel SGX SDK for FreeBSD is also available.Note this requires support from hardware (available since late IntelSkylake CPUs).Many thanks to Robert Watson for support and Konstantin Belousovfor code review.Project wiki: https://wiki.freebsd.org/Intel_SGX.Reviewed by: kibRelnotes: yesSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D11113