| /xnu-11215/bsd/miscfs/devfs/ |
| H A D | README | 10 as the only devices that register themselves are the floppy, 17 for reasons that will become obvious in a second. Think of it as a 19 a "devnode" struct, that holds information about the device 21 with that node. The back node itself can be considered to be 23 and a link to the directory that holds it. It is sometimes refered 43 the nodes can be moved around within that plane (or deleted). 48 Front nodes that refer to devices, use the same "devnode" struct that is used 49 by their associated backing node, so that multiple front nodes that 61 Information that is to be shared between these mounts is stored 103 plane that controls to the mount being updated.. that would have the [all …]
|
| /xnu-11215/doc/building/ |
| H A D | bound_checks.md | 4 security issues. However, that escalation is prevented by crashing the program, 11 process that implements our best practices to adopt -fbounds-safety in existing 22 There are four options that control aspects related to -fbounds-safety: 36 check in that function will jump to that trap instruction when they fail. Debug 49 context of our panic we know that `x8` is 0x0 and `x9` is 0x1000, then we know 50 we can't possibly have failed because of that bounds check. There are scripts 77 changes that stick, and help reduce the likelihood of introducing problems that 83 compile-time that bounds could be known at runtime (if necessary) for all 87 that your changes did not impact kernel functionality. 92 that you send to integration testing. [all …]
|
| H A D | xnu_build_consolidation.md | 15 reduce the number of existing builds, as well as to set up a simple framework that makes it easier … 27 of the SoC-specific aspects of the KernelCache are abstracted by the KEXTs. Things that pertain to … 31 * Addresses of PIO registers that are to be accessed from the XNU side. 35 * Certain kernel-visible architectural features are optional, which means that two same-generation … 40 extensions provide r/o registers that can be checked at runtime to discover supported features as w… 63 This has led in the past to a number of nested, conditionally-compiled blocks of code that are not … 72 4. Providing a family of assembly macros that can be used to conditionally execute code on a specif… 76 `MIDR_EL1` register against a CPU revision that is passed as a parameter to the macro, where applic… 83 Some architectural features are optional, which means that, when disabled at compile-time, this may… 92 ml_feature_supported(), that may be used to check for the presence of a feature at runtime. [all …]
|
| /xnu-11215/doc/vm/ |
| H A D | sanitize.md | 10 by providing a set of APIs that can be used to perform consistent, thorough 12 freely operate on the input without worrying that future computations may 13 overflow. Note that these APIs are meant to primarily catch issues with 20 To enforce that sanitization is performed on input prior to use, 24 respective sanitization functions (that validates and unwraps them) 48 - optionally *rewrites* that error first, either to a different 53 type and on the identity of the VM API that called the sanitizer. 89 immediately, distinct from the sanitizer telling the VM API that 244 - Ensure that you return safe values on failure for all opaque types that 307 can't handle that. [all …]
|
| H A D | freezer.md | 8 …ps out all of their dirty memory. It then moves them to jetsam band 75 so that they're protected f… 26 …that can be in the freezer. `memorystatus_freeze_shared_mb_per_process_max` is the maximum amount … 30 We assume that shared memory will be accessed by a non frozen process while the frozen process is s… 36 For 2, daemons should not touch memory that is shared with a suspended app while that app is suspen… 48 …(we skip coalition members that are not the leader). Once we freeze a coalition leader, we check f… 70 …that `vm_map_freeze` does **not** read data back in from NAND. It will copy compressed memory from… 107 | kern.memorystatus\_freeze\_pages\_min | The min. number of resident pages that a process needs to… 108 …status\_freeze\_processes\_max | The max. number of processes that can be frozen. Note that we can… 112 | kern.memorystatus\_max\_freeze\_demotions\_daily | The maximum number of demotions that the freez… 117 | kern.memorystatus\_freeze\_max\_candidate\_band | The maximum jetsam band that a freezer eligible… [all …]
|
| H A D | memorystatus_kills.md | 16 … | synchronously on thread that tries to allocate a… 20 … | thread that went over the proce… 21 … | thread that disabled the freeze… 35 …y order to free up vnodes. These kills happen synchronously on the thread that is trying to acquir… 67 …that memorystatus also registers the `phys_footprint` limit when it's a soft limit. In that case t… 71 … the `vm.freeze_enabled` sysctl. The thread that performs this sysctl then kills every frozen proc… 80 …thread calls `memorystatus_idle_exit_from_VM` to kill 1 idle daemon. Note that daemons must opt in… 88 The compressor has detected that we've exceeded a specific number of compressions and decompression… 113 …bsd/kern/kern_memorystatus_policy.c` is responsible for picking an action that the memorystatus th… 118 …US_KILL_TOP_PROCESS` and pick the specific kill cause based on the reason that the system is unhea… [all …]
|
| H A D | memorystatus.md | 17 Depending on the resource, there are a variety of actions that memorystatus might take. 20 for killing processes that go over their per-process memory limits. 41 (that should be in `bsd/kern/kern_memorystatus_policy.c`), but that's a recent refactor so 67 Notice that the memorystatus thread does not explicitly check why it was woken up. 113 … it's defined as `pageable_external + free + secluded_over_target + purgeable`. Breaking that down: 116 …ded_mem_mb`. Secluded memory is a special pool of memory that's intended for the camera so that it… 117 …that the VM can treat the contents of a range of pages as volatile and quickly free the backing pa… 135 This section lists the threads that comprise the memorystatus subsystem. More details on each threa… 170 The memorystatus subsystem provides a snapshot mechanism so that 172 a snapshot of the system at the time that memorystatus performed [all …]
|
| /xnu-11215/doc/allocators/ |
| H A D | read-only.md | 7 The Read-Only Allocator is an extension of the zone allocator that facilitates 21 as PAC, means that today's attacker favors data-only attacks to achieve 23 target data structures in the kernel's memory that effectively disables or 26 By necessity, we store lots of data on the heap that informs the various 34 mechanism, but unfortunately that doesn't cater for dynamic runtime 37 This is where the Read-Only Allocator provides its defense: we observe that 45 relatively expensive `zalloc_ro_mut` function. By insisting that data be 47 of targeting that data towards the cost of seizing control of kernel 60 "back reference") that is validated when traversing from read/write to 99 macro that automatically zeroes the pointer after freeing. [all …]
|
| H A D | api-basics.md | 9 - the VM subsystem that provides allocations at the granularity of pages (with 24 - `<kern/zalloc_internal.h>` for interfaces that need to be exported 51 - `Z_WAITOK` means that the zone allocator can wait and block, 68 `Z_NOFAIL` can be used to denote that the caller knows about this. 120 Do note that `__kernel_data_semantics` and `__kernel_dual_semantics` 130 we have typically found that there is a large array of data, 160 the kernel pointers and the second that is untyped and data-only. 213 Note that this is absolutely OK to use this variant 242 Note that this is absolutely OK to use this variant 296 Note that idiomatic IOKit is supposed to use `OSTypeAlloc(Class)`. [all …]
|
| /xnu-11215/doc/lifecycle/ |
| H A D | startup.md | 11 values of the `startup_subsystem_id_t` type) that get initialized in sequence. 13 A subsystem can use ranks to order the various initializers that make up its 17 The subsystem module will basically run hooks in that order: 50 Initializes various globals that alter the behavior of the kernel, lookup 53 - `TUNABLES`: parses a boot arg into a global that will become read-only at 60 - Middle: globals that require complex initialization (e.g. SFI classes). 75 - Middle: global lock timeouts that are derived from machine timeouts. 82 Initializes early locks that do not require any memory allocations to be 130 Denotes that `kmem_alloc` is now usable. 264 Denotes that subsystems that expect to operate with [all …]
|
| H A D | hibernation.md | 49 with that IOMedia. 78 state such that polled I/Os can be issued. 100 These are the portions of XNU itself that are required during hibernation 110 that XNU doesn't need to know the details. 113 that can be used by the booter to validate this content. 114 * The portions of XNU (code and data) that are stored directly to the 116 portions of XNU that are available during resume to decompress the image. 122 well as the stack that hibernation resume will run on. 170 payload; that is the kernel's responsibility. 213 - On ARM64, an important difference is that a normal S2R wake on some [all …]
|
| /xnu-11215/osfmk/kern/ |
| H A D | kern_debug.modulemap | 2 // but that results in a compiler error. Maybe clang only supports sourcing 9 // libkdd can’t use <kern/kcdata.h> because it doesn’t produce that header 11 // mapping to the new one in SRCROOT. To get around that, libkdd uses 15 // of redeclaration sadness that the include guards somehow don’t block. 18 // module that sits on top of Darwin. libkdd uses the DarwinPrivate module 19 // too, and so that can't transitively include <kern/kcdata.h> for the
|
| H A D | kcdata.modulemap | 4 // <kern/kcdata.h> because it doesn’t produce that header itself, and so Xcode 6 // SRCROOT. To get around that, libkdd uses <kcdata.h> to not match anything in 9 // will run into all kinds of redeclaration sadness that the include guards 12 // needs its own top level module that sits on top of Darwin.
|
| /xnu-11215/ |
| H A D | APPLE_LICENSE | 12 work as "Original Code" and stating that it is subject to the terms of 18 acquired, owned by or assigned to Apple and (ii) that cover subject 22 rights, (i) claims of patents that are now or hereafter acquired, 26 1.2 "Contributor" means any person or entity that creates or 50 statements that contains any part of Covered Code. 85 non-commercial purposes, provided that in each instance: 90 Original Code that refer to this License; and 95 that alter or restrict this License or the recipients' rights 267 against Apple; provided that Apple did not first commence 312 future enforcement of that or any other provision. Any law or [all …]
|
| /xnu-11215/doc/mach_ipc/ |
| H A D | kmsg.md | 9 IPC kmsg have a complex in memory layout that is designed to separate kernel 10 pointers from user controled data. There are 4 layouts that we'll present in 71 Note that subsystems like MIG used to assume that the entire Mach message 72 from header to trailer was in contiguous memory, but that is no longer true, 83 follows that is used in various ways depending on the `ikm_type` field of the 218 Note that there can be unused space in the pure data body due to the fact that 225 linear allocation. This is a legacy representation that is now only used for 226 DriverKit replies, with a fixed size of 0x17c0 bytes. Note that because of this, 349 Note that there can be unused space in the pure data body due to the fact that 423 reasons). These entry points propagate that the caller is a kernel extension [all …]
|
| /xnu-11215/doc/observability/ |
| H A D | cpu_counters.md | 3 The xnu subsystems that manage CPU performance counters. 7 CPU performance counters are hardware registers that count events of interest to efficient CPU exec… 8 Counters that measure events closely correlated with each CPU's execution pipeline are managed by t… 9 … fixed instructions and cycles counters, as well as configurable counters that can be programmed t… 10 …sts the Uncore Performance Monitoring Unit (UPMU), which measures effects that aren't necessarily … 20 There are several subsystems that provide access to CPU counter hardware:
|
| /xnu-11215/libkern/libkern/c++/ |
| H A D | OSPtr.h | 53 # error It seems that you have defined IOKIT_ENABLE_SHARED_PTR to \ 55 functions. This is great! However, please note that we may \ 60 pointers). If you are OK with that, please define the \ 62 silence this error. If that is not acceptable, please hold \
|
| /xnu-11215/doc/debugging/ |
| H A D | macro_testing.md | 6 validate that the changes work in their environment before integration. 51 * `unittest.mock` that covers general purpose Python mocking. 68 A developer has to correctly populate all members that overlap because this 71 Auto generating mock specification from kernel under test allows checking that 79 serializer that reflects memory location and representation of given SBType's 84 * `RawMock` that is suitable to place unstructured data into target's memory. 85 * `MemoryMock` that mirrors given `SBType` and serializes data into target's
|
| /xnu-11215/iokit/DriverKit/ |
| H A D | IODispatchQueue.iig | 7 * as defined in and that are subject to the Apple Public Source License 80 kIODispatchQueueReentrant Creates a queue that allows release with the Sleep 81 method, so that other threads and callers may acquire the queue. 130 * @param block Block that will executed on the queue, not in the context of the caller. 147 * @param block Block that will executed on the queue, not in the context of the caller. 161 * @param block Block that will executed on the queue. 180 * @brief Version of DispatchSync that returns a kern_return_t status. 218 * @brief Wakes a thread that is blocked in Sleep(). 219 * @discussion Signals a thread that gave up the queue with Sleep() to continue running. 228 * @brief Wakes a thread that is blocked in Sleep(). [all …]
|
| /xnu-11215/tests/ |
| H A D | stackshot_accuracy.m | 65 T_HELPER_DECL(simple_child_process, "child process that will be frozen and others") 70 T_HELPER_DECL(sid_child_process, "child process that setsid()s") 207 * given that we've targetted the pid, we can be sure that this 219 /* skip threads that don't have enough frames */ 254 /* if we couldn't fault the pages back in, then at least verify that we tried */ 295 * then send SIGUSR1 to the parent to let it know that we are done. 326 /* check that the stackshot has the stack frames */ 375 /* check that the stackshot has the stack frames */ 458 /* check that the stackshot has the stack frames */ 511 /* check that the stackshot has the stack frames */ [all …]
|
| H A D | stackshot_idle_25570396.m | 1 /* This program tests that kThreadIdleWorker is being set properly, so 2 * that idle and active threads can be appropriately identified. 136 /* check to see that tid matches expected idle status */ 145 /* Dispatch NUMENQUEUES jobs to a concurrent queue that immediately wait on a 177 /* Dispatch NUMENQUEUES jobs to a concurrent queue that spin in a tight loop. 179 * that a thread will go from idle to nonidle. 218 * and the work queue has NUMENQUEUES tight-spinning jobs on it. Make sure that 219 * no new idle threads appear in the delta, and make sure that the delta shot isn't 220 * ignoring the worker threads that have become active. 251 T_DECL(stackshot_idle_25570396, "Tests that stackshot can properly recognize idle and non-idle thre…
|
| /xnu-11215/bsd/man/man2/ |
| H A D | getdirentriesattr.2 | 87 on volumes that don't support 95 parameter must be a file descriptor that references a directory that you have opened for reading. 130 that contains the 150 This may be smaller than the number that you requested. 188 parameter is a bit set that controls the behaviour of 201 We currently recommend that clients not set this option and that file system 220 The value 0 indicates that the routine completed successfully. 221 The value 1 indicates that the routine completed successfully and has 251 If you're implementing a volume format that supports 260 for that entry; all other attributes for that entry, however, [all …]
|
| /xnu-11215/doc/primitives/ |
| H A D | atomics.md | 13 It is assumed that the reader has a decent understanding of 59 optimizations with relaxed atomics, that most developers will not expect. 113 4. `os_atomic_*` emits the proper compiler barriers that 134 be aware that a direct access to this variable will 166 Note that `os_atomic_load` and `os_atomic_store` promise that they will 169 that involve more costly codegen (such as compare exchange loops). 206 Making it more explicit that the original value is used is hence 312 // that would cause the loop to always fail 405 by a *dependency* load, or any other value that has had a dependency 409 that still prolongs a dependency chain, [all …]
|
| H A D | sched_cond.md | 42 This results in precious CPU cycles being spent in (A) to wake the thread despite the fact that 77 signalling that it is active and clearing the queued wakeup. Once done with its consumption it atte… 78 cond (G), signalling that it is inactive and checking for any wakeups that have been issued since t… 84 One may note that the adoption of `sched_cond_*` involves adding an additional step (ack) to the co… 88 …that are issued while the thread is active are guaranteed to be observed because the consumer will…
|
| /xnu-11215/doc/arm/ |
| H A D | sme.md | 19 This document summarizes SVE, SME, and SME2 hardware features that are relevant 43 using specialized `ldr` and `str` variants. SME also adds `mov` variants that 79 instructions that access them. Clearing `PSTATE.ZA` causes `ZA` and `ZT0` 89 `PSTATE.{SM,ZA} = {0,0}` acts as a hint to the CPU that it may power down 103 not need explicit barriers. Specifically, ARM guarantees that all direct and 111 instructions issued by that CPU. ARM guarantees that higher `SMPRI_EL1` values 161 streaming SVE mode. This policy means that xnu does not need to preserve 163 in-kernel SME operations that could clobber them. 211 `PSTATE.ZA`. This policy means that xnu issues the power-down hint 222 `SMCR_ELx` is the only one of these that's banked between EL1 and EL2. The [all …]
|