| /linux/kernel/livepatch/ |
| H A 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/Documentation/livepatch/ |
| H A 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/drivers/gpu/drm/xe/ |
| H A D | xe_mem_pool.c | 29 * a shadow BO that can be used for atomic updates to the primary BO's contents. 33 * primary and shadow BOs as needed. 40 /** @shadow: Shadow BO for atomic command updates. */ 41 struct xe_bo *shadow; member 42 /** @swap_guard: Timeline guard updating @bo and @shadow */ 74 struct xe_bo *shadow; in pool_shadow_init() local 77 xe_assert(xe, !pool->shadow); in pool_shadow_init() 88 shadow = xe_managed_bo_create_pin_map(xe, tile, in pool_shadow_init() 94 if (IS_ERR(shadow)) in pool_shadow_init() 95 return PTR_ERR(shadow); in pool_shadow_init() [all …]
|
| /linux/arch/riscv/kernel/ |
| H A D | usercfi.c | 112 * The shadow stack only stores the return address and not any variables 125 * Writes on shadow stack can either be `sspush` or `ssamoswap`. `sspush` can happen 126 * implicitly on current shadow stack pointed to by CSR_SSP. `ssamoswap` takes pointer to 127 * shadow stack. To keep it simple, we plan to use `ssamoswap` to perform writes on shadow 133 * Never expect -1 on shadow stack. Expect return addresses and zero in amo_user_shstk() 156 * Create a restore token on the shadow stack. A token is always XLEN wide 180 * Save user shadow stack pointer on the shadow stack itself and return a pointer to saved location. 204 * Restores the user shadow stack pointer from the token on the shadow stack for task 'tsk'. 265 * which perform writes to CSR_SSP properly, shadow stack pivoting is not possible. Since in SYSCALL_DEFINE3() 266 * CSR_SSP is writable by user mode, it itself can setup a shadow stack token subsequent in SYSCALL_DEFINE3() [all …]
|
| H A D | signal.c | 155 * Save a pointer to the shadow stack itself on shadow stack as a form of token. in save_cfiss_state() 156 * A token on the shadow stack gives the following properties: in save_cfiss_state() 157 * - Safe save and restore for shadow stack switching. Any save of a shadow stack in save_cfiss_state() 158 * must have saved a token on the shadow stack. Similarly any restore of shadow in save_cfiss_state() 159 * stack must check the token before restore. Since writing to the shadow stack with in save_cfiss_state() 160 * address of the shadow stack itself is not easily allowed, a restore without a save in save_cfiss_state() 162 * - A natural break. A token in shadow stack provides a natural break in shadow stack in save_cfiss_state() 163 * So a single linear range can be bucketed into different shadow stack segments. Any in save_cfiss_state() 181 * Restore shadow stack as a form of token stored on the shadow stack itself as a safe in __restore_cfiss_state() 183 * A token on the shadow stack gives the following properties: in __restore_cfiss_state() [all …]
|
| /linux/drivers/scsi/ |
| H A 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/include/drm/ |
| H A 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/arch/arm/include/asm/ |
| H A 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/samples/livepatch/ |
| H A 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 …]
|
| H A 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() 131 MODULE_DESCRIPTION("Live patching demo for shadow variables");
|
| /linux/mm/kmsan/ |
| H A 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 …]
|
| H A D | core.c | 115 /* Copy shadow bytes one by one, updating the origins if necessary. */ in kmsan_internal_memmove_metadata() 203 * kmsan_metadata_is_contiguous() is true, so either all shadow in kmsan_internal_set_shadow_origin() 207 pr_err("%s: not memsetting %ld bytes starting at %px, because the shadow is NULL\n", in kmsan_internal_set_shadow_origin() 228 * If the new origin is non-zero, assume that the shadow byte is also non-zero, in kmsan_internal_set_shadow_origin() 231 * corresponding shadow slot is zero. in kmsan_internal_set_shadow_origin() 259 unsigned char *shadow = NULL; in kmsan_internal_check_memory() local 270 shadow = kmsan_get_metadata((void *)(addr64 + pos), in kmsan_internal_check_memory() 272 if (!shadow) { in kmsan_internal_check_memory() 288 if (!shadow[i]) { in kmsan_internal_check_memory() 371 pr_err("%s: attempting to access two shadow page ranges.\n", __func__); in kmsan_metadata_is_contiguous() [all …]
|
| /linux/include/linux/ |
| H A 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/drivers/gpio/ |
| H A 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/arch/x86/kernel/ |
| H A D | shstk.c | 3 * shstk.c - Intel shadow stack support 47 * Create a restore token on the shadow stack. A token is always 8-byte 79 * The shadow stack pointer(SSP) is moved by CALL, RET, and INCSSPQ. The 80 * INCSSP instruction can increment the shadow stack pointer. It is the 81 * shadow stack analog of an instruction like: 91 * ssp += nr_to_pop * 8; // move the shadow stack 137 * case it is ok to leak a shadow stack, so just exit out. in unmap_shadow_stack() 193 * If shadow stack is not enabled on the new thread, skip any in shstk_alloc_thread_stack() 194 * switch to a new shadow stack. in shstk_alloc_thread_stack() 200 * For CLONE_VFORK the child will share the parents shadow stack. in shstk_alloc_thread_stack() [all …]
|
| /linux/mm/kasan/ |
| H A 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() 410 * User Mode Linux maps enough shadow memory for all of virtual memory in __kasan_populate_vmalloc() 444 * STORE shadow(a), unpoison_val in __kasan_populate_vmalloc() [all …]
|
| H A D | report_sw_tags.c | 51 u8 *shadow; in kasan_get_alloc_size() local 62 shadow = (u8 *)kasan_mem_to_shadow(object); in kasan_get_alloc_size() 64 if (*shadow != KASAN_TAG_INVALID) in kasan_get_alloc_size() 68 shadow++; in kasan_get_alloc_size() 81 u8 *shadow = (u8 *)kasan_mem_to_shadow(addr); in kasan_print_tags() local 83 pr_err("Pointer tag: [%02x], memory tag: [%02x]\n", addr_tag, *shadow); in kasan_print_tags()
|
| /linux/arch/powerpc/kvm/ |
| H A D | e500.c | 58 /* This variable keeps last used shadow ID on local core. 59 * The valid range of shadow ID is [1..255] */ 63 * Allocate a free shadow id and setup a valid sid mapping in given entry. 67 * it has finished with the returned shadow id (either written into the 96 * Check if given entry contain a valid shadow id mapping. 101 * it has finished with the returned shadow id (either written into the 132 /* Map guest pid to shadow. 133 * We use PID to keep shadow of current guest non-zero PID, 134 * and use PID1 to keep shadow of guest zero PID. 154 /* Update shadow pid when mappings are changed */ in kvmppc_e500_id_table_reset_all() [all …]
|
| H A D | book3s_64_slb.S | 30 * R3 = shadow vcpu 40 /* Declare SLB shadow as 0 entries big */ 54 /* Fill SLB with our shadow */ 97 * R13 = shadow vcpu - SHADOW_VCPU_OFF [=PACA on PPC64] 112 /* Restore bolted entries from the shadow */ 118 /* Declare SLB shadow as SLB_NUM_BOLTED entries big */ 125 /* Manually load all entries from shadow SLB */
|
| /linux/drivers/block/ |
| H A 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 …]
|
| /linux/tools/testing/selftests/x86/ |
| H A D | test_shadow_stack.c | 3 * This program test's basic kernel shadow stack support. It enables shadow 5 * Makefile doesn't compile with shadow stack support, so it doesn't rely on 7 * special glibc shadow stack support (longjmp(), swapcontext(), etc). Just 86 * For use in inline enablement of shadow stack. 88 * The program can't return from the point where shadow stack gets enabled 89 * because there will be no address on the shadow stack. So it can't use 147 /* Switch back to original shadow stack */ in try_shstk() 158 printf("[FAIL]\tError creating shadow stack: %d\n", errno); in test_shstk_pivot() 172 /* Read shadow stack, test if it's zero to not get read optimized out */ in test_shstk_faults() 205 /* Corrupt shadow stack */ in violate_ss() [all …]
|
| /linux/arch/powerpc/platforms/ps3/ |
| H A D | spu.c | 41 * struct spe_shadow - logical spe shadow register area. 43 * Read-only shadow of spe registers. 102 * @shadow_addr: lpar address of spe register shadow area returned by 104 * @shadow: Virtual (ioremap) address of spe register shadow area. 113 struct spe_shadow __iomem *shadow; member 125 unsigned long problem, unsigned long ls, unsigned long shadow, in _dump_areas() argument 132 pr_debug("%s:%d: shadow: %lxh\n", func, line, shadow); in _dump_areas() 181 iounmap(spu_pdata(spu)->shadow); in spu_unmap() 187 * The current HV requires the spu shadow regs to be mapped with the 195 spu_pdata(spu)->shadow = ioremap_prot(spu_pdata(spu)->shadow_addr, in setup_areas() [all …]
|
| /linux/drivers/net/ethernet/intel/i40e/ |
| H A D | i40e_nvm.c | 17 * We are accessing FLASH always thru the Shadow RAM. 141 * Polls the SRCTL Shadow RAM register done bit. 163 * i40e_read_nvm_word_srctl - Reads Shadow RAM via SRCTL register 165 * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF) 166 * @data: word read from the Shadow RAM 168 * Reads one 16 bit word from the Shadow RAM using the GLNVM_SRCTL register. 178 "NVM read error: offset %d beyond Shadow RAM limit %d\n", in i40e_read_nvm_word_srctl() 202 "NVM read error: Couldn't access Shadow RAM address: 0x%x\n", in i40e_read_nvm_word_srctl() 210 * i40e_read_nvm_aq - Read Shadow RAM. 215 * @data: buffer with words to read to the Shadow RAM [all …]
|
| /linux/drivers/ps3/ |
| H A D | ps3-lpm.c | 66 * struct ps3_lpm_shadow_regs - Performance monitor shadow registers. 68 * @pm_control: Shadow of the processor's pm_control register. 69 * @pm_start_stop: Shadow of the processor's pm_start_stop register. 70 * @group_control: Shadow of the processor's group_control register. 71 * @debug_bus_control: Shadow of the processor's debug_bus_control register. 74 * these processor registers. These shadow variables cache the processor 77 * The initial value of the shadow registers at lpm creation is 109 * @shadow: Processor register shadow of type struct ps3_lpm_shadow_regs. 128 struct ps3_lpm_shadow_regs shadow; member 394 return lpm_priv->shadow.pm_control; in ps3_read_pm() [all …]
|
| /linux/arch/xtensa/include/asm/ |
| H A D | kasan.h | 17 /* Start of the shadow map */ 19 /* Size of the shadow map */ 21 /* End of the shadow map */ 23 /* Offset for mem to shadow address transformation */
|