Loading arch/arm/kernel/hw_breakpoint.c +7 −7 Original line number Diff line number Diff line Loading @@ -355,13 +355,13 @@ int arch_install_hw_breakpoint(struct perf_event *bp) /* Breakpoint */ ctrl_base = ARM_BASE_BCR; val_base = ARM_BASE_BVR; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); max_slots = core_num_brps; } else { /* Watchpoint */ ctrl_base = ARM_BASE_WCR; val_base = ARM_BASE_WVR; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); max_slots = core_num_wrps; } Loading Loading @@ -407,12 +407,12 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { /* Breakpoint */ base = ARM_BASE_BCR; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); max_slots = core_num_brps; } else { /* Watchpoint */ base = ARM_BASE_WCR; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); max_slots = core_num_wrps; } Loading Loading @@ -708,7 +708,7 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, struct arch_hw_breakpoint *info; struct arch_hw_breakpoint_ctrl ctrl; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); for (i = 0; i < core_num_wrps; ++i) { rcu_read_lock(); Loading Loading @@ -779,7 +779,7 @@ static void watchpoint_single_step_handler(unsigned long pc) struct perf_event *wp, **slots; struct arch_hw_breakpoint *info; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); for (i = 0; i < core_num_wrps; ++i) { rcu_read_lock(); Loading Loading @@ -813,7 +813,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) struct arch_hw_breakpoint *info; struct arch_hw_breakpoint_ctrl ctrl; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); /* The exception entry code places the amended lr in the PC. */ addr = regs->ARM_pc; Loading arch/arm/kernel/kprobes.c +4 −4 Original line number Diff line number Diff line Loading @@ -171,13 +171,13 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) { __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); kcb->kprobe_status = kcb->prev_kprobe.status; } static void __kprobes set_current_kprobe(struct kprobe *p) { __get_cpu_var(current_kprobe) = p; __this_cpu_write(current_kprobe, p); } static void __kprobes Loading Loading @@ -421,10 +421,10 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs) continue; if (ri->rp && ri->rp->handler) { __get_cpu_var(current_kprobe) = &ri->rp->kp; __this_cpu_write(current_kprobe, &ri->rp->kp); get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE; ri->rp->handler(ri, regs); __get_cpu_var(current_kprobe) = NULL; __this_cpu_write(current_kprobe, NULL); } orig_ret_address = (unsigned long)ri->ret_addr; Loading arch/arm/kernel/perf_event_cpu.c +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(perf_num_counters); static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) { return &__get_cpu_var(cpu_hw_events); return this_cpu_ptr(&cpu_hw_events); } void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) Loading arch/arm/kvm/arm.c +3 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ static bool vgic_present; static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) { BUG_ON(preemptible()); __get_cpu_var(kvm_arm_running_vcpu) = vcpu; __this_cpu_write(kvm_arm_running_vcpu, vcpu); } /** Loading @@ -75,7 +75,7 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) struct kvm_vcpu *kvm_arm_get_running_vcpu(void) { BUG_ON(preemptible()); return __get_cpu_var(kvm_arm_running_vcpu); return __this_cpu_read(kvm_arm_running_vcpu); } /** Loading Loading @@ -811,7 +811,7 @@ static void cpu_init_hyp_mode(void *dummy) boot_pgd_ptr = (unsigned long long)kvm_mmu_get_boot_httbr(); pgd_ptr = (unsigned long long)kvm_mmu_get_httbr(); stack_page = __get_cpu_var(kvm_arm_hyp_stack_page); stack_page = __this_cpu_read(kvm_arm_hyp_stack_page); hyp_stack_ptr = stack_page + PAGE_SIZE; vector_ptr = (unsigned long)__kvm_hyp_vector; Loading arch/arm64/kernel/debug-monitors.c +6 −7 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #include <linux/stat.h> #include <asm/debug-monitors.h> #include <asm/local.h> #include <asm/cputype.h> #include <asm/system_misc.h> Loading Loading @@ -88,8 +87,8 @@ early_param("nodebugmon", early_debug_disable); * Keep track of debug users on each core. * The ref counts are per-cpu so we use a local_t type. */ static DEFINE_PER_CPU(local_t, mde_ref_count); static DEFINE_PER_CPU(local_t, kde_ref_count); static DEFINE_PER_CPU(int, mde_ref_count); static DEFINE_PER_CPU(int, kde_ref_count); void enable_debug_monitors(enum debug_el el) { Loading @@ -97,11 +96,11 @@ void enable_debug_monitors(enum debug_el el) WARN_ON(preemptible()); if (local_inc_return(&__get_cpu_var(mde_ref_count)) == 1) if (this_cpu_inc_return(mde_ref_count) == 1) enable = DBG_MDSCR_MDE; if (el == DBG_ACTIVE_EL1 && local_inc_return(&__get_cpu_var(kde_ref_count)) == 1) this_cpu_inc_return(kde_ref_count) == 1) enable |= DBG_MDSCR_KDE; if (enable && debug_enabled) { Loading @@ -117,11 +116,11 @@ void disable_debug_monitors(enum debug_el el) WARN_ON(preemptible()); if (local_dec_and_test(&__get_cpu_var(mde_ref_count))) if (this_cpu_dec_return(mde_ref_count) == 0) disable = ~DBG_MDSCR_MDE; if (el == DBG_ACTIVE_EL1 && local_dec_and_test(&__get_cpu_var(kde_ref_count))) this_cpu_dec_return(kde_ref_count) == 0) disable &= ~DBG_MDSCR_KDE; if (disable) { Loading Loading
arch/arm/kernel/hw_breakpoint.c +7 −7 Original line number Diff line number Diff line Loading @@ -355,13 +355,13 @@ int arch_install_hw_breakpoint(struct perf_event *bp) /* Breakpoint */ ctrl_base = ARM_BASE_BCR; val_base = ARM_BASE_BVR; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); max_slots = core_num_brps; } else { /* Watchpoint */ ctrl_base = ARM_BASE_WCR; val_base = ARM_BASE_WVR; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); max_slots = core_num_wrps; } Loading Loading @@ -407,12 +407,12 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) if (info->ctrl.type == ARM_BREAKPOINT_EXECUTE) { /* Breakpoint */ base = ARM_BASE_BCR; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); max_slots = core_num_brps; } else { /* Watchpoint */ base = ARM_BASE_WCR; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); max_slots = core_num_wrps; } Loading Loading @@ -708,7 +708,7 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr, struct arch_hw_breakpoint *info; struct arch_hw_breakpoint_ctrl ctrl; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); for (i = 0; i < core_num_wrps; ++i) { rcu_read_lock(); Loading Loading @@ -779,7 +779,7 @@ static void watchpoint_single_step_handler(unsigned long pc) struct perf_event *wp, **slots; struct arch_hw_breakpoint *info; slots = (struct perf_event **)__get_cpu_var(wp_on_reg); slots = this_cpu_ptr(wp_on_reg); for (i = 0; i < core_num_wrps; ++i) { rcu_read_lock(); Loading Loading @@ -813,7 +813,7 @@ static void breakpoint_handler(unsigned long unknown, struct pt_regs *regs) struct arch_hw_breakpoint *info; struct arch_hw_breakpoint_ctrl ctrl; slots = (struct perf_event **)__get_cpu_var(bp_on_reg); slots = this_cpu_ptr(bp_on_reg); /* The exception entry code places the amended lr in the PC. */ addr = regs->ARM_pc; Loading
arch/arm/kernel/kprobes.c +4 −4 Original line number Diff line number Diff line Loading @@ -171,13 +171,13 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) { __get_cpu_var(current_kprobe) = kcb->prev_kprobe.kp; __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); kcb->kprobe_status = kcb->prev_kprobe.status; } static void __kprobes set_current_kprobe(struct kprobe *p) { __get_cpu_var(current_kprobe) = p; __this_cpu_write(current_kprobe, p); } static void __kprobes Loading Loading @@ -421,10 +421,10 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs) continue; if (ri->rp && ri->rp->handler) { __get_cpu_var(current_kprobe) = &ri->rp->kp; __this_cpu_write(current_kprobe, &ri->rp->kp); get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE; ri->rp->handler(ri, regs); __get_cpu_var(current_kprobe) = NULL; __this_cpu_write(current_kprobe, NULL); } orig_ret_address = (unsigned long)ri->ret_addr; Loading
arch/arm/kernel/perf_event_cpu.c +1 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(perf_num_counters); static struct pmu_hw_events *cpu_pmu_get_cpu_events(void) { return &__get_cpu_var(cpu_hw_events); return this_cpu_ptr(&cpu_hw_events); } void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) Loading
arch/arm/kvm/arm.c +3 −3 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ static bool vgic_present; static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) { BUG_ON(preemptible()); __get_cpu_var(kvm_arm_running_vcpu) = vcpu; __this_cpu_write(kvm_arm_running_vcpu, vcpu); } /** Loading @@ -75,7 +75,7 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) struct kvm_vcpu *kvm_arm_get_running_vcpu(void) { BUG_ON(preemptible()); return __get_cpu_var(kvm_arm_running_vcpu); return __this_cpu_read(kvm_arm_running_vcpu); } /** Loading Loading @@ -811,7 +811,7 @@ static void cpu_init_hyp_mode(void *dummy) boot_pgd_ptr = (unsigned long long)kvm_mmu_get_boot_httbr(); pgd_ptr = (unsigned long long)kvm_mmu_get_httbr(); stack_page = __get_cpu_var(kvm_arm_hyp_stack_page); stack_page = __this_cpu_read(kvm_arm_hyp_stack_page); hyp_stack_ptr = stack_page + PAGE_SIZE; vector_ptr = (unsigned long)__kvm_hyp_vector; Loading
arch/arm64/kernel/debug-monitors.c +6 −7 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #include <linux/stat.h> #include <asm/debug-monitors.h> #include <asm/local.h> #include <asm/cputype.h> #include <asm/system_misc.h> Loading Loading @@ -88,8 +87,8 @@ early_param("nodebugmon", early_debug_disable); * Keep track of debug users on each core. * The ref counts are per-cpu so we use a local_t type. */ static DEFINE_PER_CPU(local_t, mde_ref_count); static DEFINE_PER_CPU(local_t, kde_ref_count); static DEFINE_PER_CPU(int, mde_ref_count); static DEFINE_PER_CPU(int, kde_ref_count); void enable_debug_monitors(enum debug_el el) { Loading @@ -97,11 +96,11 @@ void enable_debug_monitors(enum debug_el el) WARN_ON(preemptible()); if (local_inc_return(&__get_cpu_var(mde_ref_count)) == 1) if (this_cpu_inc_return(mde_ref_count) == 1) enable = DBG_MDSCR_MDE; if (el == DBG_ACTIVE_EL1 && local_inc_return(&__get_cpu_var(kde_ref_count)) == 1) this_cpu_inc_return(kde_ref_count) == 1) enable |= DBG_MDSCR_KDE; if (enable && debug_enabled) { Loading @@ -117,11 +116,11 @@ void disable_debug_monitors(enum debug_el el) WARN_ON(preemptible()); if (local_dec_and_test(&__get_cpu_var(mde_ref_count))) if (this_cpu_dec_return(mde_ref_count) == 0) disable = ~DBG_MDSCR_MDE; if (el == DBG_ACTIVE_EL1 && local_dec_and_test(&__get_cpu_var(kde_ref_count))) this_cpu_dec_return(kde_ref_count) == 0) disable &= ~DBG_MDSCR_KDE; if (disable) { Loading