[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1438740007.2304.4.camel@ellerman.id.au>
Date: Wed, 05 Aug 2015 12:00:07 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Madhavan Srinivasan <maddy@...ux.vnet.ibm.com>
Cc: "Gautham R. Shenoy" <ego@...ux.vnet.ibm.com>,
Paul Mackerras <paulus@...ba.org>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
mikey@...ling.org
Subject: Re: powerpc: Add an inline function to update HID0
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@...ux.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
--
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