Home
last modified time | relevance | path

Searched full:shadow (Results 1 – 25 of 667) sorted by relevance

12345678910>>...27

/linux/kernel/livepatch/
H A Dshadow.c3 * 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/arch/x86/
H A Dshstk.rst4 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/Documentation/livepatch/
H A Dshadow-vars.rst2 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/
H A Ddrm_gem_atomic_helper.c22 * 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/drivers/scsi/
H A Dxen-scsifront.c121 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/mm/kmsan/
H A Dinit.c70 * 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 …]
H A Dshadow.c3 * 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, *origi in kmsan_alloc_page() local
277 void *shadow, *origin; kmsan_init_alloc_meta_for_range() local
301 kmsan_setup_meta(struct page * page,struct page * shadow,struct page * origin,int order) kmsan_setup_meta() argument
[all...]
H A Dinstrumentation.c49 /* 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 Dhooks.c145 * This function creates new shadow/origin pages for the physical pages mapped
146 * into the virtual memory. If those physical pages already had shadow/origin,
154 struct page *shadow, *origin; in kmsan_ioremap_page_range() local
164 shadow = alloc_pages(gfp_mask, 1); in kmsan_ioremap_page_range()
166 if (!shadow || !origin) { in kmsan_ioremap_page_range()
172 vmalloc_shadow(start + off + PAGE_SIZE), prot, &shadow, in kmsan_ioremap_page_range()
178 shadow = NULL; in kmsan_ioremap_page_range()
198 * Something went wrong. Clean up shadow/origin pages allocated in kmsan_ioremap_page_range()
202 if (shadow) in kmsan_ioremap_page_range()
203 __free_pages(shadow, 1); in kmsan_ioremap_page_range()
[all …]
/linux/include/drm/
H A Ddrm_gem_atomic_helper.h21 * 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/Documentation/virt/kvm/x86/
H A Dmmu.rst4 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/arch/arm/mm/
H A Dkasan_init.c61 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/arch/arm/include/asm/
H A Dkasan_def.h19 * 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 Dlivepatch-shadow-mod.c7 * 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 variable
[all...]
H A Dlivepatch-shadow-fix1.c7 * 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 variabl in livepatch_fix1_dummy_free()
[all...]
H A Dlivepatch-shadow-fix2.c7 * 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/arch/powerpc/include/asm/
H A Dkasan.h37 * 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/drivers/gpio/
H A Dgpio-janz-ttl.c60 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/include/linux/
H A Dscx200_gpio.h13 #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/arch/s390/kvm/
H A Dgmap-vsie.c28 * 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 …]
H A Dgmap.h21 * gmap_shadow_valid - check if a shadow guest address space matches the
23 * @sg: pointer to the shadow guest address space structure
24 * @asce: ASCE for which the shadow table is requested
25 * @edat_level: edat level to be used for the shadow translation
27 * Returns 1 if the gmap shadow is still valid and matches the given
29 * caller has to request a new shadow gmap in this case.
/linux/arch/x86/kernel/
H A Dshstk.c3 * 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
145 * case it is ok to leak a shadow stack, so just exit out. in unmap_shadow_stack()
201 * If shadow stack is not enabled on the new thread, skip any in shstk_alloc_thread_stack()
202 * switch to a new shadow stack. in shstk_alloc_thread_stack()
208 * For CLONE_VFORK the child will share the parents shadow stack. in shstk_alloc_thread_stack()
[all …]
/linux/arch/powerpc/kvm/
H A De500.c58 /* 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 …]
/linux/arch/s390/mm/
H A Dgmap.c233 /* Free additional data for a shadow gmap */ in gmap_free()
279 /* Remove all shadow gmaps linked to this gmap */ in gmap_remove()
478 * Note: Can also be called for shadow gmaps.
486 /* Note: guest_to_host is empty for a shadow gmap */ in __gmap_translate()
492 * gmap_unlink - disconnect a page table from the gmap shadow tables
516 * __gmap_link - set up shadow page tables to connect a host to a guest address
737 * Note: Can also be called for shadow gmaps.
936 /* Shadow GMAP protection needs split PMDs */ in gmap_protect_pmd()
1031 * shadow.
1077 * @sg: pointer to the shadow guest address space structure
[all …]
/linux/tools/testing/selftests/x86/
H A Dtest_shadow_stack.c3 * 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 …]

12345678910>>...27