Lines Matching refs:shadow

44 	/* Page index for the beginning of the shadow */
46 /* An array of __cfi_check locations (as indices to the shadow) */
47 shadow_t shadow[1];
51 * The shadow covers ~128M from the beginning of the module region. If
61 /* The actual size of the shadow array, minus metadata */
62 #define SHADOW_ARR_SIZE (SHADOW_SIZE - offsetof(struct cfi_shadow, shadow))
68 /* Returns the index in the shadow for the given address */
80 return -1; /* Cannot be addressed with shadow */
85 /* Returns the page address for an index in the shadow */
95 /* Returns the __cfi_check function address for the given shadow location */
102 if (unlikely(s->shadow[index] == SHADOW_INVALID))
106 return (s->base + s->shadow[index]) << PAGE_SHIFT;
115 memset(next->shadow, 0xFF, SHADOW_ARR_SIZE);
118 return; /* No previous shadow */
122 memcpy(next->shadow, prev->shadow, SHADOW_ARR_SIZE);
126 /* Convert the previous shadow to the new address range */
128 if (prev->shadow[i] == SHADOW_INVALID)
136 shadow_to_check_fn(prev, prev->shadow[i]));
140 next->shadow[index] = (shadow_t)check;
152 pr_warn("cfi: not using shadow for module %s\n", mod->name);
158 return; /* Module not addressable with shadow */
160 /* For each page, store the check function index in the shadow */
166 WARN_ON_ONCE(s->shadow[index] != SHADOW_INVALID);
167 s->shadow[index] = (shadow_t)check_index;
181 s->shadow[index] = SHADOW_INVALID;
238 return NULL; /* No shadow available */
242 return NULL; /* Cannot be addressed with shadow */
292 * the shadow and __module_address use RCU, so we need to wake it