linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Christoph Lameter <cl@linux.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: powerpc: Replace __get_cpu_var uses
Date: Wed, 29 Oct 2014 17:39:57 +1100 (AEDT)	[thread overview]
Message-ID: <20141029063957.76C6014008E@ozlabs.org> (raw)
In-Reply-To: <alpine.DEB.2.11.1410211520470.20253@gentwo.org>

On Tue, 2014-21-10 at 20:23:25 UTC, Christoph Lameter wrote:
> This still has not been merged and now powerpc is the only arch that does
> not have this change. Sorry about missing linuxppc-dev before.
> 
> --- linux.orig/arch/powerpc/include/asm/hardirq.h
> +++ linux/arch/powerpc/include/asm/hardirq.h
> @@ -21,7 +21,9 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpust
> 
>  #define __ARCH_IRQ_STAT
> 
> -#define local_softirq_pending()	__get_cpu_var(irq_stat).__softirq_pending
> +#define local_softirq_pending()	__this_cpu_read(irq_stat.__softirq_pending)
> +#define set_softirq_pending(x) __this_cpu_write(irq_stat._softirq_pending, (x))
> +#define or_softirq_pending(x) __this_cpu_or(irq_stat._softirq_pending, (x))

This breaks the build, because we also get the version of set_ and or_ from
include/linux/interrupt.h, and then because it's __softirq_pending.

Fixed by adding:

#define __ARCH_SET_SOFTIRQ_PENDING

And fixing the typo.

> --- linux.orig/arch/powerpc/kernel/process.c
> +++ linux/arch/powerpc/kernel/process.c
> @@ -499,7 +499,7 @@ static inline int set_dawr(struct arch_h
> 
>  void __set_breakpoint(struct arch_hw_breakpoint *brk)
>  {
> -	__get_cpu_var(current_brk) = *brk;
> +	__this_cpu_write(current_brk, *brk);

This breaks the build because we're trying to do a structure assignment but
__this_cpu_write() only supports certain sizes.

I replaced it with this which I think is right?

	memcpy(this_cpu_ptr(&current_brk), brk, sizeof(*brk));


cheers

  parent reply	other threads:[~2014-10-29  6:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 20:23 powerpc: Replace __get_cpu_var uses Christoph Lameter
2014-10-27 15:57 ` Christoph Lameter
2014-10-27 21:10   ` Benjamin Herrenschmidt
2014-10-27 22:04     ` Michael Ellerman
2014-10-28  2:31       ` Christoph Lameter
2014-10-28  3:51       ` Benjamin Herrenschmidt
2014-10-29  6:39 ` Michael Ellerman [this message]
2014-10-29 13:49   ` Christoph Lameter
2014-11-04  4:49 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141029063957.76C6014008E@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).