lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <521E312C.2050004@tilera.com>
Date:	Wed, 28 Aug 2013 13:19:40 -0400
From:	Chris Metcalf <cmetcalf@...era.com>
To:	Christoph Lameter <cl@...ux.com>
CC:	Tejun Heo <tj@...nel.org>, <akpm@...uxfoundation.org>,
	<linux-arch@...r.kernel.org>, Steven Rostedt <srostedt@...hat.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [guv v2 23/31] tile: Replace __get_cpu_var uses

On 8/27/2013 10:48 AM, Christoph Lameter wrote:
> On Mon, 26 Aug 2013, Chris Metcalf wrote:
>> > The rest is fine.  Would it make more sense for me to fold all these
>> > changes into the tile tree and just have it meet in linux-next?  There
>> > are certainly a bunch of other changes staged there which likely also
>> > include more uses of __get_cpu_var...
> Yes. Please stage this patch for the next merge window.

Taken into the tile tree, with one extra change; in arch/tile/kernel/messaging.c, using "__this_cpu_read(msg_state)" generated warnings ("'pscr_ret__.opaque[1u]' is used uninitialized in this function", etc), since msg_state is a struct, so I changed it to be "*__this_cpu_ptr(&msg_state)".  Interrupts are disabled here so preemption is not a concern.

In addition, I applied the following commit to clean up the remaining uses that are currently only being carried in the linux-tile tree.

commit db4dd3097952d2fd20e61f820dbb757ba871302d
Author: Chris Metcalf <cmetcalf@...era.com>
Date:   Wed Aug 28 12:01:44 2013 -0400

    tile: remove newer uses of __get_cpu_var

    See commit eb1fe08d458f for the first round.

    Signed-off-by: Chris Metcalf <cmetcalf@...era.com>

diff --git a/arch/tile/kernel/kprobes.c b/arch/tile/kernel/kprobes.c
index 1129f52..27cdcac 100644
--- a/arch/tile/kernel/kprobes.c
+++ b/arch/tile/kernel/kprobes.c
@@ -159,7 +159,7 @@ 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;
        kcb->kprobe_saved_pc = kcb->prev_kprobe.saved_pc;
 }
@@ -167,7 +167,7 @@ static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
 static void __kprobes set_current_kprobe(struct kprobe *p, struct pt_regs *regs,
                        struct kprobe_ctlblk *kcb)
 {
-       __get_cpu_var(current_kprobe) = p;
+       __this_cpu_write(current_kprobe, p);
        kcb->kprobe_saved_pc = regs->pc;
 }

@@ -228,7 +228,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
                                ret = 1;
                                goto no_kprobe;
                        }
-                       p = __get_cpu_var(current_kprobe);
+                       p = __this_cpu_read(current_kprobe);
                        if (p->break_handler && p->break_handler(p, regs))
                                goto ss_probe;
                }
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c
index a7a41a1..30c2c34 100644
--- a/arch/tile/kernel/time.c
+++ b/arch/tile/kernel/time.c
@@ -286,7 +286,7 @@ static int _set_clock_rate_barrier;
 static int _set_clock_rate(void *arg)
 {
        struct _set_clock_rate_args *args = arg;
-       struct clock_event_device *evt = &__get_cpu_var(tile_timer);
+       struct clock_event_device *evt = get_cpu_ptr(&tile_timer);

        /*
         * Only one CPU needs to change the timekeeping parameters and

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ