mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	mikey@neuling.org
Subject: Re: powerpc: Add an inline function to update HID0
Date: Wed, 05 Aug 2015 12:00:07 +1000	[thread overview]
Message-ID: <1438740007.2304.4.camel@ellerman.id.au> (raw)
In-Reply-To: <55C0C6C8.3030403@linux.vnet.ibm.com>

On Tue, 2015-08-04 at 19:36 +0530, Madhavan Srinivasan wrote:
> 
> On Tuesday 04 August 2015 03:38 PM, Michael Ellerman wrote:
> > On Tue, 2015-04-08 at 08:30:58 UTC, "Gautham R. Shenoy" wrote:
> >> Section 3.7 of Version 1.2 of the Power8 Processor User's Manual
> >> prescribes that updates to HID0 be preceded by a SYNC instruction and
> >> followed by an ISYNC instruction (Page 91).
> >>
> >> Create a function name update_hid0() which follows this recipe and
> >> invoke it from the static split core path.
> >>
> >> Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> >> ---
> >>  arch/powerpc/include/asm/kvm_ppc.h       | 11 +++++++++++
> > Why is it in there? It's not KVM related per se.
> >
> > Where should it go? I think reg.h would be best, ideally near the definition
> > for HID0, though that's probably not possible because of ASSEMBLY requirements.
> > So at the bottom of reg.h ?
> 
> just to understand, Something like this will not do?
> 
> #define update_hid0(x)  __asm__ __volatile__(   "sync\n"\
>                                                 "mtspr " __stringify(SPRN_HID0)", %0\n"\
>                                                 "isync"::"r"(x));
> 

Yeah we could do that also.

The static inline is less ugly though.

cheers



  reply	other threads:[~2015-08-05  2:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04  8:30 [PATCH] " Gautham R. Shenoy
2015-08-04 10:08 ` Michael Ellerman
2015-08-04 10:57   ` Gautham R Shenoy
2015-08-04 11:06     ` [PATCH v2] " Gautham R. Shenoy
2015-08-04 14:06   ` Madhavan Srinivasan
2015-08-05  2:00     ` Michael Ellerman [this message]
2015-08-05  2:30   ` Segher Boessenkool
2015-08-05  6:54     ` Gautham R Shenoy
2015-08-05  7:08       ` [PATCH v3] powerpc: Add an inline function to update POWER8 HID0 Gautham R. Shenoy
2015-08-14  4:54         ` Sam Bobroff
2015-08-14  8:59         ` Shreyas B Prabhu
2015-08-17  8:03         ` [v3] " Michael Ellerman
2015-08-09  2:29   ` powerpc: Add an inline function to update HID0 Benjamin Herrenschmidt

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=1438740007.2304.4.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.vnet.ibm.com \
    --cc=mikey@neuling.org \
    --cc=paulus@samba.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

Powered by JetHome