/linux-6.14.4/kernel/livepatch/ |
D | shadow.c | 3 * shadow.c - Shadow Variables 11 * DOC: Shadow variable API concurrency notes: 13 * The shadow variable API provides a simple relationship between an 15 * caller to provide any mutual exclusion required of the shadow data. 17 * Once a shadow variable is attached to its parent object via the 19 * call to klp_shadow_get() may then return the shadow variable's data 20 * pointer. Callers of klp_shadow_*alloc() should prepare shadow data 23 * The klp_shadow_*alloc() API calls may allocate memory for new shadow 42 * the shadow variables it references. 47 * struct klp_shadow - shadow variable structure [all …]
|
/linux-6.14.4/Documentation/arch/x86/ |
D | shstk.rst | 4 Control-flow Enforcement Technology (CET) Shadow Stack 14 CET introduces shadow stack and indirect branch tracking (IBT). A shadow stack 17 return address to both the normal stack and the shadow stack. Upon 18 function return, the processor pops the shadow stack copy and compares it 21 as marked by the compiler with 'ENDBR' opcodes. Not all CPU's have both Shadow 23 shadow stack and kernel IBT are supported. 25 Requirements to use Shadow Stack 28 To use userspace shadow stack you need HW that supports it, a kernel 31 The kernel Kconfig option is X86_USER_SHADOW_STACK. When compiled in, shadow 34 To build a user shadow stack enabled kernel, Binutils v2.29 or LLVM v6 or later [all …]
|
/linux-6.14.4/Documentation/livepatch/ |
D | shadow-vars.rst | 2 Shadow Variables 5 Shadow variables are a simple way for livepatch modules to associate 6 additional "shadow" data with existing data structures. Shadow data is 8 unmodified. The shadow variable API described in this document is used 9 to allocate/add and remove/free shadow variables to/from their parents. 13 shadow data. The numeric identifier is a simple enumeration that may be 14 used to describe shadow variable version, class or type, etc. More 16 numeric id subsequently filters hashtable queries. Multiple shadow 24 (See the full API usage docbook notes in livepatch/shadow.c.) 26 A hashtable references all shadow variables. These references are [all …]
|
/linux-6.14.4/drivers/gpu/drm/ |
D | drm_gem_atomic_helper.c | 22 * for planes with shadow buffers. 41 * A driver using a shadow buffer copies the content of the shadow buffers 43 * a mapping of the shadow buffer into kernel address space. The mappings 47 * The helpers for shadow-buffered planes establish and release mappings, 51 * Shadow-buffered planes can easily be enabled by using the provided macros 54 * shadow-buffer helpers. 70 * In the driver's atomic-update function, shadow-buffer mappings are available 83 * // access shadow buffer via shadow_plane_state->map 92 * callbacks. Access to shadow-buffer mappings is similar to regular 109 * // access shadow buffer via shadow_plane_state->map [all …]
|
/linux-6.14.4/drivers/scsi/ |
D | xen-scsifront.c | 121 struct vscsifrnt_shadow *shadow[VSCSIIF_MAX_REQS]; member 163 info->shadow[id] = NULL; in _scsifront_put_rqid() 182 struct vscsifrnt_shadow *shadow) in scsifront_do_request() argument 186 struct scsi_cmnd *sc = shadow->sc; in scsifront_do_request() 197 info->shadow[id] = shadow; in scsifront_do_request() 198 shadow->rqid = id; in scsifront_do_request() 204 ring_req->act = shadow->act; in scsifront_do_request() 205 ring_req->ref_rqid = shadow->ref_rqid; in scsifront_do_request() 206 ring_req->nr_segments = shadow->nr_segments; in scsifront_do_request() 220 for (i = 0; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT); i++) in scsifront_do_request() [all …]
|
/linux-6.14.4/mm/kmsan/ |
D | init.c | 70 * Initialize the shadow for existing mappings during kernel initialization. 86 /* Allocate shadow for .data */ in kmsan_init_shadow() 100 struct page *shadow, *origin; member 109 * time with a certain order, it is reserved as a shadow block, for the second 111 * shadow and origin ranges from the previously saved shadow and origin blocks, 119 struct page *shadow, *origin; in kmsan_memblock_free_pages() local 121 if (!held_back[order].shadow) { in kmsan_memblock_free_pages() 122 held_back[order].shadow = page; in kmsan_memblock_free_pages() 129 shadow = held_back[order].shadow; in kmsan_memblock_free_pages() 131 kmsan_setup_meta(page, shadow, origin, order); in kmsan_memblock_free_pages() [all …]
|
D | shadow.c | 3 * KMSAN shadow implementation. 85 void *shadow; in kmsan_get_shadow_origin_ptr() local 97 shadow = kmsan_get_metadata(address, KMSAN_META_SHADOW); in kmsan_get_shadow_origin_ptr() 98 if (!shadow) in kmsan_get_shadow_origin_ptr() 101 ret.shadow = shadow; in kmsan_get_shadow_origin_ptr() 108 ret.shadow = dummy_store_page; in kmsan_get_shadow_origin_ptr() 112 ret.shadow = dummy_load_page; in kmsan_get_shadow_origin_ptr() 119 * Obtain the shadow or origin pointer for the given address, or NULL if there's 173 struct page *shadow, *origin; in kmsan_alloc_page() local 180 shadow = shadow_page_for(page); in kmsan_alloc_page() [all …]
|
D | instrumentation.c | 49 /* Get shadow and origin pointers for a memory load with non-standard size. */ 59 /* Get shadow and origin pointers for a memory store with non-standard size. */ 70 * Declare functions that obtain shadow/origin pointers for loads and stores 135 * get_param0_metadata() and set_retval_metadata() to store the shadow/origin 139 static inline void get_param0_metadata(u64 *shadow, in get_param0_metadata() argument 144 *shadow = *(u64 *)(ctx->cstate.param_tls); in get_param0_metadata() 148 static inline void set_retval_metadata(u64 shadow, depot_stack_handle_t origin) in set_retval_metadata() argument 152 *(u64 *)(ctx->cstate.retval_tls) = shadow; in set_retval_metadata() 162 u64 shadow; in __msan_memmove() local 164 get_param0_metadata(&shadow, &origin); in __msan_memmove() [all …]
|
/linux-6.14.4/include/drm/ |
D | drm_gem_atomic_helper.h | 21 * Helpers for planes with shadow buffers 25 * DRM_SHADOW_PLANE_MAX_WIDTH - Maximum width of a plane's shadow buffer in pixels 27 * For drivers with shadow planes, the maximum width of the framebuffer is 34 * DRM_SHADOW_PLANE_MAX_HEIGHT - Maximum height of a plane's shadow buffer in scanlines 36 * For drivers with shadow planes, the maximum height of the framebuffer is 43 * struct drm_shadow_plane_state - plane state for planes with shadow buffers 45 * For planes that use a shadow buffer, struct drm_shadow_plane_state 46 * provides the regular plane state plus mappings of the shadow buffer 57 * Flags for copying shadow buffers into backend storage. Also holds 104 * Initializes struct drm_plane_funcs for shadow-buffered planes [all …]
|
/linux-6.14.4/Documentation/virt/kvm/x86/ |
D | mmu.rst | 4 The x86 kvm shadow mmu 55 spte shadow pte (referring to pfns) 87 direct mode; otherwise it operates in shadow mode (see below). 118 Shadow pages 121 The principal data structure is the shadow page, 'struct kvm_mmu_page'. A 122 shadow page contains 512 sptes, which can be either leaf or nonleaf sptes. A 123 shadow page may contain a mix of leaf and nonleaf sptes. 126 is not related to a translation directly. It points to other shadow pages. 150 Shadow pages contain the following information: 152 The level in the shadow paging hierarchy that this shadow page belongs to. [all …]
|
/linux-6.14.4/drivers/gpio/ |
D | gpio-mm-lantiq.c | 31 u16 shadow; /* shadow the latches state */ member 35 * ltq_mm_apply() - write the shadow value to the ebu address. 38 * Write the shadow value to the EBU to set the gpios. We need to set the 47 __raw_writew(chip->shadow, chip->mmchip.regs); in ltq_mm_apply() 58 * Set the shadow value and call ltq_mm_apply. 65 chip->shadow |= (1 << offset); in ltq_mm_set() 67 chip->shadow &= ~(1 << offset); in ltq_mm_set() 104 u32 shadow; in ltq_mm_probe() local 117 /* store the shadow value if one was passed by the devicetree */ in ltq_mm_probe() 118 if (!of_property_read_u32(pdev->dev.of_node, "lantiq,shadow", &shadow)) in ltq_mm_probe() [all …]
|
D | gpio-janz-ttl.c | 60 u8 *shadow; in ttl_get_value() local 64 shadow = &mod->porta_shadow; in ttl_get_value() 66 shadow = &mod->portb_shadow; in ttl_get_value() 69 shadow = &mod->portc_shadow; in ttl_get_value() 74 ret = *shadow & BIT(offset); in ttl_get_value() 83 u8 *shadow; in ttl_set_value() local 87 shadow = &mod->porta_shadow; in ttl_set_value() 90 shadow = &mod->portb_shadow; in ttl_set_value() 94 shadow = &mod->portc_shadow; in ttl_set_value() 100 *shadow |= BIT(offset); in ttl_set_value() [all …]
|
/linux-6.14.4/arch/arm/include/asm/ |
D | kasan_def.h | 19 * space to use as shadow memory for KASan as follows: 31 * | | |-> The shadow area of kernel virtual address. 34 * | |\ shadow address of MODULES_VADDR 47 * This value begins with the MODULE_VADDR's shadow address. It is the 49 * to cover also that area with shadow memory so we can find memory 53 * This value is the 0x100000000's shadow address: the mapping that would 55 * kernel address sanitizer shadow area. It is also the start of the 59 * This value is used to map an address to the corresponding shadow 65 * byte in the shadow memory covers 8 bytes of kernel memory, so one 66 * bit shadow memory per byte of kernel memory is used. [all …]
|
/linux-6.14.4/arch/arm/mm/ |
D | kasan_init.c | 61 panic("%s failed to allocate shadow page for address 0x%lx\n", in kasan_pte_populate() 70 * The early shadow memory is mapping all KASan in kasan_pte_populate() 74 * proper KASan shadow memory. in kasan_pte_populate() 80 * Early shadow mappings are PMD_SIZE aligned, so if the in kasan_pte_populate() 102 * We attempt to allocate a shadow block for the PMDs in kasan_pmd_populate() 110 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pmd_populate() 135 * Allocate and populate the shadow block of p4d folded into in kasan_pgd_populate() 142 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pgd_populate() 182 * We walk the page table and set all of the shadow memory to point in kasan_early_init() 202 pr_info("Mapping kernel virtual memory block: %px-%px at shadow: %px-%px\n", in create_mapping() [all …]
|
/linux-6.14.4/Documentation/dev-tools/ |
D | kmsan.rst | 95 incorrect shadow/origin values, likely leading to false positives. Functions 132 KMSAN shadow memory 135 KMSAN associates a metadata byte (also called shadow byte) with every byte of 136 kernel memory. A bit in the shadow byte is set if the corresponding bit of the 138 setting its shadow bytes to ``0xff``) is called poisoning, marking it 139 initialized (setting the shadow bytes to ``0x00``) is called unpoisoning. 146 Compiler instrumentation also tracks the shadow values as they are used along 148 ``mm/kmsan/`` to persist shadow values. 150 The shadow value of a basic or compound type is an array of bytes of the same 152 When a value is read from memory, its shadow memory is also obtained and [all …]
|
D | kasan.rst | 256 granule is encoded in one shadow byte. Those 8 bytes can be accessible, 258 encoding for each shadow byte: 00 means that all 8 bytes of the corresponding 265 In the report above, the arrow points to the shadow byte ``03``, which means 307 Software KASAN modes use shadow memory to record whether each byte of memory is 308 safe to access and use compile-time instrumentation to insert shadow memory 311 Generic KASAN dedicates 1/8th of kernel memory to its shadow memory (16TB 313 translate a memory address to its corresponding shadow address. 315 Here is the function which translates an address to its corresponding shadow 329 memory accesses are valid or not by checking corresponding shadow memory. 332 directly inserts the code to check shadow memory. This option significantly [all …]
|
/linux-6.14.4/samples/livepatch/ |
D | livepatch-shadow-fix1.c | 7 * livepatch-shadow-fix1.c - Shadow variables, livepatch demo 12 * Fixes the memory leak introduced in livepatch-shadow-mod through the 13 * use of a shadow variable. This fix demonstrates the "extending" of 22 * section of livepatch-shadow-mod.c. 32 /* Shadow variable enums */ 49 * In this example, it would be safe to assign the pointer also to the shadow 78 * Patch: save the extra memory location into a SV_LEAK shadow in livepatch_fix1_dummy_alloc() 89 pr_err("%s: failed to allocate shadow variable for the leaking pointer: dummy @ %p, leak @ %p\n", in livepatch_fix1_dummy_alloc() 121 * Patch: fetch the saved SV_LEAK shadow variable, detach and in livepatch_fix1_dummy_free() 122 * free it. Note: handle cases where this shadow variable does in livepatch_fix1_dummy_free() [all …]
|
D | livepatch-shadow-mod.c | 7 * livepatch-shadow-mod.c - Shadow variables, buggy module demo 12 * As a demonstration of livepatch shadow variable API, this module 14 * livepatch-shadow-fix1.ko and livepatch-shadow-fix2.ko correct and 17 * WARNING - even though the livepatch-shadow-fix modules patch the 27 * insmod samples/livepatch/livepatch-shadow-mod.ko 36 * insmod samples/livepatch/livepatch-shadow-fix1.ko 45 * insmod samples/livepatch/livepatch-shadow-fix2.ko 47 * This module extends functionality through shadow variables, as a new 59 * rmmod livepatch-shadow-fix2 60 * rmmod livepatch-shadow-fix1 [all …]
|
D | livepatch-shadow-fix2.c | 7 * livepatch-shadow-fix2.c - Shadow variables, livepatch demo 12 * Adds functionality to livepatch-shadow-mod's in-flight data 13 * structures through a shadow variable. The livepatch patches a 22 * section of livepatch-shadow-mod.c. 32 /* Shadow variable enums */ 47 * already have a SV_COUNTER shadow variable, then attach a in livepatch_fix2_dummy_check() 82 * Patch: fetch the SV_COUNTER shadow variable and display in livepatch_fix2_dummy_free() 83 * the final count. Detach the shadow variable. in livepatch_fix2_dummy_free() 125 /* Cleanup any existing SV_COUNTER shadow variables */ in livepatch_shadow_fix2_exit()
|
/linux-6.14.4/arch/powerpc/include/asm/ |
D | kasan.h | 37 * The shadow ends before the highest accessible address 38 * because we don't need a shadow for the shadow. Instead: 46 * The shadow ends before the highest accessible address 47 * because we don't need a shadow for the shadow. 48 * But it doesn't hurt to have a shadow for the shadow, 49 * keep shadow end aligned eases things.
|
/linux-6.14.4/fs/nilfs2/ |
D | mdt.c | 482 struct nilfs_shadow_map *shadow = mdi->mi_shadow; in nilfs_mdt_clear() local 487 if (shadow) { in nilfs_mdt_clear() 488 struct inode *s_inode = shadow->inode; in nilfs_mdt_clear() 490 shadow->inode = NULL; in nilfs_mdt_clear() 519 * nilfs_mdt_setup_shadow_map - setup shadow map and bind it to metadata file 521 * @shadow: shadow mapping 526 struct nilfs_shadow_map *shadow) in nilfs_mdt_setup_shadow_map() argument 531 INIT_LIST_HEAD(&shadow->frozen_buffers); in nilfs_mdt_setup_shadow_map() 537 shadow->inode = s_inode; in nilfs_mdt_setup_shadow_map() 538 mi->mi_shadow = shadow; in nilfs_mdt_setup_shadow_map() [all …]
|
/linux-6.14.4/mm/ |
D | workingset.c | 177 * slot of the evicted page. This is called a shadow entry. 179 * On cache misses for which there are shadow entries, an eligible 210 static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat, in unpack_shadow() argument 213 unsigned long entry = xa_to_value(shadow); in unpack_shadow() 261 * Tests if the shadow entry is for a folio that was recently evicted. 262 * Fills in @lruvec, @token, @workingset with the values unpacked from shadow. 264 static bool lru_gen_test_recent(void *shadow, struct lruvec **lruvec, in lru_gen_test_recent() argument 272 unpack_shadow(shadow, &memcg_id, &pgdat, token, workingset); in lru_gen_test_recent() 283 static void lru_gen_refault(struct folio *folio, void *shadow) in lru_gen_refault() argument 296 recent = lru_gen_test_recent(shadow, &lruvec, &token, &workingset); in lru_gen_refault() [all …]
|
/linux-6.14.4/include/linux/ |
D | scx200_gpio.h | 13 #define __SCx200_GPIO_SHADOW unsigned long *shadow = scx200_gpio_shadow+bank 16 #define __SCx200_GPIO_OUT __asm__ __volatile__("outsl":"=mS" (shadow):"d" (ioaddr), "0" (shadow)) 46 set_bit(index, shadow); /* __set_bit()? */ in scx200_gpio_set_high() 57 clear_bit(index, shadow); /* __clear_bit()? */ in scx200_gpio_set_low() 69 set_bit(index, shadow); in scx200_gpio_set() 71 clear_bit(index, shadow); in scx200_gpio_set() 81 change_bit(index, shadow); in scx200_gpio_change()
|
/linux-6.14.4/arch/s390/kvm/ |
D | gmap-vsie.c | 28 * gmap_find_shadow - find a specific asce in the list of shadow tables 30 * @asce: ASCE for which the shadow table is created 31 * @edat_level: edat level to be used for the shadow translation 33 * Returns the pointer to a gmap if a shadow table with the given asce is 56 * gmap_shadow - create/find a shadow guest address space 58 * @asce: ASCE for which the shadow table is created 59 * @edat_level: edat level to be used for the shadow translation 63 * The shadow table will be removed automatically on any change to the 84 /* Create a new shadow gmap */ in gmap_shadow() 98 /* Recheck if another CPU created the same shadow */ in gmap_shadow() [all …]
|
/linux-6.14.4/mm/kasan/ |
D | shadow.c | 3 * This file contains KASAN runtime code that manages shadow memory for 132 * Perform shadow offset calculation based on untagged address, as in kasan_poison() 157 u8 *shadow = (u8 *)kasan_mem_to_shadow(addr + size); in kasan_poison_last_granule() local 158 *shadow = size & KASAN_GRANULE_MASK; in kasan_poison_last_granule() 168 * Perform shadow offset calculation based on untagged address, as in kasan_unpoison() 235 * If shadow is mapped already than it must have been mapped in kasan_mem_notifier() 260 * In the latter case we can use vfree() to free shadow. in kasan_mem_notifier() 264 * Currently it's not possible to free shadow mapped in kasan_mem_notifier() 337 * User Mode Linux maps enough shadow memory for all of virtual memory in kasan_populate_vmalloc() 373 * STORE shadow(a), unpoison_val in kasan_populate_vmalloc() [all …]
|