/Linux-v6.1/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-v6.1/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-v6.1/drivers/gpu/drm/ |
D | drm_gem_atomic_helper.c | 22 * for planes with shadow buffers. 49 * A driver using a shadow buffer copies the content of the shadow buffers 51 * a mapping of the shadow buffer into kernel address space. The mappings 55 * The helpers for shadow-buffered planes establish and release mappings, 59 * Shadow-buffered planes can easily be enabled by using the provided macros 62 * shadow-buffer helpers. 78 * In the driver's atomic-update function, shadow-buffer mappings are available 91 * // access shadow buffer via shadow_plane_state->map 100 * callbacks. Access to shadow-buffer mappings is similar to regular 117 * // access shadow buffer via shadow_plane_state->map [all …]
|
/Linux-v6.1/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-v6.1/mm/kmsan/ |
D | init.c | 67 * Initialize the shadow for existing mappings during kernel initialization. 83 /* Allocate shadow for .data */ in kmsan_init_shadow() 97 struct page *shadow, *origin; member 106 * time with a certain order, it is reserved as a shadow block, for the second 108 * shadow and origin ranges from the previously saved shadow and origin blocks, 116 struct page *shadow, *origin; in kmsan_memblock_free_pages() local 118 if (!held_back[order].shadow) { in kmsan_memblock_free_pages() 119 held_back[order].shadow = page; in kmsan_memblock_free_pages() 126 shadow = held_back[order].shadow; in kmsan_memblock_free_pages() 128 kmsan_setup_meta(page, shadow, origin, order); in kmsan_memblock_free_pages() [all …]
|
D | core.c | 88 u32 *align_shadow_src, shadow; in kmsan_internal_memmove_metadata() local 99 * @src is untracked: zero out destination shadow, ignore the in kmsan_internal_memmove_metadata() 130 shadow = align_shadow_src[i]; in kmsan_internal_memmove_metadata() 135 * of the first shadow slot. in kmsan_internal_memmove_metadata() 138 shadow = (shadow >> skip_bits) << skip_bits; in kmsan_internal_memmove_metadata() 145 * last shadow slot. in kmsan_internal_memmove_metadata() 148 shadow = (shadow << skip_bits) >> skip_bits; in kmsan_internal_memmove_metadata() 152 * shadow is nonempty. in kmsan_internal_memmove_metadata() 154 if (origin_src[i] && (origin_src[i] != old_origin) && shadow) { in kmsan_internal_memmove_metadata() 165 if (shadow) in kmsan_internal_memmove_metadata() [all …]
|
D | instrumentation.c | 41 /* Get shadow and origin pointers for a memory load with non-standard size. */ 49 /* Get shadow and origin pointers for a memory store with non-standard size. */ 58 * Declare functions that obtain shadow/origin pointers for loads and stores 117 * get_param0_metadata() and set_retval_metadata() to store the shadow/origin 121 static inline void get_param0_metadata(u64 *shadow, in get_param0_metadata() argument 126 *shadow = *(u64 *)(ctx->cstate.param_tls); in get_param0_metadata() 130 static inline void set_retval_metadata(u64 shadow, depot_stack_handle_t origin) in set_retval_metadata() argument 134 *(u64 *)(ctx->cstate.retval_tls) = shadow; in set_retval_metadata() 143 u64 shadow; in __msan_memmove() local 145 get_param0_metadata(&shadow, &origin); in __msan_memmove() [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 175 struct page *shadow, *origin; in kmsan_alloc_page() local 182 shadow = shadow_page_for(page); in kmsan_alloc_page() [all …]
|
/Linux-v6.1/include/drm/ |
D | drm_gem_atomic_helper.h | 22 * Helpers for planes with shadow buffers 26 * DRM_SHADOW_PLANE_MAX_WIDTH - Maximum width of a plane's shadow buffer in pixels 28 * For drivers with shadow planes, the maximum width of the framebuffer is 35 * DRM_SHADOW_PLANE_MAX_HEIGHT - Maximum height of a plane's shadow buffer in scanlines 37 * For drivers with shadow planes, the maximum height of the framebuffer is 44 * struct drm_shadow_plane_state - plane state for planes with shadow buffers 46 * For planes that use a shadow buffer, struct drm_shadow_plane_state 47 * provides the regular plane state plus mappings of the shadow buffer 96 * Initializes struct drm_plane_funcs for shadow-buffered planes 98 * Drivers may use GEM BOs as shadow buffers over the framebuffer memory. This [all …]
|
/Linux-v6.1/arch/arm/mm/ |
D | kasan_init.c | 56 panic("%s failed to allocate shadow page for address 0x%lx\n", in kasan_pte_populate() 65 * The early shadow memory is mapping all KASan in kasan_pte_populate() 69 * proper KASan shadow memory. in kasan_pte_populate() 75 * Early shadow mappings are PMD_SIZE aligned, so if the in kasan_pte_populate() 97 * We attempt to allocate a shadow block for the PMDs in kasan_pmd_populate() 105 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pmd_populate() 130 * Allocate and populate the shadow block of p4d folded into in kasan_pgd_populate() 137 panic("%s failed to allocate shadow block for address 0x%lx\n", in kasan_pgd_populate() 177 * We walk the page table and set all of the shadow memory to point in kasan_early_init() 197 pr_info("Mapping kernel virtual memory block: %px-%px at shadow: %px-%px\n", in create_mapping() [all …]
|
/Linux-v6.1/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-v6.1/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-v6.1/Documentation/dev-tools/ |
D | kmsan.rst | 95 incorrect shadow/origin values, likely leading to false positives. Functions 125 KMSAN shadow memory 128 KMSAN associates a metadata byte (also called shadow byte) with every byte of 129 kernel memory. A bit in the shadow byte is set iff the corresponding bit of the 131 setting its shadow bytes to ``0xff``) is called poisoning, marking it 132 initialized (setting the shadow bytes to ``0x00``) is called unpoisoning. 139 Compiler instrumentation also tracks the shadow values as they are used along 141 ``mm/kmsan/`` to persist shadow values. 143 The shadow value of a basic or compound type is an array of bytes of the same 145 When a value is read from memory, its shadow memory is also obtained and [all …]
|
D | kasan.rst | 233 granule is encoded in one shadow byte. Those 8 bytes can be accessible, 235 encoding for each shadow byte: 00 means that all 8 bytes of the corresponding 242 In the report above, the arrow points to the shadow byte ``03``, which means 263 Software KASAN modes use shadow memory to record whether each byte of memory is 264 safe to access and use compile-time instrumentation to insert shadow memory 267 Generic KASAN dedicates 1/8th of kernel memory to its shadow memory (16TB 269 translate a memory address to its corresponding shadow address. 271 Here is the function which translates an address to its corresponding shadow 285 memory accesses are valid or not by checking corresponding shadow memory. 288 directly inserts the code to check shadow memory. This option significantly [all …]
|
/Linux-v6.1/fs/nilfs2/ |
D | mdt.c | 475 struct nilfs_shadow_map *shadow = mdi->mi_shadow; in nilfs_mdt_clear() local 480 if (shadow) { in nilfs_mdt_clear() 481 struct inode *s_inode = shadow->inode; in nilfs_mdt_clear() 483 shadow->inode = NULL; in nilfs_mdt_clear() 512 * nilfs_mdt_setup_shadow_map - setup shadow map and bind it to metadata file 514 * @shadow: shadow mapping 517 struct nilfs_shadow_map *shadow) in nilfs_mdt_setup_shadow_map() argument 522 INIT_LIST_HEAD(&shadow->frozen_buffers); in nilfs_mdt_setup_shadow_map() 528 shadow->inode = s_inode; in nilfs_mdt_setup_shadow_map() 529 mi->mi_shadow = shadow; in nilfs_mdt_setup_shadow_map() [all …]
|
/Linux-v6.1/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-v6.1/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-v6.1/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 79 * Patch: save the extra memory location into a SV_LEAK shadow in livepatch_fix1_dummy_alloc() 90 pr_err("%s: failed to allocate shadow variable for the leaking pointer: dummy @ %p, leak @ %p\n", in livepatch_fix1_dummy_alloc() 122 * Patch: fetch the saved SV_LEAK shadow variable, detach and in livepatch_fix1_dummy_free() 123 * 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-v6.1/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-v6.1/mm/kasan/ |
D | shadow.c | 3 * This file contains KASAN runtime code that manages shadow memory for 80 * Perform shadow offset calculation based on untagged address, as in kasan_poison() 109 u8 *shadow = (u8 *)kasan_mem_to_shadow(addr + size); in kasan_poison_last_granule() local 110 *shadow = size & KASAN_GRANULE_MASK; in kasan_poison_last_granule() 120 * Perform shadow offset calculation based on untagged address, as in kasan_unpoison() 202 * If shadow is mapped already than it must have been mapped in kasan_mem_notifier() 227 * In the latter case we can use vfree() to free shadow. in kasan_mem_notifier() 231 * Currently it's not possible to free shadow mapped in kasan_mem_notifier() 301 * User Mode Linux maps enough shadow memory for all of virtual memory in kasan_populate_vmalloc() 337 * STORE shadow(a), unpoison_val in kasan_populate_vmalloc() [all …]
|
/Linux-v6.1/arch/s390/mm/ |
D | gmap.c | 195 /* Free additional data for a shadow gmap */ in gmap_free() 243 /* Remove all shadow gmaps linked to this gmap */ in gmap_remove() 471 * Note: Can also be called for shadow gmaps. 479 /* Note: guest_to_host is empty for a shadow gmap */ in __gmap_translate() 505 * gmap_unlink - disconnect a page table from the gmap shadow tables 529 * __gmap_link - set up shadow page tables to connect a host to a guest address 791 * Note: Can also be called for shadow gmaps. 990 /* Shadow GMAP protection needs split PMDs */ in gmap_protect_pmd() 1131 * shadow. 1177 * @sg: pointer to the shadow guest address space structure [all …]
|
/Linux-v6.1/drivers/block/ |
D | xen-blkfront.c | 190 struct blk_shadow shadow[]; member 291 rinfo->shadow_free = rinfo->shadow[free].req.u.rw.id; in get_id_from_freelist() 292 rinfo->shadow[free].req.u.rw.id = 0x0fffffee; /* debug */ in get_id_from_freelist() 299 if (rinfo->shadow[id].req.u.rw.id != id) in add_id_to_freelist() 301 if (rinfo->shadow[id].request == NULL) in add_id_to_freelist() 303 rinfo->shadow[id].req.u.rw.id = rinfo->shadow_free; in add_id_to_freelist() 304 rinfo->shadow[id].request = NULL; in add_id_to_freelist() 543 rinfo->shadow[id].request = req; in blkif_ring_get_request() 544 rinfo->shadow[id].status = REQ_PROCESSING; in blkif_ring_get_request() 545 rinfo->shadow[id].associated_id = NO_ASSOCIATED_ID; in blkif_ring_get_request() [all …]
|