Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Benjamin Herrenschmidt
On Fri, 2011-03-04 at 17:07 -0600, Tseng-Hui (Frank) Lin wrote: > I don't have any measurable numbers. That's why I made it an option in > case people wants to disable it. I do agree that the kernel has so many > options that we should refrain from adding more. If the chance that the > lazy switchi

Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Tseng-Hui (Frank) Lin
On Sat, 2011-03-05 at 09:40 +1100, Benjamin Herrenschmidt wrote: > > The lazy switching checks the shadow variable first before setting ACOP > > register. This saves mtspr() only if the new value is the same as > > current. If there are several coprocessors on the system, the ACOP > > register may

Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Benjamin Herrenschmidt
On Fri, 2011-03-04 at 16:22 -0600, Tseng-Hui (Frank) Lin wrote: > > Well, I don't know how you use icswx on P7+, but on Prism it's > > definitely issued directly by userspace. > > > OK. You've got a point. I wasn't aware of Prism. HFI device driver is > currently the only icswx user on P7. Could

Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Tseng-Hui (Frank) Lin
On Sat, 2011-03-05 at 07:26 +1100, Benjamin Herrenschmidt wrote: > On Fri, 2011-03-04 at 11:29 -0600, Tseng-Hui (Frank) Lin wrote: > > On Fri, 2011-03-04 at 12:02 +1100, Benjamin Herrenschmidt wrote: > > > On Wed, 2011-03-02 at 11:20 -0600, Tseng-Hui (Frank) Lin wrote: > > > > > > > +#define CPU_F

Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Benjamin Herrenschmidt
On Fri, 2011-03-04 at 11:29 -0600, Tseng-Hui (Frank) Lin wrote: > On Fri, 2011-03-04 at 12:02 +1100, Benjamin Herrenschmidt wrote: > > On Wed, 2011-03-02 at 11:20 -0600, Tseng-Hui (Frank) Lin wrote: > > > > > +#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000) > > > > Do we

Re: [PATCH v4 2/2] add icswx support

2011-03-04 Thread Tseng-Hui (Frank) Lin
On Fri, 2011-03-04 at 12:02 +1100, Benjamin Herrenschmidt wrote: > On Wed, 2011-03-02 at 11:20 -0600, Tseng-Hui (Frank) Lin wrote: > > > +#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000) > > Do we want a userspace visible feature as well ? Or some other way to > inform us

Re: [PATCH v4 2/2] add icswx support

2011-03-03 Thread Benjamin Herrenschmidt
On Wed, 2011-03-02 at 11:20 -0600, Tseng-Hui (Frank) Lin wrote: > +#define CPU_FTR_ICSWX LONG_ASM_CONST(0x1000) Do we want a userspace visible feature as well ? Or some other way to inform userspace that we support icswx ? > index acac35d..b0c2549 100644 > --- a/arc

[PATCH v4 2/2] add icswx support

2011-03-02 Thread Tseng-Hui (Frank) Lin
Icswx is a PowerPC co-processor instruction to send data to a co-processor. On Book-S processors the LPAR_ID and process ID (PID) of the owning process are registered in the window context of the co-processor at initial time. When the icswx instruction is executed, the L2 generates a cop-reg transa