• Home
  • Raw
  • Download

Lines Matching refs:ctx

215 	struct kcsan_ctx *ctx = get_ctx();  in kcsan_check_scoped_accesses()  local
218 if (ctx->disable_scoped) in kcsan_check_scoped_accesses()
221 ctx->disable_scoped++; in kcsan_check_scoped_accesses()
222 list_for_each_entry(scoped_access, &ctx->scoped_accesses, list) { in kcsan_check_scoped_accesses()
226 ctx->disable_scoped--; in kcsan_check_scoped_accesses()
231 is_atomic(struct kcsan_ctx *ctx, const volatile void *ptr, size_t size, int type) in is_atomic() argument
249 if (ctx->atomic_next > 0) { in is_atomic()
260 --ctx->atomic_next; /* in task, or outer interrupt */ in is_atomic()
264 return ctx->atomic_nest_count > 0 || ctx->in_flat_atomic; in is_atomic()
268 should_watch(struct kcsan_ctx *ctx, const volatile void *ptr, size_t size, int type) in should_watch() argument
277 if (is_atomic(ctx, ptr, size, type)) in should_watch()
315 static __always_inline bool kcsan_is_enabled(struct kcsan_ctx *ctx) in kcsan_is_enabled() argument
317 return READ_ONCE(kcsan_enabled) && !ctx->disable_count; in kcsan_is_enabled()
391 static __always_inline struct kcsan_scoped_access *get_reorder_access(struct kcsan_ctx *ctx) in get_reorder_access() argument
394 return ctx->disable_scoped ? NULL : &ctx->reorder_access; in get_reorder_access()
401 find_reorder_access(struct kcsan_ctx *ctx, const volatile void *ptr, size_t size, in find_reorder_access() argument
404 struct kcsan_scoped_access *reorder_access = get_reorder_access(ctx); in find_reorder_access()
418 set_reorder_access(struct kcsan_ctx *ctx, const volatile void *ptr, size_t size, in set_reorder_access() argument
421 struct kcsan_scoped_access *reorder_access = get_reorder_access(ctx); in set_reorder_access()
431 ctx->disable_scoped++; in set_reorder_access()
439 ctx->disable_scoped--; in set_reorder_access()
463 struct kcsan_ctx *ctx = get_ctx(); in kcsan_found_watchpoint() local
473 if (!kcsan_is_enabled(ctx)) in kcsan_found_watchpoint()
483 if (ctx->access_mask && !find_reorder_access(ctx, ptr, size, type, ip)) in kcsan_found_watchpoint()
536 struct kcsan_ctx *ctx = get_ctx(); in kcsan_setup_watchpoint() local
537 unsigned long access_mask = ctx->access_mask; in kcsan_setup_watchpoint()
547 if (!kcsan_is_enabled(ctx)) in kcsan_setup_watchpoint()
570 is_reorder_access = find_reorder_access(ctx, ptr, size, type, ip); in kcsan_setup_watchpoint()
580 ctx->disable_scoped++; in kcsan_setup_watchpoint()
705 ctx->disable_scoped--; in kcsan_setup_watchpoint()
713 set_reorder_access(ctx, ptr, size, type, ip); in kcsan_setup_watchpoint()
750 struct kcsan_ctx *ctx = get_ctx(); /* Call only once in fast-path. */ in check_access() local
752 if (unlikely(should_watch(ctx, ptr, size, type))) { in check_access()
758 struct kcsan_scoped_access *reorder_access = get_reorder_access(ctx); in check_access()
787 if (unlikely(ctx->scoped_accesses.prev)) in check_access()
910 struct kcsan_ctx *ctx = get_ctx(); in kcsan_begin_scoped_access() local
914 ctx->disable_count++; /* Disable KCSAN, in case list debugging is on. */ in kcsan_begin_scoped_access()
922 if (!ctx->scoped_accesses.prev) /* Lazy initialize list head. */ in kcsan_begin_scoped_access()
923 INIT_LIST_HEAD(&ctx->scoped_accesses); in kcsan_begin_scoped_access()
924 list_add(&sa->list, &ctx->scoped_accesses); in kcsan_begin_scoped_access()
926 ctx->disable_count--; in kcsan_begin_scoped_access()
933 struct kcsan_ctx *ctx = get_ctx(); in kcsan_end_scoped_access() local
935 if (WARN(!ctx->scoped_accesses.prev, "Unbalanced %s()?", __func__)) in kcsan_end_scoped_access()
938 ctx->disable_count++; /* Disable KCSAN, in case list debugging is on. */ in kcsan_end_scoped_access()
941 if (list_empty(&ctx->scoped_accesses)) in kcsan_end_scoped_access()
948 ctx->scoped_accesses.prev = NULL; in kcsan_end_scoped_access()
950 ctx->disable_count--; in kcsan_end_scoped_access()