LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH V3 1/2] powerpc/85xx: Add QE common init functions
From: Scott Wood @ 2013-09-06 15:24 UTC (permalink / raw)
  To: Xie Xiaobo-R63061; +Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <69EC9ED88E3CC04094A78F8074A7986D5D2378@039-SN1MPN1-003.039d.mgd.msft.net>

On Fri, 2013-09-06 at 04:52 -0500, Xie Xiaobo-R63061 wrote:
> Hi Scott,
> 
> I already remove these code from the P1025TWR platform file(see the 2/2 patch). Do you means I also need to remove these codes from the others platforms and use the common call instead? 
> Thank you.

Yes.

-Scott

^ permalink raw reply

* Re: [PATCH] powerpc: Add I2C bus multiplexer node for B4 and T4240QDS
From: Scott Wood @ 2013-09-06 15:17 UTC (permalink / raw)
  To: Tang Yuantian-B29983
  Cc: Wood Scott-B07421, linuxppc-dev@lists.ozlabs.org, Yang, Wei,
	Jia Hongtao-B38951
In-Reply-To: <D07C73A334FF604B95B3CBD2A545D07B1506A44E@039-SN2MPN1-013.039d.mgd.msft.net>

On Thu, 2013-09-05 at 21:30 -0500, Tang Yuantian-B29983 wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: 2013=E5=B9=B49=E6=9C=886=E6=97=A5 =E6=98=9F=E6=9C=9F=E4=BA=94 2=
:41
> > To: Tang Yuantian-B29983
> > Cc: Yang,Wei; Jia Hongtao-B38951; Wood Scott-B07421; linuxppc-
> > dev@lists.ozlabs.org
> > Subject: Re: [PATCH] powerpc: Add I2C bus multiplexer node for B4 and
> > T4240QDS
> >=20
> > On Tue, 2013-09-03 at 22:30 -0500, Tang Yuantian-B29983 wrote:
> > > Hi,
> > >
> > > These eeproms are never used by kernel. So no need to add them.
> >=20
> > The device tree describes the hardware, not what Linux does with it.
> >=20
> Missing some nodes doesn't mean it is not describing the hardware.
> There are almost fifty I2C devices on T4 connected to PCA9547.
> Do you think we need to list them all?

Ideally, yes.  I realize it's not uncommon for some things to be
missing, but that's not a reason to tell people to leave things out just
because Linux doesn't use them.

-Scott

^ permalink raw reply

* [PATCH] powerpc: OE=1 Form Instructions Not Decoded Correctly
From: Tom Musta @ 2013-09-06 15:13 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 10460 bytes --]

To: linuxppc-dev@lists.ozlabs.org
Subject: [PATCH] powerpc: OE=1 Form Instructions Not Decoded Correctly
From: Tom Musta <tommusta@gmail.com>

PowerISA uses instruction bit 21 to indicate that the overflow (OV) bit
of the XER is to be set, as well as its corresponding sticky bit (SO).
This patch addresses two defects in the implementation of the PowerISA
single step code for this category of instructions:  (a) the OE=1 case
is not correctly accounted for in the case statement for the extended
opcode handling.  (b) the implementation is not setting XER[OV] and
XER[SO].

Signed-off-by: Tom Musta <tommusta@gmail.com>

---
 arch/powerpc/lib/sstep.c |  208
+++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 185 insertions(+), 23 deletions(-)


diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index d220b88..a4f343d 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -31,6 +31,13 @@ extern char system_call_common[];
 #define XER_OV 0x40000000U
 #define XER_CA 0x20000000U

+#define U32_MSK         0xFFFFFFFF00000000ul
+#define L32_MSK         0x00000000FFFFFFFFul
+#define SGN_32_MSK      0x0000000080000000ul
+#define SGN_64_MSK      0x8000000000000000ul
+#define SGN_EXT_32(x)   (((x) & SGN_32_MSK) ? ((x) | U32_MSK) : ((x) &
L32_MSK))
+#define L32(x)          ((x) & L32_MSK)
+
 #ifdef CONFIG_PPC_FPU
 /*
  * Functions in ldstfp.S
@@ -467,6 +474,13 @@ static int __kprobes do_vsx_store(int rn, int
(*func)(int, unsigned long),
  ".previous" \
  : "=r" (err) \
  : "r" (addr), "i" (-EFAULT), "0" (err))
+static void __kprobes set_xer_ov(struct pt_regs *regs, int ov)
+{
+ if (ov)
+ regs->xer |= (XER_SO | XER_OV);
+ else
+ regs->xer &= ~XER_OV;
+}

 static void __kprobes set_cr0(struct pt_regs *regs, int rd)
 {
@@ -487,7 +501,7 @@ static void __kprobes set_cr0(struct pt_regs *regs, int
rd)

 static void __kprobes add_with_carry(struct pt_regs *regs, int rd,
      unsigned long val1, unsigned long val2,
-     unsigned long carry_in)
+     unsigned long carry_in, int oe)
 {
  unsigned long val = val1 + val2;

@@ -504,6 +518,13 @@ static void __kprobes add_with_carry(struct pt_regs
*regs, int rd,
  regs->xer |= XER_CA;
  else
  regs->xer &= ~XER_CA;
+ if (oe) {
+ unsigned long m = ((regs->msr & MSR_64BIT) == 0) ?
+ SGN_32_MSK : SGN_64_MSK;
+ int ov = ((val1 & m) == (val2 & m)) &&
+ ((val1 & m) != (val & m));
+ set_xer_ov(regs, ov);
+ }
 }

 static void __kprobes do_cmp_signed(struct pt_regs *regs, long v1, long v2,
@@ -552,7 +573,7 @@ static void __kprobes do_cmp_unsigned(struct pt_regs
*regs, unsigned long v1,
 #define DATA32(x) (x)
 #endif
 #define ROTATE(x, n) ((n) ? (((x) << (n)) | ((x) >> (8 * sizeof(long) -
(n)))) : (x))
-
+#define OE(instr)       (((instr) >> (31-21)) & 1)
 /*
  * Emulate instructions that cause a transfer of control,
  * loads and stores, and a few other instructions.
@@ -693,7 +714,7 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)

  case 8: /* subfic */
  imm = (short) instr;
- add_with_carry(regs, rd, ~regs->gpr[ra], imm, 1);
+ add_with_carry(regs, rd, ~regs->gpr[ra], imm, 1, 0);
  goto instr_done;

  case 10: /* cmpli */
@@ -718,12 +739,12 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)

  case 12: /* addic */
  imm = (short) instr;
- add_with_carry(regs, rd, regs->gpr[ra], imm, 0);
+ add_with_carry(regs, rd, regs->gpr[ra], imm, 0, 0);
  goto instr_done;

  case 13: /* addic. */
  imm = (short) instr;
- add_with_carry(regs, rd, regs->gpr[ra], imm, 0);
+ add_with_carry(regs, rd, regs->gpr[ra], imm, 0, 0);
  set_cr0(regs, rd);
  goto instr_done;

@@ -944,8 +965,9 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)
  * Arithmetic instructions
  */
  case 8: /* subfc */
+ case 520: /* subfco */
  add_with_carry(regs, rd, ~regs->gpr[ra],
-       regs->gpr[rb], 1);
+       regs->gpr[rb], 1, OE(instr));
  goto arith_done;
 #ifdef __powerpc64__
  case 9: /* mulhdu */
@@ -954,8 +976,9 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)
  goto arith_done;
 #endif
  case 10: /* addc */
+ case 522:       /* addco */
  add_with_carry(regs, rd, regs->gpr[ra],
-       regs->gpr[rb], 0);
+       regs->gpr[rb], 0, OE(instr));
  goto arith_done;

  case 11: /* mulhwu */
@@ -964,7 +987,19 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)
  goto arith_done;

  case 40: /* subf */
- regs->gpr[rd] = regs->gpr[rb] - regs->gpr[ra];
+ case 552: /* subfo */
+ val = regs->gpr[rb] - regs->gpr[ra];
+ if (OE(instr)) { /* subfo */
+ unsigned long m =
+ ((regs->msr & MSR_64BIT) == 0) ?
+ SGN_32_MSK : SGN_64_MSK;
+ int ov =
+ ((~regs->gpr[ra] & m) ==
+ (regs->gpr[rb] & m)) &&
+ ((regs->gpr[rb] & m) != (val & m));
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;
 #ifdef __powerpc64__
  case 73: /* mulhd */
@@ -978,69 +1013,196 @@ int __kprobes emulate_step(struct pt_regs *regs,
unsigned int instr)
  goto arith_done;

  case 104: /* neg */
+ case 616: /* nego */
  regs->gpr[rd] = -regs->gpr[ra];
+ if (OE(instr)) { /* nego */
+ int ov = (regs->msr & MSR_64BIT) ?
+ (regs->gpr[rd] == 0x8000000000000000l) :
+ (regs->gpr[rd] == 0x80000000l);
+ set_xer_ov(regs, ov);
+ }
  goto arith_done;

  case 136: /* subfe */
+ case 648: /* subfeo */
  add_with_carry(regs, rd, ~regs->gpr[ra], regs->gpr[rb],
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;

  case 138: /* adde */
+ case 650: /* addeo */
  add_with_carry(regs, rd, regs->gpr[ra], regs->gpr[rb],
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;

  case 200: /* subfze */
+ case 712: /* subfzeo */
  add_with_carry(regs, rd, ~regs->gpr[ra], 0L,
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;

  case 202: /* addze */
+ case 714: /* addzeo */
  add_with_carry(regs, rd, regs->gpr[ra], 0L,
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;

  case 232: /* subfme */
+ case 744: /* subfmeo */
  add_with_carry(regs, rd, ~regs->gpr[ra], -1L,
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;
 #ifdef __powerpc64__
  case 233: /* mulld */
- regs->gpr[rd] = regs->gpr[ra] * regs->gpr[rb];
+ case 745:       /* mulldo */
+ {
+ unsigned long xer_copy;
+ asm("mulldo %0,%2,%3;"
+ "mfxer %1" :
+ "=r" (regs->gpr[rd]), "=r" (xer_copy) :
+ "r" (regs->gpr[ra]), "r" (regs->gpr[rb]));
+ if (OE(instr))
+ set_xer_ov(regs, (xer_copy & XER_OV) != 0);
  goto arith_done;
+ }
 #endif
  case 234: /* addme */
+ case 746: /* addme0 */
  add_with_carry(regs, rd, regs->gpr[ra], -1L,
-       regs->xer & XER_CA);
+       regs->xer & XER_CA, OE(instr));
  goto arith_done;

  case 235: /* mullw */
- regs->gpr[rd] = (unsigned int) regs->gpr[ra] *
- (unsigned int) regs->gpr[rb];
+ case 747: /* mullwo */
+ regs->gpr[rd] = SGN_EXT_32(regs->gpr[ra]) *
+ SGN_EXT_32(regs->gpr[rb]);
+ if (OE(instr)) { /* mullwo */
+ int ov = 0;
+ if ((regs->gpr[rd] & U32_MSK) == 0)
+ ov = (regs->gpr[rd] & SGN_32_MSK) != 0;
+ else if ((regs->gpr[rd] & U32_MSK) == U32_MSK)
+ ov = (regs->gpr[rd] & SGN_32_MSK) == 0;
+ else
+ ov = 1;
+ set_xer_ov(regs, ov);
+ }
  goto arith_done;

  case 266: /* add */
- regs->gpr[rd] = regs->gpr[ra] + regs->gpr[rb];
+ case 778: /* addo */
+ val = regs->gpr[ra] + regs->gpr[rb];
+ if (OE(instr)) { /* addo */
+ unsigned long m = ((regs->msr & MSR_64BIT) == 0)
+ ? SGN_32_MSK : SGN_64_MSK;
+ int ov = ((regs->gpr[ra] & m) ==
+ (regs->gpr[rb] & m)) &&
+ ((regs->gpr[ra] & m) != (val & m));
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
+ goto arith_done;
+#ifdef __powerpc64__
+ case 393: /* divdeu */
+ case 905:       /* divdeuo */
+ {
+ unsigned long xer_copy;
+ asm("divdeuo %0,%2,%3;"
+ "mfxer %1" :
+ "=r" (regs->gpr[rd]), "=r" (xer_copy) :
+ "r" (regs->gpr[ra]), "r" (regs->gpr[rb]));
+ if (OE(instr))
+ set_xer_ov(regs, (xer_copy & XER_OV) != 0);
+ goto arith_done;
+ }
+#endif
+ case 395: /* divweu */
+ case 907: /* divweuo */
+ val = (L32(regs->gpr[ra]) << 32) / L32(regs->gpr[rb]);
+ if (OE(instr)) {
+ int ov = (L32(regs->gpr[rb]) == 0) ||
+ ((val & U32_MSK) != 0);
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
+ goto arith_done;
+#ifdef __powerpc64__
+ case 425: /* divde */
+ case 937:       /* divdeo */
+ {
+ unsigned long xer_copy;
+ asm("divdeo %0,%2,%3;"
+ " mfxer %1" :
+ "=r" (regs->gpr[rd]), "=r" (xer_copy) :
+ "r" (regs->gpr[ra]), "r" (regs->gpr[rb]));
+ if (OE(instr))
+ set_xer_ov(regs, (xer_copy & XER_OV) != 0);
+ goto arith_done;
+ }
+#endif
+ case 427: /* divwe */
+ case 939: /* divweo */
+ val = ((long int)SGN_EXT_32(regs->gpr[ra]) << 32) /
+ (long int)SGN_EXT_32(regs->gpr[rb]);
+ if (OE(instr)) {
+ int ov = (L32(regs->gpr[rb]) == 0) ||
+ ((L32(regs->gpr[ra]) == SGN_32_MSK) &&
+ (L32(regs->gpr[rb]) == L32_MSK));
+ if ((val & U32_MSK) == 0)
+ ov |= (val & SGN_32_MSK) != 0;
+ else if ((val & U32_MSK) == U32_MSK)
+ ov |= (val & SGN_32_MSK) == 0;
+ else
+ ov = 1;
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;
 #ifdef __powerpc64__
  case 457: /* divdu */
- regs->gpr[rd] = regs->gpr[ra] / regs->gpr[rb];
+ case 969: /* divduo */
+ val = regs->gpr[ra] / regs->gpr[rb];
+ if (OE(instr)) { /* divduo */
+ int ov = (regs->gpr[rb] == 0);
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;
 #endif
  case 459: /* divwu */
- regs->gpr[rd] = (unsigned int) regs->gpr[ra] /
+ case 971: /* divwuo */
+ val = (unsigned int) regs->gpr[ra] /
  (unsigned int) regs->gpr[rb];
+ if (OE(instr)) { /* divwuo */
+ int ov = (L32(regs->gpr[rb]) == 0);
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;
 #ifdef __powerpc64__
  case 489: /* divd */
- regs->gpr[rd] = (long int) regs->gpr[ra] /
+ case 1001: /* divdo */
+ val = (long int) regs->gpr[ra] /
  (long int) regs->gpr[rb];
+ if (OE(instr)) { /* divdo */
+ int ov = (regs->gpr[rb] == 0) ||
+ ((regs->gpr[ra] == SGN_64_MSK) &&
+ (regs->gpr[rb] == -1ul));
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;
 #endif
  case 491: /* divw */
- regs->gpr[rd] = (int) regs->gpr[ra] /
- (int) regs->gpr[rb];
+ case 1003: /* divwo */
+ val = (long int)SGN_EXT_32(regs->gpr[ra]) /
+ (long int)SGN_EXT_32(regs->gpr[rb]);
+ if (OE(instr)) {
+ int ov = (L32(regs->gpr[rb]) == 0) ||
+ ((L32(regs->gpr[ra]) == SGN_32_MSK) &&
+ (L32(regs->gpr[rb]) == L32_MSK));
+ set_xer_ov(regs, ov);
+ }
+ regs->gpr[rd] = val;
  goto arith_done;

[-- Attachment #2: Type: text/html, Size: 12704 bytes --]

^ permalink raw reply related

* Re: [PATCH V2 2/2] powerpc/85xx: workaround for chips with MSI hardware errata
From: Kumar Gala @ 2013-09-06 15:01 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Jia Hongtao, B07421
In-Reply-To: <1378406276.12204.101.camel@snotra.buserror.net>


On Sep 5, 2013, at 1:37 PM, Scott Wood wrote:

> On Thu, 2013-09-05 at 13:34 -0500, Kumar Gala wrote:
>> On Apr 2, 2013, at 9:03 PM, Jia Hongtao wrote:
>>> +			msi->feature |=3D MSI_HW_ERRATA_ENDIAN;
>>> +	}
>>> +
>>> 	/*
>>> 	 * Remember the phandle, so that we can match with any PCI nodes
>>> 	 * that have an "fsl,msi" property.
>>> diff --git a/arch/powerpc/sysdev/fsl_msi.h =
b/arch/powerpc/sysdev/fsl_msi.h
>>> index 8225f86..7389e8e 100644
>>> --- a/arch/powerpc/sysdev/fsl_msi.h
>>> +++ b/arch/powerpc/sysdev/fsl_msi.h
>>> @@ -25,6 +25,8 @@
>>> #define FSL_PIC_IP_IPIC   0x00000002
>>> #define FSL_PIC_IP_VMPIC  0x00000003
>>>=20
>>> +#define MSI_HW_ERRATA_ENDIAN 0x00000010
>>> +
>>=20
>> Why does this need to be in the header, why not just have it in the =
.c only
>=20
> Didn't you ask this last time around? :-)
>=20
> This flag is part of the same numberspace as FSL_PIC_IP_xxx and thus
> should be defined in the same place.

I probably did, if its part of the FSL_PIC_IP_xxx namespace, than lets =
remove blank line between things to make that a bit more clear

- k

^ permalink raw reply

* Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Alexey Kardashevskiy @ 2013-09-06 10:45 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: kvm, Alexander Graf, kvm-ppc, linux-kernel, linux-mm,
	Paul Mackerras, Paolo Bonzini, linuxppc-dev, David Gibson
In-Reply-To: <20130906065715.GG13021@redhat.com>

On 09/06/2013 04:57 PM, Gleb Natapov wrote:
> On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote:
>> On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote:
>>>> Or supporting all IOMMU links (and leaving emulated stuff as is) in on
>>>> "device" is the last thing I have to do and then you'll ack the patch?
>>>>
>>> I am concerned more about API here. Internal implementation details I
>>> leave to powerpc experts :)
>>
>> So Gleb, I want to step in for a bit here.
>>
>> While I understand that the new KVM device API is all nice and shiny and that this
>> whole thing should probably have been KVM devices in the first place (had they
>> existed or had we been told back then), the point is, the API for handling
>> HW IOMMUs that Alexey is trying to add is an extension of an existing mechanism
>> used for emulated IOMMUs.
>>
>> The internal data structure is shared, and fundamentally, by forcing him to
>> use that new KVM device for the "new stuff", we create a oddball API with
>> an ioctl for one type of iommu and a KVM device for the other, which makes
>> the implementation a complete mess in the kernel (and you should care :-)
>>
> Is it unfixable mess? Even if Alexey will do what you suggested earlier?
> 
>   - Convert *both* existing TCE objects to the new
>       KVM_CREATE_DEVICE, and have some backward compat code for the old one.
> 
> The point is implementation usually can be changed, but for API it is
> much harder to do so.
> 
>> So for something completely new, I would tend to agree with you. However, I
>> still think that for this specific case, we should just plonk-in the original
>> ioctl proposed by Alexey and be done with it.
>>
> Do you think this is the last extension to IOMMU code, or we will see
> more and will use same justification to continue adding ioctls?


Ok. I give up :) I implemented KVM device the way you suggested. Could you
please have a look? It is "[PATCH v10 12/13] KVM: PPC: Add support for
IOMMU in-kernel handling", attached to this thread. Thanks!



-- 
Alexey

^ permalink raw reply

* [PATCH v10 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Alexey Kardashevskiy @ 2013-09-06 10:40 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: kvm, Gleb Natapov, Alexey Kardashevskiy, Alexander Graf, kvm-ppc,
	linux-kernel, Paul Mackerras, David Gibson
In-Reply-To: <1377679841-3822-1-git-send-email-aik@ozlabs.ru>

This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT
and H_STUFF_TCE requests targeted an IOMMU TCE table without passing
them to user space which saves time on switching to user space and back.

Both real and virtual modes are supported. The kernel tries to
handle a TCE request in the real mode, if fails it passes the request
to the virtual mode to complete the operation. If it a virtual mode
handler fails, the request is passed to user space.

The first user of this is VFIO on POWER. Trampolines to the VFIO external
user API functions are required for this patch.

This adds a "SPAPR TCE IOMMU" KVM device to associate a logical bus
number (LIOBN) with an VFIO IOMMU group fd and enable in-kernel handling
of map/unmap requests. The device supports a single attribute which is
a struct with LIOBN and IOMMU fd. When the attribute is set, the device
establishes the connection between KVM and VFIO.

Tests show that this patch increases transmission speed from 220MB/s
to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card).

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

---

Changes:
v10:
* all IOMMU TCE links are handled by one KVM device now
* KVM device has its own list of TCE descriptors
* the search-by-liobn function was extended to search through
emulated and IOMMU lists

v9:
* KVM_CAP_SPAPR_TCE_IOMMU ioctl to KVM replaced with "SPAPR TCE IOMMU"
KVM device
* release_spapr_tce_table() is not shared between different TCE types
* reduced the patch size by moving KVM device bits and VFIO external API
trampolines to separate patches
* moved documentation from Documentation/virtual/kvm/api.txt to
Documentation/virtual/kvm/devices/spapr_tce_iommu.txt

v8:
* fixed warnings from check_patch.pl

2013/07/11:
* removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled
for KVM_BOOK3S_64
* kvmppc_gpa_to_hva_and_get also returns host phys address. Not much sense
for this here but the next patch for hugepages support will use it more.

2013/07/06:
* added realmode arch_spin_lock to protect TCE table from races
in real and virtual modes
* POWERPC IOMMU API is changed to support real mode
* iommu_take_ownership and iommu_release_ownership are protected by
iommu_table's locks
* VFIO external user API use rewritten
* multiple small fixes

2013/06/27:
* tce_list page is referenced now in order to protect it from accident
invalidation during H_PUT_TCE_INDIRECT execution
* added use of the external user VFIO API

2013/06/05:
* changed capability number
* changed ioctl number
* update the doc article number

2013/05/20:
* removed get_user() from real mode handlers
* kvm_vcpu_arch::tce_tmp usage extended. Now real mode handler puts there
translated TCEs, tries realmode_get_page() on those and if it fails, it
passes control over the virtual mode handler which tries to finish
the request handling
* kvmppc_lookup_pte() now does realmode_get_page() protected by BUSY bit
on a page
* The only reason to pass the request to user mode now is when the user mode
did not register TCE table in the kernel, in all other cases the virtual mode
handler is expected to do the job
---
 .../virtual/kvm/devices/spapr_tce_iommu.txt        |  40 +++
 arch/powerpc/include/asm/kvm_host.h                |   8 +
 arch/powerpc/include/uapi/asm/kvm.h                |   5 -
 arch/powerpc/kvm/book3s_64_vio.c                   | 327 ++++++++++++++++++++-
 arch/powerpc/kvm/book3s_64_vio_hv.c                | 142 +++++++++
 arch/powerpc/kvm/powerpc.c                         |   1 +
 include/linux/kvm_host.h                           |   1 +
 virt/kvm/kvm_main.c                                |   5 +
 8 files changed, 517 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/virtual/kvm/devices/spapr_tce_iommu.txt

diff --git a/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
new file mode 100644
index 0000000..b911945
--- /dev/null
+++ b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
@@ -0,0 +1,40 @@
+SPAPR TCE IOMMU device
+
+Capability: KVM_CAP_SPAPR_TCE_IOMMU
+Architectures: powerpc
+
+Device type supported: KVM_DEV_TYPE_SPAPR_TCE_IOMMU
+
+Groups:
+  KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE
+  Attributes: one VFIO IOMMU fd per LIOBN, indexed by LIOBN
+
+This is completely made up device which provides API to link
+logical bus number (LIOBN) and IOMMU group. The user space has
+to create a new SPAPR TCE IOMMU device once per KVM session
+and use "set_attr" to add or remove a logical bus.
+
+LIOBN is a PCI bus identifier from PPC64-server (sPAPR) DMA hypercalls
+(H_PUT_TCE, H_PUT_TCE_INDIRECT, H_STUFF_TCE).
+IOMMU group is a minimal isolated device set which can be passed to
+the user space via VFIO.
+
+The userspace adds the new LIOBN-IOMMU link by calling KVM_SET_DEVICE_ATTR
+with the attribute initialized as shown below:
+struct kvm_device_attr attr = {
+	.flags = 0,
+	.group = KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE,
+	.attr = liobn,
+	.addr = (uint64_t)(uintptr_t)&group_fd,
+};
+
+To remove the link, the userspace calls KVM_SET_DEVICE_ATTR with
+the group_fd equal to zero.
+
+As the device opens VFIO group fds and holds the file pointer,
+it does not need to keep an fd internally and therefore KVM_GET_DEVICE_ATTR
+is not supported.
+
+When KVM exits, all links are destroyed automatically.
+
+The kernel advertises this feature via KVM_CAP_SPAPR_TCE_IOMMU capability.
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index a23f132..a2a481e 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -181,9 +181,15 @@ struct kvmppc_spapr_tce_table {
 	struct kvm *kvm;
 	u64 liobn;
 	u32 window_size;
+	struct iommu_group *grp;		/* used for IOMMU groups */
+	struct vfio_group *vfio_grp;		/* used for IOMMU groups */
 	struct page *pages[0];
 };
 
+struct kvmppc_spapr_tce_iommu_device {
+	struct list_head tables;
+};
+
 struct kvmppc_linear_info {
 	void		*base_virt;
 	unsigned long	 base_pfn;
@@ -264,6 +270,7 @@ struct kvm_arch {
 #endif /* CONFIG_KVM_BOOK3S_64_HV */
 #ifdef CONFIG_PPC_BOOK3S_64
 	struct list_head spapr_tce_tables;
+	struct kvmppc_spapr_tce_iommu_device *tcedev;
 	struct list_head rtas_tokens;
 #endif
 #ifdef CONFIG_KVM_MPIC
@@ -612,6 +619,7 @@ struct kvm_vcpu_arch {
 	u64 busy_preempt;
 
 	unsigned long *tce_tmp_hpas;	/* TCE cache for TCE_PUT_INDIRECT */
+	unsigned long tce_tmp_num;	/* Number of handled TCEs in cache */
 	enum {
 		TCERM_NONE,
 		TCERM_GETPAGE,
diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
index c1ae1e5..a9d3d73 100644
--- a/arch/powerpc/include/uapi/asm/kvm.h
+++ b/arch/powerpc/include/uapi/asm/kvm.h
@@ -512,11 +512,6 @@ struct kvm_get_htab_header {
 #define  KVM_XICS_PENDING		(1ULL << 42)
 
 /* SPAPR TCE IOMMU device specification */
-struct kvm_create_spapr_tce_iommu_linkage {
-	__u64 liobn;
-	__u32 fd;
-	__u32 flags;
-};
 #define KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE	0
 
 #endif /* __LINUX_KVM_POWERPC_H */
diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c
index 2880d2b..0978794 100644
--- a/arch/powerpc/kvm/book3s_64_vio.c
+++ b/arch/powerpc/kvm/book3s_64_vio.c
@@ -29,6 +29,8 @@
 #include <linux/anon_inodes.h>
 #include <linux/module.h>
 #include <linux/vfio.h>
+#include <linux/iommu.h>
+#include <linux/file.h>
 
 #include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
@@ -158,10 +160,8 @@ long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
 	int i;
 
 	/* Check this LIOBN hasn't been previously allocated */
-	list_for_each_entry(stt, &kvm->arch.spapr_tce_tables, list) {
-		if (stt->liobn == args->liobn)
-			return -EBUSY;
-	}
+	if (kvmppc_find_tce_table(kvm, args->liobn))
+		return -EBUSY;
 
 	npages = kvmppc_stt_npages(args->window_size);
 
@@ -201,9 +201,175 @@ fail:
 	return ret;
 }
 
-/* Converts guest physical address to host virtual address */
+static void kvmppc_spapr_tce_iommu_table_destroy(
+		struct kvm_device *dev,
+		struct kvmppc_spapr_tce_table *tt)
+{
+	struct kvm *kvm = dev->kvm;
+
+	mutex_lock(&kvm->lock);
+	list_del(&tt->list);
+
+	if (tt->vfio_grp)
+		kvmppc_vfio_group_put_external_user(tt->vfio_grp);
+	iommu_group_put(tt->grp);
+
+	kfree(tt);
+	mutex_unlock(&kvm->lock);
+}
+
+static int kvmppc_spapr_tce_iommu_create(struct kvm_device *dev, u32 type)
+{
+	struct kvmppc_spapr_tce_iommu_device *tcedev;
+	int ret = 0;
+
+	tcedev = kzalloc(sizeof(*tcedev), GFP_KERNEL);
+	if (!tcedev)
+		return -ENOMEM;
+	dev->private = tcedev;
+
+	INIT_LIST_HEAD(&tcedev->tables);
+
+	/* Already there ? */
+	mutex_lock(&dev->kvm->lock);
+	if (dev->kvm->arch.tcedev)
+		ret = -EEXIST;
+	else
+		dev->kvm->arch.tcedev = tcedev;
+	mutex_unlock(&dev->kvm->lock);
+
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
+static long kvmppc_spapr_tce_iommu_link(struct kvm_device *dev,
+		u64 liobn, u32 group_fd)
+{
+	struct kvmppc_spapr_tce_iommu_device *tcedev = dev->private;
+	struct kvmppc_spapr_tce_table *tt;
+	struct iommu_group *grp;
+	struct iommu_table *tbl;
+	struct file *vfio_filp;
+	struct vfio_group *vfio_grp;
+	int ret = -ENXIO, iommu_id;
+
+	/* Check this LIOBN hasn't been previously registered */
+	tt = kvmppc_find_tce_table(dev->kvm, liobn);
+	if (tt) {
+		if (group_fd)
+			return -EBUSY;
+
+		/* Release and exit */
+		kvmppc_spapr_tce_iommu_table_destroy(dev, tt);
+		return 0;
+	}
+
+	vfio_filp = fget(group_fd);
+	if (!vfio_filp)
+		return -ENXIO;
+
+	/*
+	 * Lock the group. Fails if group is not viable or
+	 * does not have IOMMU set
+	 */
+	vfio_grp = kvmppc_vfio_group_get_external_user(vfio_filp);
+	if (IS_ERR_VALUE((unsigned long)vfio_grp))
+		goto fput_exit;
+
+	/* Get IOMMU ID, find iommu_group and iommu_table*/
+	iommu_id = kvmppc_vfio_external_user_iommu_id(vfio_grp);
+	if (iommu_id < 0)
+		goto grpput_fput_exit;
+
+	grp = iommu_group_get_by_id(iommu_id);
+	if (!grp)
+		goto grpput_fput_exit;
+
+	tbl = iommu_group_get_iommudata(grp);
+	if (!tbl)
+		goto grpput_fput_exit;
+
+	/* Create a TCE table descriptor and add into the descriptor list */
+	tt = kzalloc(sizeof(*tt), GFP_KERNEL);
+	if (!tt)
+		goto grpput_fput_exit;
+
+	tt->liobn = liobn;
+	tt->grp = grp;
+	tt->window_size = tbl->it_size << IOMMU_PAGE_SHIFT;
+	tt->vfio_grp = vfio_grp;
+
+	/* Add the TCE table descriptor to the descriptor list */
+	mutex_lock(&dev->kvm->lock);
+	list_add(&tt->list, &tcedev->tables);
+	mutex_unlock(&dev->kvm->lock);
+
+	ret = 0;
+
+	goto fput_exit;
+
+grpput_fput_exit:
+	kvmppc_vfio_group_put_external_user(vfio_grp);
+fput_exit:
+	fput(vfio_filp);
+
+	return ret;
+}
+
+static int kvmppc_spapr_tce_iommu_set_attr(struct kvm_device *dev,
+		struct kvm_device_attr *attr)
+{
+	u32 group_fd;
+	u32 __user *argp = (u32 __user *) attr->addr;
+
+	switch (attr->group) {
+	case KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE:
+		if (get_user(group_fd, argp))
+			return -EFAULT;
+
+		return kvmppc_spapr_tce_iommu_link(dev, attr->attr, group_fd);
+	}
+	return -ENXIO;
+}
+
+static int kvmppc_spapr_tce_iommu_has_attr(struct kvm_device *dev,
+		struct kvm_device_attr *attr)
+{
+	switch (attr->group) {
+	case KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE:
+		return 0;
+	}
+	return -ENXIO;
+}
+
+static void kvmppc_spapr_tce_iommu_destroy(struct kvm_device *dev)
+{
+	struct kvmppc_spapr_tce_iommu_device *tcedev = dev->private;
+	struct kvmppc_spapr_tce_table *tt, *tmp;
+
+	list_for_each_entry_safe(tt, tmp, &tcedev->tables, list) {
+		kvmppc_spapr_tce_iommu_table_destroy(dev, tt);
+	}
+	kfree(tcedev);
+	kfree(dev);
+}
+
+struct kvm_device_ops kvmppc_spapr_tce_iommu_ops = {
+	.name = "kvm-spapr-tce-iommu",
+	.create = kvmppc_spapr_tce_iommu_create,
+	.set_attr = kvmppc_spapr_tce_iommu_set_attr,
+	.has_attr = kvmppc_spapr_tce_iommu_has_attr,
+	.destroy = kvmppc_spapr_tce_iommu_destroy,
+};
+
+/*
+ * Converts guest physical address to host virtual address.
+ * Also returns host physical address which is to put to TCE table.
+ */
 static void __user *kvmppc_gpa_to_hva_and_get(struct kvm_vcpu *vcpu,
-		unsigned long gpa, struct page **pg)
+		unsigned long gpa, struct page **pg, unsigned long *phpa)
 {
 	unsigned long hva, gfn = gpa >> PAGE_SHIFT;
 	struct kvm_memory_slot *memslot;
@@ -218,9 +384,140 @@ static void __user *kvmppc_gpa_to_hva_and_get(struct kvm_vcpu *vcpu,
 	if (get_user_pages_fast(hva & PAGE_MASK, 1, is_write, pg) != 1)
 		return ERROR_ADDR;
 
+	if (phpa)
+		*phpa = __pa((unsigned long) page_address(*pg)) |
+				(hva & ~PAGE_MASK);
+
 	return (void *) hva;
 }
 
+long kvmppc_h_put_tce_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt,
+		unsigned long liobn, unsigned long ioba,
+		unsigned long tce)
+{
+	struct page *pg = NULL;
+	unsigned long hpa;
+	void __user *hva;
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	/* Clear TCE */
+	if (!(tce & (TCE_PCI_READ | TCE_PCI_WRITE))) {
+		if (iommu_tce_clear_param_check(tbl, ioba, 0, 1))
+			return H_PARAMETER;
+
+		if (iommu_free_tces(tbl, ioba >> IOMMU_PAGE_SHIFT,
+				1, false))
+			return H_HARDWARE;
+
+		return H_SUCCESS;
+	}
+
+	/* Put TCE */
+	if (vcpu->arch.tce_rm_fail != TCERM_NONE) {
+		/* Retry iommu_tce_build if it failed in real mode */
+		vcpu->arch.tce_rm_fail = TCERM_NONE;
+		hpa = vcpu->arch.tce_tmp_hpas[0];
+	} else {
+		if (iommu_tce_put_param_check(tbl, ioba, tce))
+			return H_PARAMETER;
+
+		hva = kvmppc_gpa_to_hva_and_get(vcpu, tce, &pg, &hpa);
+		if (hva == ERROR_ADDR)
+			return H_HARDWARE;
+	}
+
+	if (!iommu_tce_build(tbl, ioba >> IOMMU_PAGE_SHIFT, &hpa, 1, false))
+		return H_SUCCESS;
+
+	pg = pfn_to_page(hpa >> PAGE_SHIFT);
+	if (pg)
+		put_page(pg);
+
+	return H_HARDWARE;
+}
+
+static long kvmppc_h_put_tce_indirect_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt, unsigned long ioba,
+		unsigned long __user *tces, unsigned long npages)
+{
+	long i = 0, start = 0;
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	switch (vcpu->arch.tce_rm_fail) {
+	case TCERM_NONE:
+		break;
+	case TCERM_GETPAGE:
+		start = vcpu->arch.tce_tmp_num;
+		break;
+	case TCERM_PUTTCE:
+		goto put_tces;
+	case TCERM_PUTLIST:
+	default:
+		WARN_ON(1);
+		return H_HARDWARE;
+	}
+
+	for (i = start; i < npages; ++i) {
+		struct page *pg = NULL;
+		unsigned long gpa;
+		void __user *hva;
+
+		if (get_user(gpa, tces + i))
+			return H_HARDWARE;
+
+		if (iommu_tce_put_param_check(tbl, ioba +
+					(i << IOMMU_PAGE_SHIFT), gpa))
+			return H_PARAMETER;
+
+		hva = kvmppc_gpa_to_hva_and_get(vcpu, gpa, &pg,
+				&vcpu->arch.tce_tmp_hpas[i]);
+		if (hva == ERROR_ADDR)
+			goto putpages_flush_exit;
+	}
+
+put_tces:
+	if (!iommu_tce_build(tbl, ioba >> IOMMU_PAGE_SHIFT,
+			vcpu->arch.tce_tmp_hpas, npages, false))
+		return H_SUCCESS;
+
+putpages_flush_exit:
+	for (--i; i >= 0; --i) {
+		struct page *pg;
+		pg = pfn_to_page(vcpu->arch.tce_tmp_hpas[i] >> PAGE_SHIFT);
+		if (pg)
+			put_page(pg);
+	}
+
+	return H_HARDWARE;
+}
+
+long kvmppc_h_stuff_tce_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt,
+		unsigned long liobn, unsigned long ioba,
+		unsigned long tce_value, unsigned long npages)
+{
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+	unsigned long entry = ioba >> IOMMU_PAGE_SHIFT;
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	if (iommu_tce_clear_param_check(tbl, ioba, tce_value, npages))
+		return H_PARAMETER;
+
+	if (iommu_free_tces(tbl, entry, npages, false))
+		return H_HARDWARE;
+
+	return H_SUCCESS;
+}
+
 long kvmppc_h_put_tce(struct kvm_vcpu *vcpu,
 		unsigned long liobn, unsigned long ioba,
 		unsigned long tce)
@@ -232,6 +529,10 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu,
 	if (!tt)
 		return H_TOO_HARD;
 
+	if (tt->grp)
+		return kvmppc_h_put_tce_iommu(vcpu, tt, liobn, ioba, tce);
+
+	/* Emulated IO */
 	if (ioba >= tt->window_size)
 		return H_PARAMETER;
 
@@ -270,13 +571,20 @@ long kvmppc_h_put_tce_indirect(struct kvm_vcpu *vcpu,
 	if ((ioba + (npages << IOMMU_PAGE_SHIFT)) > tt->window_size)
 		return H_PARAMETER;
 
-	tces = kvmppc_gpa_to_hva_and_get(vcpu, tce_list, &pg);
+	tces = kvmppc_gpa_to_hva_and_get(vcpu, tce_list, &pg, NULL);
 	if (tces == ERROR_ADDR)
 		return H_TOO_HARD;
 
 	if (vcpu->arch.tce_rm_fail == TCERM_PUTLIST)
 		goto put_list_page_exit;
 
+	if (tt->grp) {
+		ret = kvmppc_h_put_tce_indirect_iommu(vcpu,
+			tt, ioba, tces, npages);
+		goto put_list_page_exit;
+	}
+
+	/* Emulated IO */
 	for (i = 0; i < npages; ++i) {
 		if (get_user(vcpu->arch.tce_tmp_hpas[i], tces + i)) {
 			ret = H_PARAMETER;
@@ -315,6 +623,11 @@ long kvmppc_h_stuff_tce(struct kvm_vcpu *vcpu,
 	if (!tt)
 		return H_TOO_HARD;
 
+	if (tt->grp)
+		return kvmppc_h_stuff_tce_iommu(vcpu, tt, liobn, ioba,
+				tce_value, npages);
+
+	/* Emulated IO */
 	if ((ioba + (npages << IOMMU_PAGE_SHIFT)) > tt->window_size)
 		return H_PARAMETER;
 
diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c
index f00fcd2..fc872f2 100644
--- a/arch/powerpc/kvm/book3s_64_vio_hv.c
+++ b/arch/powerpc/kvm/book3s_64_vio_hv.c
@@ -26,6 +26,7 @@
 #include <linux/slab.h>
 #include <linux/hugetlb.h>
 #include <linux/list.h>
+#include <linux/iommu.h>
 
 #include <asm/tlbflush.h>
 #include <asm/kvm_ppc.h>
@@ -47,11 +48,31 @@
  * WARNING: This will be called in real or virtual mode on HV KVM and virtual
  *          mode on PR KVM
  */
+static struct kvmppc_spapr_tce_table *kvmppc_find_iommu_tce_table(
+		struct kvm *kvm, unsigned long liobn)
+{
+	struct kvmppc_spapr_tce_table *tt;
+	struct kvmppc_spapr_tce_iommu_device *tcedev = kvm->arch.tcedev;
+
+	if (tcedev) {
+		list_for_each_entry(tt, &tcedev->tables, list) {
+			if (tt->liobn == liobn)
+				return tt;
+		}
+	}
+
+	return NULL;
+}
+
 struct kvmppc_spapr_tce_table *kvmppc_find_tce_table(struct kvm *kvm,
 		unsigned long liobn)
 {
 	struct kvmppc_spapr_tce_table *tt;
 
+	tt = kvmppc_find_iommu_tce_table(kvm, liobn);
+	if (tt)
+		return tt;
+
 	list_for_each_entry(tt, &kvm->arch.spapr_tce_tables, list) {
 		if (tt->liobn == liobn)
 			return tt;
@@ -191,6 +212,111 @@ static unsigned long kvmppc_rm_gpa_to_hpa_and_get(struct kvm_vcpu *vcpu,
 	return hpa;
 }
 
+static long kvmppc_rm_h_put_tce_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt, unsigned long liobn,
+		unsigned long ioba, unsigned long tce)
+{
+	int ret = 0;
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+	unsigned long hpa;
+	struct page *pg = NULL;
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	/* Clear TCE */
+	if (!(tce & (TCE_PCI_READ | TCE_PCI_WRITE))) {
+		if (iommu_tce_clear_param_check(tbl, ioba, 0, 1))
+			return H_PARAMETER;
+
+		if (iommu_free_tces(tbl, ioba >> IOMMU_PAGE_SHIFT, 1, true))
+			return H_TOO_HARD;
+
+		return H_SUCCESS;
+	}
+
+	/* Put TCE */
+	if (iommu_tce_put_param_check(tbl, ioba, tce))
+		return H_PARAMETER;
+
+	hpa = kvmppc_rm_gpa_to_hpa_and_get(vcpu, tce, &pg);
+	if (hpa != ERROR_ADDR) {
+		ret = iommu_tce_build(tbl, ioba >> IOMMU_PAGE_SHIFT,
+				&hpa, 1, true);
+	}
+
+	if (((hpa == ERROR_ADDR) && pg) || ret) {
+		vcpu->arch.tce_tmp_hpas[0] = hpa;
+		vcpu->arch.tce_tmp_num = 0;
+		vcpu->arch.tce_rm_fail = TCERM_PUTTCE;
+		return H_TOO_HARD;
+	}
+
+	return H_SUCCESS;
+}
+
+static long kvmppc_rm_h_put_tce_indirect_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt, unsigned long ioba,
+		unsigned long *tces, unsigned long npages)
+{
+	int i, ret;
+	unsigned long hpa;
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+	struct page *pg = NULL;
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	/* Check all TCEs */
+	for (i = 0; i < npages; ++i) {
+		if (iommu_tce_put_param_check(tbl, ioba +
+				(i << IOMMU_PAGE_SHIFT), tces[i]))
+			return H_PARAMETER;
+	}
+
+	/* Translate TCEs and go get_page() */
+	for (i = 0; i < npages; ++i) {
+		hpa = kvmppc_rm_gpa_to_hpa_and_get(vcpu, tces[i], &pg);
+		if (hpa == ERROR_ADDR) {
+			vcpu->arch.tce_tmp_num = i;
+			vcpu->arch.tce_rm_fail = TCERM_GETPAGE;
+			return H_TOO_HARD;
+		}
+		vcpu->arch.tce_tmp_hpas[i] = hpa;
+	}
+
+	/* Put TCEs to the table */
+	ret = iommu_tce_build(tbl, (ioba >> IOMMU_PAGE_SHIFT),
+			vcpu->arch.tce_tmp_hpas, npages, true);
+	if (ret == -EAGAIN) {
+		vcpu->arch.tce_rm_fail = TCERM_PUTTCE;
+		return H_TOO_HARD;
+	} else if (ret) {
+		return H_HARDWARE;
+	}
+
+	return H_SUCCESS;
+}
+
+static long kvmppc_rm_h_stuff_tce_iommu(struct kvm_vcpu *vcpu,
+		struct kvmppc_spapr_tce_table *tt,
+		unsigned long liobn, unsigned long ioba,
+		unsigned long tce_value, unsigned long npages)
+{
+	struct iommu_table *tbl = iommu_group_get_iommudata(tt->grp);
+
+	if (!tbl)
+		return H_RESCINDED;
+
+	if (iommu_tce_clear_param_check(tbl, ioba, tce_value, npages))
+		return H_PARAMETER;
+
+	if (iommu_free_tces(tbl, ioba >> IOMMU_PAGE_SHIFT, npages, true))
+		return H_TOO_HARD;
+
+	return H_SUCCESS;
+}
+
 long kvmppc_rm_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
 		      unsigned long ioba, unsigned long tce)
 {
@@ -201,6 +327,10 @@ long kvmppc_rm_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
 	if (!tt)
 		return H_TOO_HARD;
 
+	if (tt->grp)
+		return kvmppc_rm_h_put_tce_iommu(vcpu, tt, liobn, ioba, tce);
+
+	/* Emulated IO */
 	if (ioba >= tt->window_size)
 		return H_PARAMETER;
 
@@ -243,6 +373,13 @@ long kvmppc_rm_h_put_tce_indirect(struct kvm_vcpu *vcpu,
 		goto put_unlock_exit;
 	}
 
+	if (tt->grp) {
+		ret = kvmppc_rm_h_put_tce_indirect_iommu(vcpu,
+			tt, ioba, (unsigned long *)tces, npages);
+		goto put_unlock_exit;
+	}
+
+	/* Emulated IO */
 	for (i = 0; i < npages; ++i) {
 		ret = kvmppc_tce_validate(((unsigned long *)tces)[i]);
 		if (ret)
@@ -273,6 +410,11 @@ long kvmppc_rm_h_stuff_tce(struct kvm_vcpu *vcpu,
 	if (!tt)
 		return H_TOO_HARD;
 
+	if (tt->grp)
+		return kvmppc_rm_h_stuff_tce_iommu(vcpu, tt, liobn, ioba,
+				tce_value, npages);
+
+	/* Emulated IO */
 	if ((ioba + (npages << IOMMU_PAGE_SHIFT)) > tt->window_size)
 		return H_PARAMETER;
 
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index ccb578b..ea9af59 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -395,6 +395,7 @@ int kvm_dev_ioctl_check_extension(long ext)
 		r = 1;
 		break;
 	case KVM_CAP_SPAPR_MULTITCE:
+	case KVM_CAP_SPAPR_TCE_IOMMU:
 		r = 1;
 		break;
 #endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 7a8c1b3..016df11 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1053,6 +1053,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp);
 
 extern struct kvm_device_ops kvm_mpic_ops;
 extern struct kvm_device_ops kvm_xics_ops;
+extern struct kvm_device_ops kvmppc_spapr_tce_iommu_ops;
 
 #ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
 
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 1580dd4..34c3c22 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2282,6 +2282,11 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
 		ops = &kvm_xics_ops;
 		break;
 #endif
+#ifdef CONFIG_SPAPR_TCE_IOMMU
+	case KVM_DEV_TYPE_SPAPR_TCE_IOMMU:
+		ops = &kvmppc_spapr_tce_iommu_ops;
+		break;
+#endif
 	default:
 		return -ENODEV;
 	}
-- 
1.8.4.rc4

^ permalink raw reply related

* [PATCH v3 2/8] ppc/cell: use get_unused_fd_flags(0) instead of get_unused_fd()
From: Yann Droneaud @ 2013-09-06 10:39 UTC (permalink / raw)
  To: linux-kernel, Jeremy Kerr, Arnd Bergmann, Benjamin Herrenschmidt,
	Paul Mackerras
  Cc: cbe-oss-dev, Yann Droneaud, linuxppc-dev
In-Reply-To: <cover.1378460926.git.ydroneaud@opteya.com>

Macro get_unused_fd() is used to allocate a file descriptor with
default flags. Those default flags (0) can be "unsafe":
O_CLOEXEC must be used by default to not leak file descriptor
across exec().

Instead of macro get_unused_fd(), functions anon_inode_getfd()
or get_unused_fd_flags() should be used with flags given by userspace.
If not possible, flags should be set to O_CLOEXEC to provide userspace
with a default safe behavor.

In a further patch, get_unused_fd() will be removed so that
new code start using anon_inode_getfd() or get_unused_fd_flags()
with correct flags.

This patch replaces calls to get_unused_fd() with equivalent call to
get_unused_fd_flags(0) to preserve current behavor for existing code.

The hard coded flag value (0) should be reviewed on a per-subsystem basis,
and, if possible, set to O_CLOEXEC.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Link: http://lkml.kernel.org/r/cover.1378460926.git.ydroneaud@opteya.com
---
 arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 87ba7cf..51effce 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -301,7 +301,7 @@ static int spufs_context_open(struct path *path)
 	int ret;
 	struct file *filp;
 
-	ret = get_unused_fd();
+	ret = get_unused_fd_flags(0);
 	if (ret < 0)
 		return ret;
 
@@ -518,7 +518,7 @@ static int spufs_gang_open(struct path *path)
 	int ret;
 	struct file *filp;
 
-	ret = get_unused_fd();
+	ret = get_unused_fd_flags(0);
 	if (ret < 0)
 		return ret;
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v3 0/8] Getting rid of get_unused_fd() / use O_CLOEXEC
From: Yann Droneaud @ 2013-09-06 10:39 UTC (permalink / raw)
  To: linux-kernel, Tony Luck, Fenghua Yu, Al Viro, linux-ia64,
	Jeremy Kerr, Arnd Bergmann, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, cbe-oss-dev, linux-fsdevel,
	Eric Paris, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Jonathan Cameron, linux-iio
  Cc: Yann Droneaud

Hi,

With help from subsystem maintainers, I've managed to get some of
get_unused_fd() calls converted to use get_unused_fd_flags(O_CLOEXEC)
instead. [ANDROID][IB][VFIO]

KVM subsystem maintainers helped me to change calls to anon_inode_getfd()
to use O_CLOEXEC by default. [KVM]

Some maintainers applied my patches to convert get_unused_fd() to
get_unused_fd_flags(0) were using O_CLOEXEC wasn't possible without breaking ABI.
[SCTP][XFS]

So, still in the hope to get rid of get_unused_fd(), please find a another
attempt to remove get_unused_fd() macro and encourage subsystems to use
get_unused_fd_flags(O_CLOEXEC) or anon_inode_getfd(O_CLOEXEC) by default
were appropriate.

The patchset convert all calls to get_unused_fd()
to get_unused_fd_flags(0) before removing get_unused_fd() macro.

Without get_unused_fd() macro, more subsystems are likely to use
anon_inode_getfd() and be teached to provide an API that let userspace
choose the opening flags of the file descriptor.

Additionally I'm suggesting Industrial IO (IIO) subsystem to use
anon_inode_getfd(O_CLOEXEC): it's the only subsystem using anon_inode_getfd()
with a fixed set of flags not including O_CLOEXEC.

Not using O_CLOEXEC by default or not letting userspace provide the "open" flags
should be considered bad practice from security point of view:
in most case O_CLOEXEC must be used to not leak file descriptor across exec().
Using O_CLOEXEC by default when flags are not provided by userspace allows it
to choose, without race, if the file descriptor is going to be inherited
across exec().

Status:

In linux-next tag 20130906, they're currently:

- 22 calls to get_unused_fd_flags()     (+3)
     not counting get_unused_fd() and anon_inode_getfd()
-  7 calls to get_unused_fd()           (-3)
- 11 calls to anon_inode_getfd()        (0)

Changes from patchset v2 [PATCHSETv2]:

- android/sw_sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()
  DROPPED: applied upstream

- android/sync: use get_unused_fd_flags(O_CLOEXEC) instead of get_unused_fd()
  DROPPED: applied upstream

- vfio: use get_unused_fd_flags(0) instead of get_unused_fd()
  DROPPED: applied upstream.
  Additionally subsystem maintainer applied another patch on top
  to set the flags to O_CLOEXEC.

- industrialio: use anon_inode_getfd() with O_CLOEXEC flag
  NEW: propose to use O_CLOEXEC as default flag.

Links:

[ANDROID]
  http://lkml.kernel.org/r/CACSP8SjXGMk2_kX_+RgzqqQwqKernvF1Wt3K5tw991W5dfAnCA@mail.gmail.com
  http://lkml.kernel.org/r/CACSP8SjZcpcpEtQHzcGYhf-MP7QGo0XpN7-uN7rmD=vNtopG=w@mail.gmail.com

[IB]
  http://lkml.kernel.org/r/CAL1RGDXV1_BjSLrQDFdVQ1_D75+bMtOtikHOUp8VBiy_OJUf=w@mail.gmail.com

[VFIO]
  http://lkml.kernel.org/r/20130822171744.1297.13711.stgit@bling.home

[KVM]
  http://lkml.kernel.org/r/5219A8FC.8090307@redhat.com
  http://lkml.kernel.org/r/3557EF65-4327-4DAE-999A-B0EE13C433F5@suse.de
  http://lkml.kernel.org/r/20130826102023.GA8218@redhat.com

[SCTP]
  http://lkml.kernel.org/r/51D312E8.6090702@gmail.com
  http://lkml.kernel.org/r/20130702.161428.1703028286206350504.davem@davemloft.net

[XFS]
  http://lkml.kernel.org/r/20130709205321.GV20932@sgi.com

[PATCHSETv2]
  http://lkml.kernel.org/r/cover.1376327678.git.ydroneaud@opteya.com

Yann Droneaud (8):
  ia64: use get_unused_fd_flags(0) instead of get_unused_fd()
  ppc/cell: use get_unused_fd_flags(0) instead of get_unused_fd()
  binfmt_misc: use get_unused_fd_flags(0) instead of get_unused_fd()
  file: use get_unused_fd_flags(0) instead of get_unused_fd()
  fanotify: use get_unused_fd_flags(0) instead of get_unused_fd()
  events: use get_unused_fd_flags(0) instead of get_unused_fd()
  file: remove get_unused_fd()
  industrialio: use anon_inode_getfd() with O_CLOEXEC flag

 arch/ia64/kernel/perfmon.c                | 2 +-
 arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
 drivers/iio/industrialio-event.c          | 2 +-
 fs/binfmt_misc.c                          | 2 +-
 fs/file.c                                 | 2 +-
 fs/notify/fanotify/fanotify_user.c        | 2 +-
 include/linux/file.h                      | 1 -
 kernel/events/core.c                      | 2 +-
 8 files changed, 8 insertions(+), 9 deletions(-)

-- 
1.8.3.1

^ permalink raw reply

* RE: [PATCH V3 2/2] powerpc/85xx: Add TWR-P1025 board support
From: Xie Xiaobo-R63061 @ 2013-09-06 10:01 UTC (permalink / raw)
  To: Wood Scott-B07421; +Cc: Johnston Michael-R49610, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1378311953.12204.20.camel@snotra.buserror.net>

SGkgU2NvdHQsDQoNClRoYW5rcyBmb3IgeW91ciByZW1pbmRpbmcgYW5kIGFkdmljZS4NCg0KSSBk
aXNjdXNzIHRoaXMgd2l0aCBMaXUgU2hlbmd6aG91KHRoZSBmaXJzdCBwZXJzb24gdGhhdCByZW1p
bmQgbWUgI2ludGVycnVwdC1jZWxscyBpcyA0KSwgaGUgYWR2aXNlZCByZW1vdmluZyB0aGUgaW50
ZXJydXB0cyBwcm9wZXJ0eSBmcm9tIHRoZSBwaHkgbm9kZSwgYmVjYXVzZSB0aGUgbWRpbyB1c2Vk
IHRoZSBwb2xsIHdheSBwcmVmZXJlbnRpYWxseS4NCg0KQmVzdCBSZWdhcmRzDQpYaWUgWGlhb2Jv
DQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBXb29kIFNjb3R0LUIwNzQyMSAN
ClNlbnQ6IFRodXJzZGF5LCBTZXB0ZW1iZXIgMDUsIDIwMTMgMTI6MjYgQU0NClRvOiBYaWUgWGlh
b2JvLVI2MzA2MQ0KQ2M6IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnOyBnYWxha0BrZXJu
ZWwuY3Jhc2hpbmcub3JnOyBKb2huc3RvbiBNaWNoYWVsLVI0OTYxMA0KU3ViamVjdDogUmU6IFtQ
QVRDSCBWMyAyLzJdIHBvd2VycGMvODV4eDogQWRkIFRXUi1QMTAyNSBib2FyZCBzdXBwb3J0DQoN
Ck9uIE1vbiwgMjAxMy0wOS0wMiBhdCAxODoxMSArMDgwMCwgWGllIFhpYW9ibyB3cm90ZToNCj4g
KyZzb2Mgew0KPiArCXVzYkAyMjAwMCB7DQo+ICsJCXBoeV90eXBlID0gInVscGkiOw0KPiArCX07
DQo+ICsNCj4gKwltZGlvQDI0MDAwIHsNCj4gKwkJcGh5MDogZXRoZXJuZXQtcGh5QDIgew0KPiAr
CQkJaW50ZXJydXB0LXBhcmVudCA9IDwmbXBpYz47DQo+ICsJCQlpbnRlcnJ1cHRzID0gPDEgMT47
DQo+ICsJCQlyZWcgPSA8MHgyPjsNCj4gKwkJfTsNCj4gKw0KPiArCQlwaHkxOiBldGhlcm5ldC1w
aHlAMSB7DQo+ICsJCQlpbnRlcnJ1cHQtcGFyZW50ID0gPCZtcGljPjsNCj4gKwkJCWludGVycnVw
dHMgPSA8MiAxPjsNCj4gKwkJCXJlZyA9IDwweDE+Ow0KPiArCQl9Ow0KDQpBZ2FpbiwgI2ludGVy
cnVwdC1jZWxscyBpcyA0Lg0KDQpQbGVhc2UgcmVzcG9uZCB0byBmZWVkYmFjayByYXRoZXIgdGhh
biBpZ25vcmluZyBpdCBhbmQgcmVwb3N0aW5nIHRoZSBzYW1lIHRoaW5nIHdpdGhvdXQgY29tbWVu
dC4NCg0KLVNjb3R0DQoNCg0K

^ permalink raw reply

* RE: [PATCH V3 1/2] powerpc/85xx: Add QE common init functions
From: Xie Xiaobo-R63061 @ 2013-09-06  9:52 UTC (permalink / raw)
  To: Wood Scott-B07421; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1378312019.12204.21.camel@snotra.buserror.net>

SGkgU2NvdHQsDQoNCkkgYWxyZWFkeSByZW1vdmUgdGhlc2UgY29kZSBmcm9tIHRoZSBQMTAyNVRX
UiBwbGF0Zm9ybSBmaWxlKHNlZSB0aGUgMi8yIHBhdGNoKS4gRG8geW91IG1lYW5zIEkgYWxzbyBu
ZWVkIHRvIHJlbW92ZSB0aGVzZSBjb2RlcyBmcm9tIHRoZSBvdGhlcnMgcGxhdGZvcm1zIGFuZCB1
c2UgdGhlIGNvbW1vbiBjYWxsIGluc3RlYWQ/IA0KVGhhbmsgeW91Lg0KDQpCZXN0IFJlZ2FyZHMN
ClhpZSBYaWFvYm8NCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBXb29kIFNjb3R0
LUIwNzQyMSANClNlbnQ6IFRodXJzZGF5LCBTZXB0ZW1iZXIgMDUsIDIwMTMgMTI6MjcgQU0NClRv
OiBYaWUgWGlhb2JvLVI2MzA2MQ0KQ2M6IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnOyBn
YWxha0BrZXJuZWwuY3Jhc2hpbmcub3JnDQpTdWJqZWN0OiBSZTogW1BBVENIIFYzIDEvMl0gcG93
ZXJwYy84NXh4OiBBZGQgUUUgY29tbW9uIGluaXQgZnVuY3Rpb25zDQoNCk9uIE1vbiwgMjAxMy0w
OS0wMiBhdCAxODoxMSArMDgwMCwgWGllIFhpYW9ibyB3cm90ZToNCj4gRGVmaW5lIHR3byBRRSBp
bml0IGZ1bmN0aW9ucyBpbiBjb21tb24gZmlsZSwgYW5kIGF2b2lkIHRoZSBzYW1lIGNvZGVzIA0K
PiBiZWluZyBkdXBsaWNhdGVkIGluIGJvYXJkIGZpbGVzLg0KPiANCj4gU2lnbmVkLW9mZi1ieTog
WGllIFhpYW9ibyA8WC5YaWVAZnJlZXNjYWxlLmNvbT4NCj4gLS0tDQo+IFYzIC0+IFYyOiBOb2No
YW5nZQ0KPiANCj4gIGFyY2gvcG93ZXJwYy9wbGF0Zm9ybXMvODV4eC9jb21tb24uYyAgfCA0NyAN
Cj4gKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysNCj4gIGFyY2gvcG93ZXJwYy9w
bGF0Zm9ybXMvODV4eC9tcGM4NXh4LmggfCAgOCArKysrKysNCj4gIDIgZmlsZXMgY2hhbmdlZCwg
NTUgaW5zZXJ0aW9ucygrKQ0KDQpEb24ndCBqdXN0IGNvcHkgaXQ7IHJlbW92ZSBpdCBmcm9tIHRo
ZSBwbGFjZSB5b3UgY29waWVkIGZyb20gYW5kIGhhdmUgdGhhdCBjb2RlIGNhbGwgdGhlIGNvbW1v
biB2ZXJzaW9uLg0KDQotU2NvdHQNCg0KDQo=

^ permalink raw reply

* [PATCH] Add a vga alias node for P1022
From: Jason Jin @ 2013-09-06  9:32 UTC (permalink / raw)
  To: scottwood; +Cc: linuxppc-dev, Jason Jin

From: Jason Jin <Jason.jin@freescale.com>

When the vga was set as the stdout and stderr in u-boot, the stdout fixup
code in u-boot need to find out the vga alias node in dtb.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
---
 arch/powerpc/boot/dts/fsl/p1022si-post.dtsi | 2 +-
 arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi
index 1f189a9..c907c8e 100644
--- a/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1022si-post.dtsi
@@ -175,7 +175,7 @@
 
 /include/ "pq3-gpio-0.dtsi"
 
-	display@10000 {
+	display: display@10000 {
 		compatible = "fsl,diu", "fsl,p1022-diu";
 		reg = <0x10000 1000>;
 		interrupts = <64 2 0 0>;
diff --git a/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi
index 1956dea..cb8d816 100644
--- a/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi
@@ -50,6 +50,7 @@
 		pci0 = &pci0;
 		pci1 = &pci1;
 		pci2 = &pci2;
+		vga = &display;
 	};
 
 	cpus {
-- 
1.8.0

^ permalink raw reply related

* [PATCH] powerpc/corenet/config: add missing SCSI configs for corenet64_smp_defconfig
From: Shaohui Xie @ 2013-09-06  8:52 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: scottwood, Shaohui Xie

Otherwise there will be no SCSI device nodes.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 arch/powerpc/configs/corenet64_smp_defconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 6c8b020..53058cb 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -92,6 +92,13 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=131072
 CONFIG_EEPROM_LEGACY=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=y
+CONFIG_BLK_DEV_SR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SPI_ATTRS=y
 CONFIG_ATA=y
 CONFIG_SATA_FSL=y
 CONFIG_SATA_SIL24=y
-- 
1.8.0

^ permalink raw reply related

* [PATCH] powerpc/85xx: DTS - re-organize the SPI partitions property
From: Mingkai Hu @ 2013-09-06  8:05 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: scottwood, Mingkai Hu

Re-organize the SPI partitions and use the same SPI flash memory
map for most of the platforms which have 16MB SPI flash mounted.

1. Extend the U-Boot partition to 1MB
   The image for booting from SPI is larger than 512KB, while
   the size of U-Boot partition is 512KB on some boards, so
   enlarge it to 1MB in order to contain the whole U-Boot image.

2. Reserve space for U-Boot environment variables
   The environment variables are stored at offset 0x100000, so
   if other image was put at this address, it'll be overlapped
   when saving the environment variables.

3. Reserve space for FMAN ucode
   The FMAN ucode is required on DPAA platform and is stored at
   offset 0x110000, this address should not be used to store any
   other images.

4. Extend the kernel partition to 5MB

Here is diagram for the SPI flash memory map:

        0x000000 |-------------|
                 | U-Boot      |
                 | (1MB)       |
        0x100000 |-------------|
                 | Env(64KB)   |
        0x110000 |-------------|
                 | ucode       |
        0x180000 |-------------|
                 | DTB         |
                 | (512KB)     |
        0x200000 |-------------|
                 | kernel      |
                 | (5MB)       |
        0x700000 |-------------|
                 | file system |
                 | (9MB)       |
       0x1000000 |-------------|

Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
---

Based on 'next' branch on git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git

 arch/powerpc/boot/dts/bsc9131rdb.dtsi  | 35 ++++++++++++-----------------
 arch/powerpc/boot/dts/c293pcie.dts     | 35 ++++++++++++-----------------
 arch/powerpc/boot/dts/mpc8536ds.dtsi   | 12 +++++-----
 arch/powerpc/boot/dts/p1010rdb.dtsi    | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p1020rdb-pc.dtsi | 24 +++++---------------
 arch/powerpc/boot/dts/p1020rdb-pd.dts  | 34 ++++++++++++-----------------
 arch/powerpc/boot/dts/p1020rdb.dtsi    | 23 ++++---------------
 arch/powerpc/boot/dts/p1021mds.dts     | 17 +++++++--------
 arch/powerpc/boot/dts/p1021rdb-pc.dtsi | 32 +++++++++------------------
 arch/powerpc/boot/dts/p1022ds.dtsi     | 21 +++++++++---------
 arch/powerpc/boot/dts/p1023rds.dts     | 10 ++-------
 arch/powerpc/boot/dts/p1024rdb.dtsi    | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p1025rdb.dtsi    | 23 +++++--------------
 arch/powerpc/boot/dts/p2020rdb-pc.dtsi | 40 ++++++++++++----------------------
 arch/powerpc/boot/dts/p2020rdb.dts     | 38 ++++++++++----------------------
 arch/powerpc/boot/dts/p2041rdb.dts     | 12 +++++-----
 arch/powerpc/boot/dts/p3041ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p4080ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p5020ds.dts      | 12 +++++-----
 arch/powerpc/boot/dts/p5040ds.dts      | 13 ++++++-----
 20 files changed, 180 insertions(+), 305 deletions(-)

diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dtsi b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
index 9e6c013..8250593 100644
--- a/arch/powerpc/boot/dts/bsc9131rdb.dtsi
+++ b/arch/powerpc/boot/dts/bsc9131rdb.dtsi
@@ -81,32 +81,25 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <50000000>;
-
-			/* 512KB for u-boot Bootloader Image */
-			partition@0 {
-				reg = <0x0 0x00080000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			/* 512KB for DTB Image */
-			partition@80000 {
-				reg = <0x00080000 0x00080000>;
-				label = "SPI Flash DTB Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			/* 4MB for Linux Kernel Image */
-			partition@100000 {
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Flash Kernel Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			/*11MB for RFS Image */
-			partition@500000 {
-				reg = <0x00500000 0x00B00000>;
-				label = "SPI Flash RFS Image";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
-
 		};
 	};
 
diff --git a/arch/powerpc/boot/dts/c293pcie.dts b/arch/powerpc/boot/dts/c293pcie.dts
index 1238bda..8ee8459 100644
--- a/arch/powerpc/boot/dts/c293pcie.dts
+++ b/arch/powerpc/boot/dts/c293pcie.dts
@@ -169,31 +169,24 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <50000000>;
-
-			partition@0 {
-				/* 1MB for u-boot Bootloader Image */
-				/* 1MB for Environment */
-				reg = <0x0 0x00100000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@100000 {
-				/* 512KB for DTB Image */
-				reg = <0x00100000 0x00080000>;
-				label = "SPI Flash DTB Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@180000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00180000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@580000 {
-				/* 10.5MB for RFS Image */
-				reg = <0x00580000 0x00a80000>;
-				label = "SPI Flash RFS Image";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dtsi b/arch/powerpc/boot/dts/mpc8536ds.dtsi
index 7c3dde8..daa3de4 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dtsi
+++ b/arch/powerpc/boot/dts/mpc8536ds.dtsi
@@ -150,14 +150,14 @@
 				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-			partition@kernel {
-				label = "kernel";
-				reg = <0x00100000 0x00500000>;
-				read-only;
-			};
 			partition@dtb {
 				label = "dtb";
-				reg = <0x00600000 0x00100000>;
+				reg = <0x00180000 0x00080000>;
+				read-only;
+			};
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
 			partition@fs {
diff --git a/arch/powerpc/boot/dts/p1010rdb.dtsi b/arch/powerpc/boot/dts/p1010rdb.dtsi
index ec7c27a..e67db57 100644
--- a/arch/powerpc/boot/dts/p1010rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1010rdb.dtsi
@@ -152,36 +152,24 @@
 			reg = <0>;
 			spi-max-frequency = <40000000>;
 
-			partition@0 {
-				/* 1MB for u-boot Bootloader Image */
-				/* 1MB for Environment */
-				reg = <0x0 0x00100000>;
-				label = "SPI Flash U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@100000 {
-				/* 512KB for DTB Image */
-				reg = <0x00100000 0x00080000>;
-				label = "SPI Flash DTB Image";
-			};
-
-			partition@180000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00180000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@580000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00580000 0x00400000>;
-				label = "SPI Flash Compressed RFSImage";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@980000 {
-				/* 6.5MB for JFFS2 based RFS */
-				reg = <0x00980000 0x00680000>;
-				label = "SPI Flash JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1020rdb-pc.dtsi b/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
index c952cd3..277b563 100644
--- a/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p1020rdb-pc.dtsi
@@ -154,36 +154,24 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image*/
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1020rdb-pd.dts b/arch/powerpc/boot/dts/p1020rdb-pd.dts
index 987017e..b37f3e0 100644
--- a/arch/powerpc/boot/dts/p1020rdb-pd.dts
+++ b/arch/powerpc/boot/dts/p1020rdb-pd.dts
@@ -159,30 +159,24 @@
 				reg = <0>;
 				/* input clock */
 				spi-max-frequency = <40000000>;
-
-				partition@0 {
-					/* 512KB for u-boot Bootloader Image */
-					reg = <0x0 0x00080000>;
-					label = "SPI U-Boot Image";
+				partition@u-boot {
+					label = "u-boot";
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-
-				partition@80000 {
-					/* 512KB for DTB Image*/
-					reg = <0x00080000 0x00080000>;
-					label = "SPI DTB Image";
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
+					read-only;
 				};
-
-				partition@100000 {
-					/* 4MB for Linux Kernel Image */
-					reg = <0x00100000 0x00400000>;
-					label = "SPI Linux Kernel Image";
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
+					read-only;
 				};
-
-				partition@500000 {
-					/* 11MB for FS System Image */
-					reg = <0x00500000 0x00b00000>;
-					label = "SPI File System Image";
+				partition@fs {
+					label = "file system";
+					reg = <0x00700000 0x00900000>;
 				};
 			};
 
diff --git a/arch/powerpc/boot/dts/p1020rdb.dtsi b/arch/powerpc/boot/dts/p1020rdb.dtsi
index 1fb7e0e..f320acc 100644
--- a/arch/powerpc/boot/dts/p1020rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1020rdb.dtsi
@@ -151,39 +151,24 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
 				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-				read-only;
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1021mds.dts b/arch/powerpc/boot/dts/p1021mds.dts
index 97116f1..0d0b6f7 100644
--- a/arch/powerpc/boot/dts/p1021mds.dts
+++ b/arch/powerpc/boot/dts/p1021mds.dts
@@ -126,24 +126,23 @@
 				compatible = "spansion,s25sl12801";
 				reg = <0>;
 				spi-max-frequency = <40000000>; /* input clock */
-
 				partition@u-boot {
-					label = "u-boot-spi";
+					label = "u-boot";
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel-spi";
-					reg = <0x00100000 0x00500000>;
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
 					read-only;
 				};
-				partition@dtb {
-					label = "dtb-spi";
-					reg = <0x00600000 0x00100000>;
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
-					label = "file system-spi";
+					label = "file system";
 					reg = <0x00700000 0x00900000>;
 				};
 			};
diff --git a/arch/powerpc/boot/dts/p1021rdb-pc.dtsi b/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
index d6274c5..4e6aedd 100644
--- a/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p1021rdb-pc.dtsi
@@ -153,36 +153,24 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI Flash U-Boot Image";
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI Flash DTB Image";
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Flash Linux Kernel Image";
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Flash Compressed RFSImage";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI Flash JFFS2 RFS";
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1022ds.dtsi b/arch/powerpc/boot/dts/p1022ds.dtsi
index 873da35..faa2cb0 100644
--- a/arch/powerpc/boot/dts/p1022ds.dtsi
+++ b/arch/powerpc/boot/dts/p1022ds.dtsi
@@ -162,24 +162,23 @@
 			compatible = "spansion,s25sl12801";
 			reg = <0>;
 			spi-max-frequency = <40000000>; /* input clock */
-
-			partition@0 {
-				label = "u-boot-spi";
+			partition@u-boot {
+				label = "u-boot";
 				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-			partition@100000 {
-				label = "kernel-spi";
-				reg = <0x00100000 0x00500000>;
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
 				read-only;
 			};
-			partition@600000 {
-				label = "dtb-spi";
-				reg = <0x00600000 0x00100000>;
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
 				read-only;
 			};
-			partition@700000 {
-				label = "file system-spi";
+			partition@fs {
+				label = "file system";
 				reg = <0x00700000 0x00900000>;
 			};
 		};
diff --git a/arch/powerpc/boot/dts/p1023rds.dts b/arch/powerpc/boot/dts/p1023rds.dts
index beb6cb1..9fcf9af 100644
--- a/arch/powerpc/boot/dts/p1023rds.dts
+++ b/arch/powerpc/boot/dts/p1023rds.dts
@@ -65,15 +65,9 @@
 				reg = <0>;
 				spi-max-frequency = <40000000>; /* input clock */
 				partition@u-boot {
-					/* 512KB for u-boot Bootloader Image */
+					/* 1MB for u-boot Bootloader Image */
 					label = "u-boot-spi";
-					reg = <0x00000000 0x00080000>;
-					read-only;
-				};
-				partition@dtb {
-					/* 512KB for DTB Image */
-					label = "dtb-spi";
-					reg = <0x00080000 0x00080000>;
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
 			};
diff --git a/arch/powerpc/boot/dts/p1024rdb.dtsi b/arch/powerpc/boot/dts/p1024rdb.dtsi
index b05dcb4..2896f98 100644
--- a/arch/powerpc/boot/dts/p1024rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1024rdb.dtsi
@@ -132,36 +132,24 @@
 			compatible = "spansion,m25p80";
 			reg = <0>;
 			spi-max-frequency = <40000000>;
-
-			partition@0 {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@80000 {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI DTB Image";
-			};
-
-			partition@100000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@500000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Compressed RFS Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@900000 {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p1025rdb.dtsi b/arch/powerpc/boot/dts/p1025rdb.dtsi
index f502564..e74439c8 100644
--- a/arch/powerpc/boot/dts/p1025rdb.dtsi
+++ b/arch/powerpc/boot/dts/p1025rdb.dtsi
@@ -142,34 +142,23 @@
 			spi-max-frequency = <40000000>; /* input clock */
 
 			partition@u-boot {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
 				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
 			partition@dtb {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
 				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
 			partition@kernel {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
 				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
 			partition@fs {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
 				label = "file system";
-			};
-
-			partition@jffs-fs {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "file system jffs2";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
index c21d1c7..d501d35 100644
--- a/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
+++ b/arch/powerpc/boot/dts/p2020rdb-pc.dtsi
@@ -154,36 +154,24 @@
 			compatible = "spansion,m25p80";
 			reg = <0>;
 			spi-max-frequency = <40000000>;
-
-			partition@0 {
-				/* 512KB for u-boot Bootloader Image */
-				reg = <0x0 0x00080000>;
-				label = "SPI U-Boot Image";
+			partition@u-boot {
+				label = "u-boot";
+				reg = <0x00000000 0x00100000>;
 				read-only;
 			};
-
-			partition@80000 {
-				/* 512KB for DTB Image */
-				reg = <0x00080000 0x00080000>;
-				label = "SPI DTB Image";
-			};
-
-			partition@100000 {
-				/* 4MB for Linux Kernel Image */
-				reg = <0x00100000 0x00400000>;
-				label = "SPI Linux Kernel Image";
+			partition@dtb {
+				label = "dtb";
+				reg = <0x00180000 0x00080000>;
+				read-only;
 			};
-
-			partition@500000 {
-				/* 4MB for Compressed RFS Image */
-				reg = <0x00500000 0x00400000>;
-				label = "SPI Compressed RFS Image";
+			partition@kernel {
+				label = "kernel";
+				reg = <0x00200000 0x00500000>;
+				read-only;
 			};
-
-			partition@900000 {
-				/* 7MB for JFFS2 based RFS */
-				reg = <0x00900000 0x00700000>;
-				label = "SPI JFFS2 RFS";
+			partition@fs {
+				label = "file system";
+				reg = <0x00700000 0x00900000>;
 			};
 		};
 	};
diff --git a/arch/powerpc/boot/dts/p2020rdb.dts b/arch/powerpc/boot/dts/p2020rdb.dts
index 4d52bce..d47ae13 100644
--- a/arch/powerpc/boot/dts/p2020rdb.dts
+++ b/arch/powerpc/boot/dts/p2020rdb.dts
@@ -159,38 +159,24 @@
 				reg = <0>;
 				spi-max-frequency = <40000000>;
 
-				partition@0 {
-					/* 512KB for u-boot Bootloader Image */
-					reg = <0x0 0x00080000>;
-					label = "SPI (RO) U-Boot Image";
+				partition@u-boot {
+					label = "u-boot";
+					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-
-				partition@80000 {
-					/* 512KB for DTB Image */
-					reg = <0x00080000 0x00080000>;
-					label = "SPI (RO) DTB Image";
-					read-only;
-				};
-
-				partition@100000 {
-					/* 4MB for Linux Kernel Image */
-					reg = <0x00100000 0x00400000>;
-					label = "SPI (RO) Linux Kernel Image";
+				partition@dtb {
+					label = "dtb";
+					reg = <0x00180000 0x00080000>;
 					read-only;
 				};
-
-				partition@500000 {
-					/* 4MB for Compressed RFS Image */
-					reg = <0x00500000 0x00400000>;
-					label = "SPI (RO) Compressed RFS Image";
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
-
-				partition@900000 {
-					/* 7MB for JFFS2 based RFS */
-					reg = <0x00900000 0x00700000>;
-					label = "SPI (RW) JFFS2 RFS";
+				partition@fs {
+					label = "file system";
+					reg = <0x00700000 0x00900000>;
 				};
 			};
 		};
diff --git a/arch/powerpc/boot/dts/p2041rdb.dts b/arch/powerpc/boot/dts/p2041rdb.dts
index d97ad74..6fed1ea 100644
--- a/arch/powerpc/boot/dts/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/p2041rdb.dts
@@ -64,14 +64,14 @@
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts
index 2fed3bc..74a3b7e 100644
--- a/arch/powerpc/boot/dts/p3041ds.dts
+++ b/arch/powerpc/boot/dts/p3041ds.dts
@@ -64,14 +64,14 @@
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index 1cf6148..06525b3 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -65,14 +65,14 @@
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p5020ds.dts b/arch/powerpc/boot/dts/p5020ds.dts
index 2869fea..b0615a3 100644
--- a/arch/powerpc/boot/dts/p5020ds.dts
+++ b/arch/powerpc/boot/dts/p5020ds.dts
@@ -64,14 +64,14 @@
 					reg = <0x00000000 0x00100000>;
 					read-only;
 				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
-					read-only;
-				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
 					read-only;
 				};
 				partition@fs {
diff --git a/arch/powerpc/boot/dts/p5040ds.dts b/arch/powerpc/boot/dts/p5040ds.dts
index 860b5cc..1a3a994 100644
--- a/arch/powerpc/boot/dts/p5040ds.dts
+++ b/arch/powerpc/boot/dts/p5040ds.dts
@@ -62,14 +62,17 @@
 				partition@u-boot {
 					label = "u-boot";
 					reg = <0x00000000 0x00100000>;
-				};
-				partition@kernel {
-					label = "kernel";
-					reg = <0x00100000 0x00500000>;
+					read-only;
 				};
 				partition@dtb {
 					label = "dtb";
-					reg = <0x00600000 0x00100000>;
+					reg = <0x00180000 0x00080000>;
+					read-only;
+				};
+				partition@kernel {
+					label = "kernel";
+					reg = <0x00200000 0x00500000>;
+					read-only;
 				};
 				partition@fs {
 					label = "file system";
-- 
1.8.0

^ permalink raw reply related

* Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Alexey Kardashevskiy @ 2013-09-06  7:04 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: kvm, Alexander Graf, kvm-ppc, linux-kernel, linux-mm,
	Paul Mackerras, Paolo Bonzini, linuxppc-dev, David Gibson
In-Reply-To: <20130906065715.GG13021@redhat.com>

On 09/06/2013 04:57 PM, Gleb Natapov wrote:
> On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote:
>> On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote:
>>>> Or supporting all IOMMU links (and leaving emulated stuff as is) in on
>>>> "device" is the last thing I have to do and then you'll ack the patch?
>>>>
>>> I am concerned more about API here. Internal implementation details I
>>> leave to powerpc experts :)
>>
>> So Gleb, I want to step in for a bit here.
>>
>> While I understand that the new KVM device API is all nice and shiny and that this
>> whole thing should probably have been KVM devices in the first place (had they
>> existed or had we been told back then), the point is, the API for handling
>> HW IOMMUs that Alexey is trying to add is an extension of an existing mechanism
>> used for emulated IOMMUs.
>>
>> The internal data structure is shared, and fundamentally, by forcing him to
>> use that new KVM device for the "new stuff", we create a oddball API with
>> an ioctl for one type of iommu and a KVM device for the other, which makes
>> the implementation a complete mess in the kernel (and you should care :-)
>>
> Is it unfixable mess? Even if Alexey will do what you suggested earlier?
> 
>   - Convert *both* existing TCE objects to the new
>       KVM_CREATE_DEVICE, and have some backward compat code for the old one.



If we convert *old*, then for compatibility we will need one KVM device
(more precisely, one fd) per an TCE object (not one for all TCE objects) as
the guest (upstream QEMU) will mmap the table via mmap() and it won't use
any offset when mapping this fd.

The current KVM device implementation does not even support mmap().

So I would go with the KVM device patch I posted and really want to avoid
putting all TCEs into one device.



> The point is implementation usually can be changed, but for API it is
> much harder to do so.
> 
>> So for something completely new, I would tend to agree with you. However, I
>> still think that for this specific case, we should just plonk-in the original
>> ioctl proposed by Alexey and be done with it.
>>
> Do you think this is the last extension to IOMMU code, or we will see
> more and will use same justification to continue adding ioctls?




-- 
Alexey

^ permalink raw reply

* Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Gleb Natapov @ 2013-09-06  6:57 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: kvm, Alexey Kardashevskiy, Alexander Graf, kvm-ppc, linux-kernel,
	linux-mm, Paul Mackerras, Paolo Bonzini, linuxppc-dev,
	David Gibson
In-Reply-To: <1378353909.4321.126.camel@pasglop>

On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote:
> > > Or supporting all IOMMU links (and leaving emulated stuff as is) in on
> > > "device" is the last thing I have to do and then you'll ack the patch?
> > > 
> > I am concerned more about API here. Internal implementation details I
> > leave to powerpc experts :)
> 
> So Gleb, I want to step in for a bit here.
> 
> While I understand that the new KVM device API is all nice and shiny and that this
> whole thing should probably have been KVM devices in the first place (had they
> existed or had we been told back then), the point is, the API for handling
> HW IOMMUs that Alexey is trying to add is an extension of an existing mechanism
> used for emulated IOMMUs.
> 
> The internal data structure is shared, and fundamentally, by forcing him to
> use that new KVM device for the "new stuff", we create a oddball API with
> an ioctl for one type of iommu and a KVM device for the other, which makes
> the implementation a complete mess in the kernel (and you should care :-)
> 
Is it unfixable mess? Even if Alexey will do what you suggested earlier?

  - Convert *both* existing TCE objects to the new
      KVM_CREATE_DEVICE, and have some backward compat code for the old one.

The point is implementation usually can be changed, but for API it is
much harder to do so.

> So for something completely new, I would tend to agree with you. However, I
> still think that for this specific case, we should just plonk-in the original
> ioctl proposed by Alexey and be done with it.
> 
Do you think this is the last extension to IOMMU code, or we will see
more and will use same justification to continue adding ioctls?

--
			Gleb.

^ permalink raw reply

* Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Alexey Kardashevskiy @ 2013-09-06  6:06 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: kvm, Alexander Graf, kvm-ppc, linux-kernel, linux-mm,
	Paul Mackerras, Paolo Bonzini, linuxppc-dev, David Gibson
In-Reply-To: <20130906060147.GF13021@redhat.com>

On 09/06/2013 04:01 PM, Gleb Natapov wrote:
> On Fri, Sep 06, 2013 at 09:38:21AM +1000, Alexey Kardashevskiy wrote:
>> On 09/06/2013 04:10 AM, Gleb Natapov wrote:
>>> On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote:
>>>> On 09/03/2013 08:53 PM, Gleb Natapov wrote:
>>>>> On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote:
>>>>>> On 09/01/2013 10:06 PM, Gleb Natapov wrote:
>>>>>>> On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote:
>>>>>>>> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT
>>>>>>>> and H_STUFF_TCE requests targeted an IOMMU TCE table without passing
>>>>>>>> them to user space which saves time on switching to user space and back.
>>>>>>>>
>>>>>>>> Both real and virtual modes are supported. The kernel tries to
>>>>>>>> handle a TCE request in the real mode, if fails it passes the request
>>>>>>>> to the virtual mode to complete the operation. If it a virtual mode
>>>>>>>> handler fails, the request is passed to user space.
>>>>>>>>
>>>>>>>> The first user of this is VFIO on POWER. Trampolines to the VFIO external
>>>>>>>> user API functions are required for this patch.
>>>>>>>>
>>>>>>>> This adds a "SPAPR TCE IOMMU" KVM device to associate a logical bus
>>>>>>>> number (LIOBN) with an VFIO IOMMU group fd and enable in-kernel handling
>>>>>>>> of map/unmap requests. The device supports a single attribute which is
>>>>>>>> a struct with LIOBN and IOMMU fd. When the attribute is set, the device
>>>>>>>> establishes the connection between KVM and VFIO.
>>>>>>>>
>>>>>>>> Tests show that this patch increases transmission speed from 220MB/s
>>>>>>>> to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card).
>>>>>>>>
>>>>>>>> Signed-off-by: Paul Mackerras <paulus@samba.org>
>>>>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>>>>>>
>>>>>>>> ---
>>>>>>>>
>>>>>>>> Changes:
>>>>>>>> v9:
>>>>>>>> * KVM_CAP_SPAPR_TCE_IOMMU ioctl to KVM replaced with "SPAPR TCE IOMMU"
>>>>>>>> KVM device
>>>>>>>> * release_spapr_tce_table() is not shared between different TCE types
>>>>>>>> * reduced the patch size by moving VFIO external API
>>>>>>>> trampolines to separate patche
>>>>>>>> * moved documentation from Documentation/virtual/kvm/api.txt to
>>>>>>>> Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
>>>>>>>>
>>>>>>>> v8:
>>>>>>>> * fixed warnings from check_patch.pl
>>>>>>>>
>>>>>>>> 2013/07/11:
>>>>>>>> * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled
>>>>>>>> for KVM_BOOK3S_64
>>>>>>>> * kvmppc_gpa_to_hva_and_get also returns host phys address. Not much sense
>>>>>>>> for this here but the next patch for hugepages support will use it more.
>>>>>>>>
>>>>>>>> 2013/07/06:
>>>>>>>> * added realmode arch_spin_lock to protect TCE table from races
>>>>>>>> in real and virtual modes
>>>>>>>> * POWERPC IOMMU API is changed to support real mode
>>>>>>>> * iommu_take_ownership and iommu_release_ownership are protected by
>>>>>>>> iommu_table's locks
>>>>>>>> * VFIO external user API use rewritten
>>>>>>>> * multiple small fixes
>>>>>>>>
>>>>>>>> 2013/06/27:
>>>>>>>> * tce_list page is referenced now in order to protect it from accident
>>>>>>>> invalidation during H_PUT_TCE_INDIRECT execution
>>>>>>>> * added use of the external user VFIO API
>>>>>>>>
>>>>>>>> 2013/06/05:
>>>>>>>> * changed capability number
>>>>>>>> * changed ioctl number
>>>>>>>> * update the doc article number
>>>>>>>>
>>>>>>>> 2013/05/20:
>>>>>>>> * removed get_user() from real mode handlers
>>>>>>>> * kvm_vcpu_arch::tce_tmp usage extended. Now real mode handler puts there
>>>>>>>> translated TCEs, tries realmode_get_page() on those and if it fails, it
>>>>>>>> passes control over the virtual mode handler which tries to finish
>>>>>>>> the request handling
>>>>>>>> * kvmppc_lookup_pte() now does realmode_get_page() protected by BUSY bit
>>>>>>>> on a page
>>>>>>>> * The only reason to pass the request to user mode now is when the user mode
>>>>>>>> did not register TCE table in the kernel, in all other cases the virtual mode
>>>>>>>> handler is expected to do the job
>>>>>>>> ---
>>>>>>>>  .../virtual/kvm/devices/spapr_tce_iommu.txt        |  37 +++
>>>>>>>>  arch/powerpc/include/asm/kvm_host.h                |   4 +
>>>>>>>>  arch/powerpc/kvm/book3s_64_vio.c                   | 310 ++++++++++++++++++++-
>>>>>>>>  arch/powerpc/kvm/book3s_64_vio_hv.c                | 122 ++++++++
>>>>>>>>  arch/powerpc/kvm/powerpc.c                         |   1 +
>>>>>>>>  include/linux/kvm_host.h                           |   1 +
>>>>>>>>  virt/kvm/kvm_main.c                                |   5 +
>>>>>>>>  7 files changed, 477 insertions(+), 3 deletions(-)
>>>>>>>>  create mode 100644 Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
>>>>>>>>
>>>>>>>> diff --git a/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
>>>>>>>> new file mode 100644
>>>>>>>> index 0000000..4bc8fc3
>>>>>>>> --- /dev/null
>>>>>>>> +++ b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
>>>>>>>> @@ -0,0 +1,37 @@
>>>>>>>> +SPAPR TCE IOMMU device
>>>>>>>> +
>>>>>>>> +Capability: KVM_CAP_SPAPR_TCE_IOMMU
>>>>>>>> +Architectures: powerpc
>>>>>>>> +
>>>>>>>> +Device type supported: KVM_DEV_TYPE_SPAPR_TCE_IOMMU
>>>>>>>> +
>>>>>>>> +Groups:
>>>>>>>> +  KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE
>>>>>>>> +  Attributes: single attribute with pair { LIOBN, IOMMU fd}
>>>>>>>> +
>>>>>>>> +This is completely made up device which provides API to link
>>>>>>>> +logical bus number (LIOBN) and IOMMU group. The user space has
>>>>>>>> +to create a new SPAPR TCE IOMMU device per a logical bus.
>>>>>>>> +
>>>>>>> Why not have one device that can handle multimple links?
>>>>>>
>>>>>>
>>>>>> I can do that. If I make it so, it won't even look as a device at all, just
>>>>>> some weird interface to KVM but ok. What bothers me is it is just a
>>>>> May be I do not understand usage pattern here. Why do you feel that device
>>>>> that can handle multiple links is worse than device per link? How many logical
>>>>> buses is there usually? How often they created/destroyed? I am not insisting
>>>>> on the change, just trying to understand why you do not like it.
>>>>
>>>>
>>>> Is it usually one PCI host bus adapter per IOMMU group which is usually
>>>> one PCI card or 2-3 cards if it is a legacy PCI-X, and they are created
>>>> when QEMU-KVM starts. Not many. And they live till KVM ends.
>>>>
>>>> My point is why would I want to put all links to one device? It all is just
>>>> a matter of taste and nothing more. Or I am missing something but I do not
>>>> see what. If it is all about making thing to be kosher/halal/orthodox, then
>>>> I have more stuff to do, like reworking the emulated TCEs. But if is it for
>>>> (I do not know, just guessing) performance or something like that - then
>>>> I'll fix it, I just need to know what I am fixing.
>>>>
>>> Each device creates an fd, if you can have a lot of them eventually this
>>> will be a bottleneck. You are saying this is not the case, so lets go
>>> with proposed interface.
>>
>>
>> Did you decide not to answer the email which Ben sent yesterday or you just
>> did not see it? Just checking :)
>>
> Haven't seen it. Which one?


Subject: Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel
handling
Date: Thu, 05 Sep 2013 14:05:09 +1000
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gleb Natapov <gleb@redhat.com>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>, linuxppc-dev@lists.ozlabs.org,
     David Gibson <david@gibson.dropbear.id.au>,        Paul Mackerras
<paulus@samba.org>,        Paolo Bonzini <pbonzini@redhat.com>, Alexander
Graf <agraf@suse.de>,        kvm@vger.kernel.org,
linux-kernel@vger.kernel.org,        kvm-ppc@vger.kernel.org,
linux-mm@kvack.org


-- 
Alexey

^ permalink raw reply

* Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling
From: Gleb Natapov @ 2013-09-06  6:01 UTC (permalink / raw)
  To: Alexey Kardashevskiy
  Cc: kvm, Alexander Graf, kvm-ppc, linux-kernel, linux-mm,
	Paul Mackerras, Paolo Bonzini, linuxppc-dev, David Gibson
In-Reply-To: <522915ED.7050106@ozlabs.ru>

On Fri, Sep 06, 2013 at 09:38:21AM +1000, Alexey Kardashevskiy wrote:
> On 09/06/2013 04:10 AM, Gleb Natapov wrote:
> > On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote:
> >> On 09/03/2013 08:53 PM, Gleb Natapov wrote:
> >>> On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote:
> >>>> On 09/01/2013 10:06 PM, Gleb Natapov wrote:
> >>>>> On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote:
> >>>>>> This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT
> >>>>>> and H_STUFF_TCE requests targeted an IOMMU TCE table without passing
> >>>>>> them to user space which saves time on switching to user space and back.
> >>>>>>
> >>>>>> Both real and virtual modes are supported. The kernel tries to
> >>>>>> handle a TCE request in the real mode, if fails it passes the request
> >>>>>> to the virtual mode to complete the operation. If it a virtual mode
> >>>>>> handler fails, the request is passed to user space.
> >>>>>>
> >>>>>> The first user of this is VFIO on POWER. Trampolines to the VFIO external
> >>>>>> user API functions are required for this patch.
> >>>>>>
> >>>>>> This adds a "SPAPR TCE IOMMU" KVM device to associate a logical bus
> >>>>>> number (LIOBN) with an VFIO IOMMU group fd and enable in-kernel handling
> >>>>>> of map/unmap requests. The device supports a single attribute which is
> >>>>>> a struct with LIOBN and IOMMU fd. When the attribute is set, the device
> >>>>>> establishes the connection between KVM and VFIO.
> >>>>>>
> >>>>>> Tests show that this patch increases transmission speed from 220MB/s
> >>>>>> to 750..1020MB/s on 10Gb network (Chelsea CXGB3 10Gb ethernet card).
> >>>>>>
> >>>>>> Signed-off-by: Paul Mackerras <paulus@samba.org>
> >>>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >>>>>>
> >>>>>> ---
> >>>>>>
> >>>>>> Changes:
> >>>>>> v9:
> >>>>>> * KVM_CAP_SPAPR_TCE_IOMMU ioctl to KVM replaced with "SPAPR TCE IOMMU"
> >>>>>> KVM device
> >>>>>> * release_spapr_tce_table() is not shared between different TCE types
> >>>>>> * reduced the patch size by moving VFIO external API
> >>>>>> trampolines to separate patche
> >>>>>> * moved documentation from Documentation/virtual/kvm/api.txt to
> >>>>>> Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
> >>>>>>
> >>>>>> v8:
> >>>>>> * fixed warnings from check_patch.pl
> >>>>>>
> >>>>>> 2013/07/11:
> >>>>>> * removed multiple #ifdef IOMMU_API as IOMMU_API is always enabled
> >>>>>> for KVM_BOOK3S_64
> >>>>>> * kvmppc_gpa_to_hva_and_get also returns host phys address. Not much sense
> >>>>>> for this here but the next patch for hugepages support will use it more.
> >>>>>>
> >>>>>> 2013/07/06:
> >>>>>> * added realmode arch_spin_lock to protect TCE table from races
> >>>>>> in real and virtual modes
> >>>>>> * POWERPC IOMMU API is changed to support real mode
> >>>>>> * iommu_take_ownership and iommu_release_ownership are protected by
> >>>>>> iommu_table's locks
> >>>>>> * VFIO external user API use rewritten
> >>>>>> * multiple small fixes
> >>>>>>
> >>>>>> 2013/06/27:
> >>>>>> * tce_list page is referenced now in order to protect it from accident
> >>>>>> invalidation during H_PUT_TCE_INDIRECT execution
> >>>>>> * added use of the external user VFIO API
> >>>>>>
> >>>>>> 2013/06/05:
> >>>>>> * changed capability number
> >>>>>> * changed ioctl number
> >>>>>> * update the doc article number
> >>>>>>
> >>>>>> 2013/05/20:
> >>>>>> * removed get_user() from real mode handlers
> >>>>>> * kvm_vcpu_arch::tce_tmp usage extended. Now real mode handler puts there
> >>>>>> translated TCEs, tries realmode_get_page() on those and if it fails, it
> >>>>>> passes control over the virtual mode handler which tries to finish
> >>>>>> the request handling
> >>>>>> * kvmppc_lookup_pte() now does realmode_get_page() protected by BUSY bit
> >>>>>> on a page
> >>>>>> * The only reason to pass the request to user mode now is when the user mode
> >>>>>> did not register TCE table in the kernel, in all other cases the virtual mode
> >>>>>> handler is expected to do the job
> >>>>>> ---
> >>>>>>  .../virtual/kvm/devices/spapr_tce_iommu.txt        |  37 +++
> >>>>>>  arch/powerpc/include/asm/kvm_host.h                |   4 +
> >>>>>>  arch/powerpc/kvm/book3s_64_vio.c                   | 310 ++++++++++++++++++++-
> >>>>>>  arch/powerpc/kvm/book3s_64_vio_hv.c                | 122 ++++++++
> >>>>>>  arch/powerpc/kvm/powerpc.c                         |   1 +
> >>>>>>  include/linux/kvm_host.h                           |   1 +
> >>>>>>  virt/kvm/kvm_main.c                                |   5 +
> >>>>>>  7 files changed, 477 insertions(+), 3 deletions(-)
> >>>>>>  create mode 100644 Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
> >>>>>>
> >>>>>> diff --git a/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
> >>>>>> new file mode 100644
> >>>>>> index 0000000..4bc8fc3
> >>>>>> --- /dev/null
> >>>>>> +++ b/Documentation/virtual/kvm/devices/spapr_tce_iommu.txt
> >>>>>> @@ -0,0 +1,37 @@
> >>>>>> +SPAPR TCE IOMMU device
> >>>>>> +
> >>>>>> +Capability: KVM_CAP_SPAPR_TCE_IOMMU
> >>>>>> +Architectures: powerpc
> >>>>>> +
> >>>>>> +Device type supported: KVM_DEV_TYPE_SPAPR_TCE_IOMMU
> >>>>>> +
> >>>>>> +Groups:
> >>>>>> +  KVM_DEV_SPAPR_TCE_IOMMU_ATTR_LINKAGE
> >>>>>> +  Attributes: single attribute with pair { LIOBN, IOMMU fd}
> >>>>>> +
> >>>>>> +This is completely made up device which provides API to link
> >>>>>> +logical bus number (LIOBN) and IOMMU group. The user space has
> >>>>>> +to create a new SPAPR TCE IOMMU device per a logical bus.
> >>>>>> +
> >>>>> Why not have one device that can handle multimple links?
> >>>>
> >>>>
> >>>> I can do that. If I make it so, it won't even look as a device at all, just
> >>>> some weird interface to KVM but ok. What bothers me is it is just a
> >>> May be I do not understand usage pattern here. Why do you feel that device
> >>> that can handle multiple links is worse than device per link? How many logical
> >>> buses is there usually? How often they created/destroyed? I am not insisting
> >>> on the change, just trying to understand why you do not like it.
> >>
> >>
> >> Is it usually one PCI host bus adapter per IOMMU group which is usually
> >> one PCI card or 2-3 cards if it is a legacy PCI-X, and they are created
> >> when QEMU-KVM starts. Not many. And they live till KVM ends.
> >>
> >> My point is why would I want to put all links to one device? It all is just
> >> a matter of taste and nothing more. Or I am missing something but I do not
> >> see what. If it is all about making thing to be kosher/halal/orthodox, then
> >> I have more stuff to do, like reworking the emulated TCEs. But if is it for
> >> (I do not know, just guessing) performance or something like that - then
> >> I'll fix it, I just need to know what I am fixing.
> >>
> > Each device creates an fd, if you can have a lot of them eventually this
> > will be a bottleneck. You are saying this is not the case, so lets go
> > with proposed interface.
> 
> 
> Did you decide not to answer the email which Ben sent yesterday or you just
> did not see it? Just checking :)
> 
Haven't seen it. Which one?

--
			Gleb.

^ permalink raw reply

* RE: [PATCH V2] powerpc: Add I2C bus multiplexer node for B4 and T4240QDS
From: Jia Hongtao-B38951 @ 2013-09-06  3:33 UTC (permalink / raw)
  To: Kumar Gala, Wood Scott-B07421
  Cc: linuxppc-dev@lists.ozlabs.org, Wei.Yang@windriver.com
In-Reply-To: <7BA50BB5-9A63-4EA5-91E4-D04576892AAF@kernel.crashing.org>

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Friday, September 06, 2013 2:41 AM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421;
> Wei.Yang@windriver.com
> Subject: Re: [PATCH V2] powerpc: Add I2C bus multiplexer node for B4 and
> T4240QDS
>=20
>=20
> On Sep 4, 2013, at 9:41 PM, Jia Hongtao wrote:
>=20
> > In both B4 and T4240QDS platform PCA9547 I2C bus multiplexer is used.
> > The sub-nodes are also reorganized according to right I2C topology.
> >
> > Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
> > ---
> > V2 change log:
> > Reorganized the sub-nodes under I2C multiplexer to represent right
> topology.
> >
> > arch/powerpc/boot/dts/b4qds.dtsi   | 49 +++++++++++++++++-----------
> > arch/powerpc/boot/dts/t4240qds.dts | 67 ++++++++++++++++++++++---------
> -------
> > 2 files changed, 69 insertions(+), 47 deletions(-)
> >
> > diff --git a/arch/powerpc/boot/dts/b4qds.dtsi
> b/arch/powerpc/boot/dts/b4qds.dtsi
> > index e6d2f8f..de8cb38 100644
> > --- a/arch/powerpc/boot/dts/b4qds.dtsi
> > +++ b/arch/powerpc/boot/dts/b4qds.dtsi
> > @@ -120,25 +120,36 @@
> > 		};
> >
> > 		i2c@118000 {
> > -			eeprom@50 {
> > -				compatible =3D "at24,24c64";
> > -				reg =3D <0x50>;
> > -			};
> > -			eeprom@51 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x51>;
> > -			};
> > -			eeprom@53 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x53>;
> > -			};
> > -			eeprom@57 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x57>;
> > -			};
> > -			rtc@68 {
> > -				compatible =3D "dallas,ds3232";
> > -				reg =3D <0x68>;
> > +			pca9547@77 {
> > +				compatible =3D "philips,pca9547";
>=20
> We seem to be using nxp instead of philips now.
>=20
> > +				reg =3D <0x77>;
> > +				#address-cells =3D <1>;
> > +				#size-cells =3D <0>;
> > +				channel@0 {
>=20
> channel should probably be i2c


Is there any standard for the name?
i2c is ok but I think channel is more intuitional.

Hi Scott,
What do you think of it.

Thanks.
-Hongtao


>=20
> [same comments below]
>=20
> > +					#address-cells =3D <1>;
> > +					#size-cells =3D <0>;
> > +					reg =3D <0>;
> > +					eeprom@50 {
> > +						compatible =3D "at24,24c64";
> > +						reg =3D <0x50>;
> > +					};
> > +					eeprom@51 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x51>;
> > +					};
> > +					eeprom@53 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x53>;
> > +					};
> > +					eeprom@57 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x57>;
> > +					};
> > +					rtc@68 {
> > +						compatible =3D "dallas,ds3232";
> > +						reg =3D <0x68>;
> > +					};
> > +				};
> > 			};
> > 		};
> >
> > diff --git a/arch/powerpc/boot/dts/t4240qds.dts
> b/arch/powerpc/boot/dts/t4240qds.dts
> > index 0555976..ae68595 100644
> > --- a/arch/powerpc/boot/dts/t4240qds.dts
> > +++ b/arch/powerpc/boot/dts/t4240qds.dts
> > @@ -118,34 +118,45 @@
> > 		};
> >
> > 		i2c@118000 {
> > -			eeprom@51 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x51>;
> > -			};
> > -			eeprom@52 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x52>;
> > -			};
> > -			eeprom@53 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x53>;
> > -			};
> > -			eeprom@54 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x54>;
> > -			};
> > -			eeprom@55 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x55>;
> > -			};
> > -			eeprom@56 {
> > -				compatible =3D "at24,24c256";
> > -				reg =3D <0x56>;
> > -			};
> > -			rtc@68 {
> > -				compatible =3D "dallas,ds3232";
> > -				reg =3D <0x68>;
> > -				interrupts =3D <0x1 0x1 0 0>;
> > +			pca9547@77 {
> > +				compatible =3D "philips,pca9547";
> > +				reg =3D <0x77>;
> > +				#address-cells =3D <1>;
> > +				#size-cells =3D <0>;
> > +				channel@0 {
> > +					#address-cells =3D <1>;
> > +					#size-cells =3D <0>;
> > +					reg =3D <0>;
> > +					eeprom@51 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x51>;
> > +					};
> > +					eeprom@52 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x52>;
> > +					};
> > +					eeprom@53 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x53>;
> > +					};
> > +					eeprom@54 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x54>;
> > +					};
> > +					eeprom@55 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x55>;
> > +					};
> > +					eeprom@56 {
> > +						compatible =3D "at24,24c256";
> > +						reg =3D <0x56>;
> > +					};
> > +					rtc@68 {
> > +						compatible =3D "dallas,ds3232";
> > +						reg =3D <0x68>;
> > +						interrupts =3D <0x1 0x1 0 0>;
> > +					};
> > +				};
> > 			};
> > 		};
> > 	};
> > --
> > 1.8.0
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
>=20

^ permalink raw reply

* RE: [V2,2/2] powerpc/85xx: workaround for chips with MSI hardware errata
From: Jia Hongtao-B38951 @ 2013-09-06  3:19 UTC (permalink / raw)
  To: Wood Scott-B07421; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1378403834.12204.99.camel@snotra.buserror.net>

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogRnJpZGF5LCBTZXB0ZW1iZXIgMDYsIDIwMTMgMTo1NyBBTQ0KPiBUbzogSmlh
IEhvbmd0YW8tQjM4OTUxDQo+IENjOiBXb29kIFNjb3R0LUIwNzQyMTsgbGludXhwcGMtZGV2QGxp
c3RzLm96bGFicy5vcmc7DQo+IGdhbGFrQGtlcm5lbC5jcmFzaGluZy5vcmcNCj4gU3ViamVjdDog
UmU6IFtWMiwyLzJdIHBvd2VycGMvODV4eDogd29ya2Fyb3VuZCBmb3IgY2hpcHMgd2l0aCBNU0kN
Cj4gaGFyZHdhcmUgZXJyYXRhDQo+IA0KPiBPbiBXZWQsIDIwMTMtMDktMDQgYXQgMjM6MDAgLTA1
MDAsIEppYSBIb25ndGFvLUIzODk1MSB3cm90ZToNCj4gPiA+IC0tLS0tT3JpZ2luYWwgTWVzc2Fn
ZS0tLS0tDQo+ID4gPiBGcm9tOiBKaWEgSG9uZ3Rhby1CMzg5NTENCj4gPiA+IFNlbnQ6IE1vbmRh
eSwgSnVseSAwMSwgMjAxMyA1OjM2IFBNDQo+ID4gPiBUbzogV29vZCBTY290dC1CMDc0MjENCj4g
PiA+IENjOiBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJzLm9yZzsgZ2FsYWtAa2VybmVsLmNyYXNo
aW5nLm9yZw0KPiA+ID4gU3ViamVjdDogUkU6IFtWMiwyLzJdIHBvd2VycGMvODV4eDogd29ya2Fy
b3VuZCBmb3IgY2hpcHMgd2l0aCBNU0kNCj4gPiA+IGhhcmR3YXJlIGVycmF0YQ0KPiA+ID4NCj4g
PiA+ID4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gPiA+ID4gRnJvbTogV29vZCBTY290
dC1CMDc0MjENCj4gPiA+ID4gU2VudDogRnJpZGF5LCBKdW5lIDI4LCAyMDEzIDEwOjI5IEFNDQo+
ID4gPiA+IFRvOiBKaWEgSG9uZ3Rhby1CMzg5NTENCj4gPiA+ID4gQ2M6IGxpbnV4cHBjLWRldkBs
aXN0cy5vemxhYnMub3JnOyBnYWxha0BrZXJuZWwuY3Jhc2hpbmcub3JnOyBXb29kDQo+ID4gPiA+
IFNjb3R0LQ0KPiA+ID4gPiBCMDc0MjENCj4gPiA+ID4gU3ViamVjdDogUmU6IFtWMiwyLzJdIHBv
d2VycGMvODV4eDogd29ya2Fyb3VuZCBmb3IgY2hpcHMgd2l0aCBNU0kNCj4gPiA+ID4gaGFyZHdh
cmUgZXJyYXRhDQo+ID4gPiA+DQo+ID4gPiA+IE9uIFdlZCwgQXByIDAzLCAyMDEzIGF0IDEwOjAz
OjE4QU0gKzA4MDAsIEhvbmd0YW8gSmlhIHdyb3RlOg0KPiA+ID4gPiA+IFRoZSBNUElDIHZlcnNp
b24gMi4wIGhhcyBhIE1TSSBlcnJhdGEgKGVycmF0YSBQSUMxIG9mIG1wYzg1NDQpLA0KPiA+ID4g
PiA+IEl0IGNhdXNlcyB0aGF0IG5laXRoZXIgTVNJIG5vciBNU0ktWCBjYW4gd29yayBmaW5lLiBU
aGlzIGlzIGENCj4gPiA+ID4gPiB3b3JrYXJvdW5kIHRvIGFsbG93IE1TSS1YIHRvIGZ1bmN0aW9u
IHByb3Blcmx5Lg0KPiA+ID4gPiA+DQo+ID4gPiA+ID4gU2lnbmVkLW9mZi1ieTogTGl1IFNodW8g
PHNvbmljY2F0LmxpdUBnbWFpbC5jb20+DQo+ID4gPiA+ID4gU2lnbmVkLW9mZi1ieTogTGkgWWFu
ZyA8bGVvbGlAZnJlZXNjYWxlLmNvbT4NCj4gPiA+ID4gPiBTaWduZWQtb2ZmLWJ5OiBKaWEgSG9u
Z3RhbyA8aG9uZ3Rhby5qaWFAZnJlZXNjYWxlLmNvbT4NCj4gPiA+ID4NCj4gPiA+ID4gQnVpbGRp
bmcgb24gODN4eDoNCj4gPiA+ID4NCj4gPiA+ID4gICBhcmNoL3Bvd2VycGMvc3lzZGV2L2J1aWx0
LWluLm86IEluIGZ1bmN0aW9uIGBmc2xfb2ZfbXNpX3Byb2JlJzoNCj4gPiA+ID4gICBmc2xfbXNp
LmM6KC50ZXh0KzB4MTQ2NCk6IHVuZGVmaW5lZCByZWZlcmVuY2UgdG8NCj4gPiA+ID4gYGZzbF9t
cGljX3ByaW1hcnlfZ2V0X3ZlcnNpb24nDQo+ID4gPiA+ICAgbWFrZVsxXTogKioqIFt2bWxpbnV4
XSBFcnJvciAxDQo+ID4gPiA+ICAgbWFrZTogKioqIFtzdWItbWFrZV0gRXJyb3IgMg0KPiA+ID4g
Pg0KPiA+ID4gPiBmc2xfbXNpLmMgc3VwcG9ydHMgSVBJQyBhcyB3ZWxsLg0KPiA+ID4gPg0KPiA+
ID4gPiAtU2NvdHQNCj4gPiA+DQo+ID4gPiBIaSBTY290dCwNCj4gPiA+IEkgdXBkYXRlZCB0aGUg
cGF0Y2ggdG8gZml4IHRoaXMgY29tcGlsZSBlcnJvciBqdXN0IG5vdy4NCj4gPiA+IHBsZWFzZSBy
ZWZlciB0bzoNCj4gPiA+IGh0dHA6Ly9wYXRjaHdvcmsub3psYWJzLm9yZy9wYXRjaC8yNTYwMTgv
DQo+ID4gPg0KPiA+ID4gVGhhbmtzLg0KPiA+ID4gLUhvbmd0YW8NCj4gPg0KPiA+IEhpIFNjb3R0
LA0KPiA+DQo+ID4gVGhlIDgzeHggY29tcGlsZSBpc3N1ZSBoYXMgYWxyZWFkeSBiZWVuIGZpeGVk
Lg0KPiA+IFBsZWFzZSBoYXZlIGEgcmV2aWV3IG9uIHRoaXMgcGF0Y2guDQo+IA0KPiBPaCwgc29y
cnkgLS0gSSBtaXNzZWQgaXQgYmVjYXVzZSBpdCB3YXMgbWFya2VkICJDaGFuZ2VzIFJlcXVlc3Rl
ZCIuDQo+IEkndmUgY2hhbmdlZCB0aGUgc3RhdHVzIGFuZCB3aWxsIGNvbnNpZGVyIGl0IGZvciB0
aGUgbmV4dCBiYXRjaCBvZiAibmV4dCINCj4gcGF0Y2hlcy4NCj4gDQo+IEluIHRoZSBmdXR1cmUs
IGlmIGEgcGF0Y2ggaXMgbWlzY2F0ZWdvcml6ZWQgaW4gcGF0Y2h3b3JrIChlLmcuIHNheXMNCj4g
ImNoYW5nZXMgcmVxdWVzdGVkIiB3aGVuIHRoZXJlIGlzIG5vIGxvbmdlciBhIG5lZWQgdG8gc3Vi
bWl0IGEgbmV3DQo+IHBhdGNoKSBwbGVhc2UgbWVudGlvbiB0aGF0IHNwZWNpZmljYWxseSBhbmQg
cHJvdmlkZSB0aGUgcGF0Y2h3b3JrIFVSTC4NCj4gDQo+IC1TY290dA0KPiANCg0KT2ssIGdvdCBp
dC4NClNvcnJ5IGZvciB5b3VyIGluY29udmVuaWVudC4gDQoNCi1Ib25ndGFvDQoNCg==

^ permalink raw reply

* RE: [PATCH] powerpc: Add I2C bus multiplexer node for B4 and T4240QDS
From: Tang Yuantian-B29983 @ 2013-09-06  2:30 UTC (permalink / raw)
  To: Wood Scott-B07421
  Cc: linuxppc-dev@lists.ozlabs.org, Yang, Wei, Jia Hongtao-B38951
In-Reply-To: <1378406443.12204.102.camel@snotra.buserror.net>

DQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFdvb2QgU2NvdHQtQjA3NDIx
DQo+IFNlbnQ6IDIwMTPlubQ55pyINuaXpSDmmJ/mnJ/kupQgMjo0MQ0KPiBUbzogVGFuZyBZdWFu
dGlhbi1CMjk5ODMNCj4gQ2M6IFlhbmcsV2VpOyBKaWEgSG9uZ3Rhby1CMzg5NTE7IFdvb2QgU2Nv
dHQtQjA3NDIxOyBsaW51eHBwYy0NCj4gZGV2QGxpc3RzLm96bGFicy5vcmcNCj4gU3ViamVjdDog
UmU6IFtQQVRDSF0gcG93ZXJwYzogQWRkIEkyQyBidXMgbXVsdGlwbGV4ZXIgbm9kZSBmb3IgQjQg
YW5kDQo+IFQ0MjQwUURTDQo+IA0KPiBPbiBUdWUsIDIwMTMtMDktMDMgYXQgMjI6MzAgLTA1MDAs
IFRhbmcgWXVhbnRpYW4tQjI5OTgzIHdyb3RlOg0KPiA+IEhpLA0KPiA+DQo+ID4gVGhlc2UgZWVw
cm9tcyBhcmUgbmV2ZXIgdXNlZCBieSBrZXJuZWwuIFNvIG5vIG5lZWQgdG8gYWRkIHRoZW0uDQo+
IA0KPiBUaGUgZGV2aWNlIHRyZWUgZGVzY3JpYmVzIHRoZSBoYXJkd2FyZSwgbm90IHdoYXQgTGlu
dXggZG9lcyB3aXRoIGl0Lg0KPiANCk1pc3Npbmcgc29tZSBub2RlcyBkb2Vzbid0IG1lYW4gaXQg
aXMgbm90IGRlc2NyaWJpbmcgdGhlIGhhcmR3YXJlLg0KVGhlcmUgYXJlIGFsbW9zdCBmaWZ0eSBJ
MkMgZGV2aWNlcyBvbiBUNCBjb25uZWN0ZWQgdG8gUENBOTU0Ny4NCkRvIHlvdSB0aGluayB3ZSBu
ZWVkIHRvIGxpc3QgdGhlbSBhbGw/DQoNClJlZ2FyZHMsDQpZdWFudGlhbg0KDQo+IC1TY290dA0K
PiANCg0K

^ permalink raw reply

* [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2013-09-06  2:24 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev, Linux Kernel list

Hi Linus !

Here's the powerpc batch for this merge window. Some of the highlights are:

 * A bunch of endian fixes ! We don't have full LE support yet in that
release but this contains a lot of fixes all over arch/powerpc to use the
proper accessors, call the firmware with the right endian mode, etc...

 * A few updates to our "powernv" platform (non-virtualized, the one
to run KVM on), among other, support for bridging the P8 LPC bus for UARTs,
support and some EEH fixes.
 
 * Some mpc51xx clock API cleanups in preparation for a clock API overhaul

 * A pile of cleanups of our old math emulation code, including better
support for using it to emulate optional FP instructions on embedded
chips that otherwise have a HW FPU.

 * Some infrastructure in selftest, for powerpc now, but could be generalized,
initially used by some tests for our perf instruction counting code.

 * A pile of fixes for hotplug on pseries (that was seriously bitrotting)

 * The usual slew of freescale embedded updates, new boards, 64-bit hiberation
support, e6500 core PMU support, etc...

Cheers,
Ben.

The following changes since commit d4e4ab86bcba5a72779c43dc1459f71fea3d89c8:

  Linux 3.11-rc5 (2013-08-11 18:04:20 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next

for you to fetch changes up to 9f24b0c9ef9b6b1292579c9e2cd7ff07ddc372b7:

  powerpc: Correct FSCR bit definitions (2013-09-05 17:29:20 +1000)

----------------------------------------------------------------
Alistair Popple (4):
      powerpc: More little endian fixes for prom.c
      powerpc: More little endian fixes for setup-common.c
      powerpc: Little endian fixes for legacy_serial.c
      powerpc: Make NUMA device node code endian safe

Andy Fleming (2):
      powerpc: Add smp_generic_cpu_bootable
      powerpc: Convert platforms to smp_generic_cpu_bootable

Anton Blanchard (29):
      powerpc: Align p_toc
      powerpc: Handle unaligned ldbrx/stdbrx
      powerpc: Wrap MSR macros with parentheses
      powerpc: Remove SAVE_VSRU and REST_VSRU macros
      powerpc: Simplify logic in include/uapi/asm/elf.h
      powerpc/pseries: Simplify H_GET_TERM_CHAR
      powerpc: Fix a number of sparse warnings
      powerpc/pci: Don't use bitfield for force_32bit_msi
      powerpc: Stop using non-architected shared_proc field in lppaca
      powerpc: Make RTAS device tree accesses endian safe
      powerpc: Make cache info device tree accesses endian safe
      powerpc: Make RTAS calls endian safe
      powerpc: Make logical to real cpu mapping code endian safe
      powerpc: Add some endian annotations to time and xics code
      powerpc: Fix some endian issues in xics code
      powerpc: of_parse_dma_window should take a __be32 *dma_window
      powerpc: Make device tree accesses in cache info code endian safe
      powerpc: Make device tree accesses in HVC VIO console endian safe
      powerpc: Make device tree accesses in VIO subsystem endian safe
      powerpc: Make OF PCI device tree accesses endian safe
      powerpc: Make PCI device node device tree accesses endian safe
      powerpc: Add endian annotations to lppaca, slb_shadow and dtl_entry
      powerpc: Fix little endian lppaca, slb_shadow and dtl_entry
      powerpc: Emulate instructions in little endian mode
      powerpc: Little endian SMP IPI demux
      powerpc/pseries: Fix endian issues in H_GET_TERM_CHAR/H_PUT_TERM_CHAR
      powerpc: Fix little endian coredumps
      powerpc: Make rwlocks endian safe
      powerpc: Never handle VSX alignment exceptions from kernel

Benjamin Herrenschmidt (21):
      Merge remote-tracking branch 'scott/next' into next
      powerpc/pmac: Early debug output on screen on 64-bit macs
      powerpc: Better split CONFIG_PPC_INDIRECT_PIO and CONFIG_PPC_INDIRECT_MMIO
      powerpc/powernv: Update opal.h to add new LPC and XSCOM functions
      powerpc/powernv: Add helper to get ibm,chip-id of a node
      powerpc/powernv: Add PIO accessors for Power8 LPC bus
      powerpc: Cleanup udbg_16550 and add support for LPC PIO-only UARTs
      powerpc: Check "status" property before adding legacy ISA serial ports
      powerpc/powernv: Don't crash if there are no OPAL consoles
      powerpc/powernv: Enable detection of legacy UARTs
      Revert "powerpc/e500: Update compilation flags with core specific options"
      powerpc: Make prom_init.c endian safe
      powerpc/wsp: Fix early debug build
      Merge remote-tracking branch 'scott/next' into next
      Merge branch 'merge' into next
      powerpc/btext: Fix CONFIG_PPC_EARLY_DEBUG_BOOTX on ppc32
      powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor
      powerpc/powernv: Return secondary CPUs to firmware on kexec
      Merge branch 'merge' into next
      powerpc/pseries: Move lparcfg.c to platforms/pseries
      Merge remote-tracking branch 'agust/next' into next

Catalin Udma (2):
      powerpc/perf: increase the perf HW events to 6
      powerpc/e500: Update compilation flags with core specific options

Chunhe Lan (1):
      powerpc/85xx: Add P1023RDB board support

Deepthi Dharwar (2):
      pseries/cpuidle: Remove dependency of pseries.h file
      pseries: Move plpar_wrapper.h to powerpc common include/asm location.

Dongsheng Wang (1):
      powerpc/mpc85xx: invalidate TLB after hibernation resume

Eugene Surovegin (1):
      powerpc/hvsi: Increase handshake timeout from 200ms to 400ms.

Gavin Shan (5):
      powerpc/powernv: Free PHB instance upon error
      powerpc/powernv: Fetch PHB bus range from dev-tree
      powerpc/powernv: Check primary PHB through ID
      powerpc/powernv: Needn't IO segment map for PHB3
      powerpc/pci: Remove duplicate check in pcibios_fixup_bus()

Gerhard Sittig (6):
      serial: mpc512x: cleanup clock API use
      USB: fsl-mph-dr-of: cleanup clock API use
      mtd: mpc5121_nfc: cleanup clock API use
      fsl-viu: cleanup clock API use
      powerpc: mpc512x: array decl for MCLK registers in CCM
      dts: mpc512x: prepare for preprocessor support

Haijun.Zhang (3):
      powerpc/85xx: add P1020RDB-PD platform support
      powerpc/85xx: add the P1020RDB-PD DTS support
      powerpc/85xx: Add support for 85xx cpu type detection

Hongtao Jia (3):
      powerpc: Move opcode definitions from kvm/emulate.c to asm/ppc-opcode.h
      powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
      powerpc/msi: Fix compile error on mpc83xx

Ian Campbell (1):
      powerpc/fsl-booke: Rename b4qds.dts -> b4qds.dtsi.

Ian Munsie (1):
      powerpc: Make prom.c device tree accesses endian safe

James Yang (1):
      powerpc/math-emu: Fix load/store indexed emulation

Jingoo Han (1):
      macintosh/ams: Replace strict_strtoul() with kstrtoul()

Kevin Hao (16):
      powerpc/mpc85xx: remove the unneeded pci init functions for corenet ds board
      powerpc/fsl-pci: fix the unreachable warning message
      powerpc/fsl-pci: enable SWIOTLB in function setup_pci_atmu
      powerpc: Move the testing of CPU_FTR_COHERENT_ICACHE into __flush_icache_range
      powerpc: Remove the symbol __flush_icache_range
      powerpc/math-emu: Remove the dead code in math.c
      powerpc/math-emu: Remove the unneeded check for CONFIG_MATH_EMULATION in math.c
      powerpc/85xx: Enable the math emulation for the corenet64_smp_defconfig
      powerpc/math-emu: Move the flush FPU state function into do_mathemu
      powerpc: Introduce function emulate_math()
      powerpc: split She math emulation into two parts
      powerpc: remove the unused function disable_kernel_fp()
      powerpc/mpc85xx: Only emulate the unimplemented FP instructions on corenet64
      powerpc: Remove the redundant flush_fp_to_thread() in setup_sigcontext()
      powerpc: Make flush_fp_to_thread() nop when CONFIG_PPC_FPU is disabled
      powerpc: Remove the empty giveup_fpu() function on 32bit kernel

Laurentiu TUDOR (1):
      powerpc/85xx: Move ePAPR paravirt initialization earlier

Lijun Pan (2):
      powerpc/perf: correct typos in counter enumeration
      powerpc/perf: add 2 additional performance monitor counters for e6500 core

Mark Brown (1):
      powerpc: Ignore zImage.epapr

Michael Ellerman (9):
      selftests: Add infrastructure for powerpc selftests
      selftests: Add support files for powerpc tests
      selftests: Add test of PMU instruction counting on powerpc
      powerpc: Update the 00-Index in Documentation/powerpc
      powerpc/pseries: Add a warning in the case of cross-cpu VPA registration
      powerpc: Add more trap names to xmon
      powerpc: Fix location and rename exception trampolines
      powerpc: Add more exception trampolines for hypervisor exceptions
      powerpc: Skip emulating & leave interrupts off for kernel program checks

Michael Neuling (2):
      powerpc: Avoid link stack corruption for MMU on exceptions
      powerpc: Cleanup handling of the DSCR bit in the FSCR register

Mike Qiu (1):
      powerpc/eeh: powerpc/eeh: Fix undefined variable

Minghuan Lian (3):
      powerpc/dts: update MSI bindings doc for MPIC v4.3
      powerpc/dts: add MPIC v4.3 dts node
      powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3

Mingkai Hu (3):
      powerpc/85xx: Add SEC6.0 device tree
      powerpc/85xx: Add silicon device tree for C293
      powerpc/85xx: Add C293PCIE board support

Nathan Fontenot (1):
      powerpc/mm: Mark Memory Resources as busy

Paul Bolle (1):
      powerpc/8xx: Remove last traces of 8XX_MINIMAL_FPEMU

Paul Mackerras (8):
      powerpc: Implement __get_user_pages_fast()
      powerpc: Fix VRSAVE handling
      powerpc: Fix denormalized exception handler
      powerpc: Pull out cpu_core_mask updates into a separate function
      powerpc: Use ibm, chip-id property to compute cpu_core_mask if available
      powerpc: Work around gcc miscompilation of __pa() on 64-bit
      powerpc/xmon: Fix printing of set of CPUs in xmon
      powerpc: Correct FSCR bit definitions

Priyanka Jain (1):
      powerpc/perf: Add e6500 PMU driver

Scott Wood (5):
      powerpc/fsl-booke: Work around erratum A-006958
      powerpc: Convert some mftb/mftbu into mfspr
      powerpc/85xx: Remove -Wa,-me500
      powerpc/booke64: Use appropriate -mcpu
      powerpc/e500: Set -mcpu flag for 32-bit e500

Sebastian Siewior (1):
      powerpc: 52xx: provide a default in mpc52xx_irqhost_map()

Tiejun Chen (1):
      powerpc/ppc64: Rename SOFT_DISABLE_INTS with RECONCILE_IRQ_STATE

Tom Musta (1):
      powerpc: Unaligned stores and stmw are broken in emulation code

Tyrel Datwyler (8):
      powerpc/pseries: Fix creation of loop in device node property list
      powerpc/pseries: Fix over writing of rtas return code in update_dt_node
      powerpc/pseries: Pack update_props_workarea to map correctly to rtas buffer header
      powerpc/pseries: Fix parsing of initial node path in update_dt_node
      powerpc/pseries: Do all node initialization in dlpar_parse_cc_node
      powerpc/pseries: Make dlpar_configure_connector parent node aware
      powerpc/pseries: Add mising of_node_put in delete_dt_node
      powerpc/pseries: Child nodes are not detached by dlpar_detach_node

Vasant Hegde (1):
      powerpc: Make chip-id information available to userspace

Wang Dongsheng (1):
      powerpc: add Book E support to 64-bit hibernation

Wei Yongjun (1):
      powerpc/fsl_msi: fix error return code in fsl_of_msi_probe()

Yuanquan Chen (1):
      powerpc/pci: fix PCI-e check link issue

Zhenhua Luo (1):
      powerpc/fsl: Enable CONFIG_DEVTMPFS_MOUNT so /dev can be mounted correctly

 .../devicetree/bindings/crypto/fsl-sec6.txt        | 157 +++++++++
 .../devicetree/bindings/powerpc/fsl/msi-pic.txt    |  53 ++-
 Documentation/powerpc/00-INDEX                     |  11 +
 arch/powerpc/Kconfig                               |  21 ++
 arch/powerpc/Makefile                              |  18 +-
 arch/powerpc/boot/.gitignore                       |   1 +
 arch/powerpc/boot/dts/ac14xx.dts                   |   2 +-
 arch/powerpc/boot/dts/b4420qds.dts                 |   2 +-
 arch/powerpc/boot/dts/b4860qds.dts                 |   2 +-
 arch/powerpc/boot/dts/{b4qds.dts => b4qds.dtsi}    |   0
 arch/powerpc/boot/dts/c293pcie.dts                 | 223 +++++++++++++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi           |   2 +-
 arch/powerpc/boot/dts/fsl/c293si-post.dtsi         | 193 +++++++++++
 arch/powerpc/boot/dts/fsl/c293si-pre.dtsi          |  63 ++++
 arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi       | 149 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi      |  56 ++++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi        |   2 +-
 arch/powerpc/boot/dts/include/dt-bindings          |   1 +
 arch/powerpc/boot/dts/mpc5121ads.dts               |   2 +-
 arch/powerpc/boot/dts/p1020rdb-pd.dts              | 280 ++++++++++++++++
 arch/powerpc/boot/dts/p1023rdb.dts                 | 234 +++++++++++++
 arch/powerpc/boot/dts/pdm360ng.dts                 |   2 +-
 arch/powerpc/boot/ppc_asm.h                        |   3 +
 arch/powerpc/boot/util.S                           |  10 +-
 .../85xx/{p1023rds_defconfig => p1023_defconfig}   |  25 +-
 arch/powerpc/configs/corenet32_smp_defconfig       |   1 +
 arch/powerpc/configs/corenet64_smp_defconfig       |   3 +
 arch/powerpc/configs/mpc83xx_defconfig             |   1 +
 arch/powerpc/configs/mpc85xx_defconfig             |   2 +
 arch/powerpc/configs/mpc85xx_smp_defconfig         |   2 +
 arch/powerpc/include/asm/asm-compat.h              |   9 +
 arch/powerpc/include/asm/btext.h                   |   1 +
 arch/powerpc/include/asm/cacheflush.h              |   8 +-
 arch/powerpc/include/asm/cputable.h                |   9 +-
 arch/powerpc/include/asm/emulated_ops.h            |   2 -
 arch/powerpc/include/asm/epapr_hcalls.h            |   6 +
 arch/powerpc/include/asm/exception-64s.h           |  35 +-
 arch/powerpc/include/asm/io.h                      |  33 +-
 arch/powerpc/include/asm/irqflags.h                |   7 +-
 arch/powerpc/include/asm/lppaca.h                  |  68 ++--
 arch/powerpc/include/asm/mpc5121.h                 |  18 +-
 arch/powerpc/include/asm/mpc85xx.h                 |  92 +++++
 arch/powerpc/include/asm/mpic.h                    |   7 +
 arch/powerpc/include/asm/opal.h                    |  27 ++
 arch/powerpc/include/asm/paca.h                    |  11 +-
 arch/powerpc/include/asm/page.h                    |  10 +
 arch/powerpc/include/asm/pci-bridge.h              |   2 +-
 arch/powerpc/include/asm/perf_event_fsl_emb.h      |   2 +-
 .../pseries => include/asm}/plpar_wrappers.h       |  30 +-
 arch/powerpc/include/asm/ppc-opcode.h              |  47 +++
 arch/powerpc/include/asm/ppc_asm.h                 |  22 +-
 arch/powerpc/include/asm/prom.h                    |   7 +-
 arch/powerpc/include/asm/reg.h                     |  29 +-
 arch/powerpc/include/asm/reg_booke.h               |   8 +-
 arch/powerpc/include/asm/reg_fsl_emb.h             |  24 +-
 arch/powerpc/include/asm/rtas.h                    |   8 +-
 arch/powerpc/include/asm/smp.h                     |   3 +
 arch/powerpc/include/asm/spinlock.h                |   6 +-
 arch/powerpc/include/asm/switch_to.h               |  11 +-
 arch/powerpc/include/asm/timex.h                   |   4 +-
 arch/powerpc/include/asm/topology.h                |   1 +
 arch/powerpc/include/asm/udbg.h                    |   9 +-
 arch/powerpc/include/uapi/asm/elf.h                |  21 +-
 arch/powerpc/kernel/Makefile                       |   5 +-
 arch/powerpc/kernel/align.c                        |  14 +
 arch/powerpc/kernel/btext.c                        | 254 +++++++-------
 arch/powerpc/kernel/cacheinfo.c                    |  12 +-
 arch/powerpc/kernel/cpu_setup_fsl_booke.S          |   2 +-
 arch/powerpc/kernel/cputable.c                     |   2 +-
 arch/powerpc/kernel/entry_64.S                     |  46 +--
 arch/powerpc/kernel/epapr_paravirt.c               |  28 +-
 arch/powerpc/kernel/exceptions-64e.S               |   4 +-
 arch/powerpc/kernel/exceptions-64s.S               |  39 ++-
 arch/powerpc/kernel/head_40x.S                     |   8 -
 arch/powerpc/kernel/head_44x.S                     |  10 -
 arch/powerpc/kernel/head_64.S                      |   1 +
 arch/powerpc/kernel/head_8xx.S                     |   4 -
 arch/powerpc/kernel/head_fsl_booke.S               |  10 -
 arch/powerpc/kernel/io-workarounds.c               |  19 +-
 arch/powerpc/kernel/io.c                           |   3 +
 arch/powerpc/kernel/legacy_serial.c                |  62 ++--
 arch/powerpc/kernel/misc_32.S                      |   3 +-
 arch/powerpc/kernel/misc_64.S                      |  50 ++-
 arch/powerpc/kernel/paca.c                         |  10 +-
 arch/powerpc/kernel/pci-common.c                   |  13 +-
 arch/powerpc/kernel/pci_64.c                       |   4 +-
 arch/powerpc/kernel/pci_dn.c                       |  20 +-
 arch/powerpc/kernel/pci_of_scan.c                  |  23 +-
 arch/powerpc/kernel/ppc_ksyms.c                    |   3 +-
 arch/powerpc/kernel/process.c                      |   2 +
 arch/powerpc/kernel/prom.c                         |  90 +++--
 arch/powerpc/kernel/prom_init.c                    | 269 +++++++++------
 arch/powerpc/kernel/prom_init_check.sh             |   3 +-
 arch/powerpc/kernel/prom_parse.c                   |  17 +-
 arch/powerpc/kernel/rtas.c                         |  66 ++--
 arch/powerpc/kernel/setup-common.c                 |  13 +-
 arch/powerpc/kernel/setup_32.c                     |   4 +-
 arch/powerpc/kernel/setup_64.c                     |  36 +-
 arch/powerpc/kernel/signal_32.c                    |   9 +
 arch/powerpc/kernel/signal_64.c                    |  18 +-
 arch/powerpc/kernel/smp.c                          | 156 ++++++---
 arch/powerpc/kernel/softemu8xx.c                   | 199 -----------
 arch/powerpc/kernel/swsusp_asm64.S                 |  45 ++-
 arch/powerpc/kernel/swsusp_booke.S                 |   8 +
 arch/powerpc/kernel/time.c                         |  18 +-
 arch/powerpc/kernel/tm.S                           |   4 +-
 arch/powerpc/kernel/traps.c                        | 111 +++----
 arch/powerpc/kernel/udbg_16550.c                   | 370 +++++++++------------
 arch/powerpc/kernel/vdso32/gettimeofday.S          |   6 +-
 arch/powerpc/kernel/vio.c                          |  33 +-
 arch/powerpc/kvm/book3s_64_slb.S                   |   4 +
 arch/powerpc/kvm/book3s_hv.c                       |   2 +-
 arch/powerpc/kvm/book3s_hv_rm_mmu.c                |   4 +
 arch/powerpc/kvm/book3s_hv_rmhandlers.S            |  12 +
 arch/powerpc/kvm/emulate.c                         |  45 +--
 arch/powerpc/lib/locks.c                           |   4 +-
 arch/powerpc/lib/sstep.c                           |   8 +-
 arch/powerpc/math-emu/Makefile                     |  24 +-
 arch/powerpc/math-emu/math.c                       |  89 ++---
 arch/powerpc/mm/fault.c                            |   6 +-
 arch/powerpc/mm/gup.c                              |  37 ++-
 arch/powerpc/mm/hash_utils_64.c                    |   2 +-
 arch/powerpc/mm/mem.c                              |   2 +-
 arch/powerpc/mm/numa.c                             | 102 +++---
 arch/powerpc/mm/slb.c                              |   9 +-
 arch/powerpc/mm/subpage-prot.c                     |   4 +-
 arch/powerpc/oprofile/op_model_fsl_emb.c           |  30 ++
 arch/powerpc/perf/Makefile                         |   2 +-
 arch/powerpc/perf/core-book3s.c                    |   2 +-
 arch/powerpc/perf/core-fsl-emb.c                   |  30 ++
 arch/powerpc/perf/e6500-pmu.c                      | 121 +++++++
 arch/powerpc/platforms/52xx/mpc52xx_pic.c          |   3 +-
 arch/powerpc/platforms/85xx/Kconfig                |  10 +-
 arch/powerpc/platforms/85xx/Makefile               |   1 +
 arch/powerpc/platforms/85xx/c293pcie.c             |  75 +++++
 arch/powerpc/platforms/85xx/corenet_ds.c           |   6 -
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  22 ++
 arch/powerpc/platforms/85xx/p1023_rds.c            |  24 +-
 arch/powerpc/platforms/85xx/smp.c                  |  26 ++
 arch/powerpc/platforms/Kconfig                     |   7 +-
 arch/powerpc/platforms/Kconfig.cputype             |  13 +
 arch/powerpc/platforms/cell/iommu.c                |   2 +-
 arch/powerpc/platforms/cell/smp.c                  |  15 +-
 arch/powerpc/platforms/powernv/Kconfig             |   2 +
 arch/powerpc/platforms/powernv/Makefile            |   2 +-
 arch/powerpc/platforms/powernv/eeh-ioda.c          |  22 +-
 arch/powerpc/platforms/powernv/opal-lpc.c          | 203 +++++++++++
 arch/powerpc/platforms/powernv/opal-wrappers.S     |   5 +
 arch/powerpc/platforms/powernv/opal.c              |  18 +-
 arch/powerpc/platforms/powernv/pci-ioda.c          |  47 ++-
 arch/powerpc/platforms/powernv/powernv.h           |   2 +
 arch/powerpc/platforms/powernv/setup.c             |  17 +
 arch/powerpc/platforms/powernv/smp.c               |  18 +-
 arch/powerpc/platforms/pseries/Makefile            |   1 +
 arch/powerpc/platforms/pseries/cmm.c               |   3 +-
 arch/powerpc/platforms/pseries/dlpar.c             |  67 ++--
 arch/powerpc/platforms/pseries/dtl.c               |   5 +-
 arch/powerpc/platforms/pseries/hotplug-cpu.c       |   7 +-
 arch/powerpc/platforms/pseries/hvconsole.c         |  19 +-
 arch/powerpc/platforms/pseries/iommu.c             |  11 +-
 arch/powerpc/platforms/pseries/kexec.c             |   2 +-
 arch/powerpc/platforms/pseries/lpar.c              |  12 +-
 .../{kernel => platforms/pseries}/lparcfg.c        |  36 +-
 arch/powerpc/platforms/pseries/mobility.c          |  45 ++-
 arch/powerpc/platforms/pseries/processor_idle.c    |  12 +-
 arch/powerpc/platforms/pseries/pseries.h           |   5 +-
 arch/powerpc/platforms/pseries/pseries_energy.c    |   4 +-
 arch/powerpc/platforms/pseries/setup.c             |   6 +-
 arch/powerpc/platforms/pseries/smp.c               |  20 +-
 arch/powerpc/platforms/wsp/wsp.h                   |   1 -
 arch/powerpc/sysdev/fsl_msi.c                      | 137 +++++---
 arch/powerpc/sysdev/fsl_msi.h                      |  10 +-
 arch/powerpc/sysdev/fsl_pci.c                      | 184 ++++++++--
 arch/powerpc/sysdev/fsl_pci.h                      |   6 +
 arch/powerpc/sysdev/xics/icp-native.c              |   2 +-
 arch/powerpc/sysdev/xics/xics-common.c             |  10 +-
 arch/powerpc/xmon/xmon.c                           |  31 +-
 drivers/macintosh/ams/ams-input.c                  |   6 +-
 drivers/media/platform/fsl-viu.c                   |  23 +-
 drivers/mtd/nand/mpc5121_nfc.c                     |  21 +-
 drivers/tty/hvc/hvc_vio.c                          |   4 +-
 drivers/tty/hvc/hvsi_lib.c                         |   4 +-
 drivers/tty/serial/mpc52xx_uart.c                  |  98 +++++-
 drivers/usb/host/fsl-mph-dr-of.c                   |  16 +-
 tools/testing/selftests/Makefile                   |   1 +
 tools/testing/selftests/powerpc/Makefile           |  39 +++
 tools/testing/selftests/powerpc/harness.c          | 105 ++++++
 tools/testing/selftests/powerpc/pmu/Makefile       |  23 ++
 .../selftests/powerpc/pmu/count_instructions.c     | 135 ++++++++
 tools/testing/selftests/powerpc/pmu/event.c        | 105 ++++++
 tools/testing/selftests/powerpc/pmu/event.h        |  39 +++
 tools/testing/selftests/powerpc/pmu/loop.S         |  46 +++
 tools/testing/selftests/powerpc/subunit.h          |  47 +++
 tools/testing/selftests/powerpc/utils.h            |  34 ++
 194 files changed, 4899 insertions(+), 1786 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/crypto/fsl-sec6.txt
 rename arch/powerpc/boot/dts/{b4qds.dts => b4qds.dtsi} (100%)
 create mode 100644 arch/powerpc/boot/dts/c293pcie.dts
 create mode 100644 arch/powerpc/boot/dts/fsl/c293si-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/c293si-pre.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi
 create mode 120000 arch/powerpc/boot/dts/include/dt-bindings
 create mode 100644 arch/powerpc/boot/dts/p1020rdb-pd.dts
 create mode 100644 arch/powerpc/boot/dts/p1023rdb.dts
 rename arch/powerpc/configs/85xx/{p1023rds_defconfig => p1023_defconfig} (87%)
 create mode 100644 arch/powerpc/include/asm/mpc85xx.h
 rename arch/powerpc/{platforms/pseries => include/asm}/plpar_wrappers.h (90%)
 delete mode 100644 arch/powerpc/kernel/softemu8xx.c
 create mode 100644 arch/powerpc/perf/e6500-pmu.c
 create mode 100644 arch/powerpc/platforms/85xx/c293pcie.c
 create mode 100644 arch/powerpc/platforms/powernv/opal-lpc.c
 rename arch/powerpc/{kernel => platforms/pseries}/lparcfg.c (96%)
 create mode 100644 tools/testing/selftests/powerpc/Makefile
 create mode 100644 tools/testing/selftests/powerpc/harness.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/Makefile
 create mode 100644 tools/testing/selftests/powerpc/pmu/count_instructions.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/event.c
 create mode 100644 tools/testing/selftests/powerpc/pmu/event.h
 create mode 100644 tools/testing/selftests/powerpc/pmu/loop.S
 create mode 100644 tools/testing/selftests/powerpc/subunit.h
 create mode 100644 tools/testing/selftests/powerpc/utils.h

^ permalink raw reply

* [PATCH 2/6] powerpc/powernv: Support inbound error injection
From: Gavin Shan @ 2013-09-06  1:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1378429205-16248-1-git-send-email-shangw@linux.vnet.ibm.com>

For now, we only support outbound error injection. Actually, the
hardware supports injecting inbound errors as well. The patch enables
to inject inbound errors.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/eeh-ioda.c |   59 ++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 855c1d5..3ee44b0 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -66,26 +66,60 @@ static struct notifier_block ioda_eeh_nb = {
 };
 
 #ifdef CONFIG_DEBUG_FS
-static int ioda_eeh_dbgfs_set(void *data, u64 val)
+static int ioda_eeh_dbgfs_set(void *data, int offset, u64 val)
 {
 	struct pci_controller *hose = data;
 	struct pnv_phb *phb = hose->private_data;
 
-	out_be64(phb->regs + 0xD10, val);
+	out_be64(phb->regs + offset, val);
 	return 0;
 }
 
-static int ioda_eeh_dbgfs_get(void *data, u64 *val)
+static int ioda_eeh_dbgfs_get(void *data, int offset, u64 *val)
 {
 	struct pci_controller *hose = data;
 	struct pnv_phb *phb = hose->private_data;
 
-	*val = in_be64(phb->regs + 0xD10);
+	*val = in_be64(phb->regs + offset);
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_dbgfs_ops, ioda_eeh_dbgfs_get,
-			ioda_eeh_dbgfs_set, "0x%llx\n");
+static int ioda_eeh_outb_dbgfs_set(void *data, u64 val)
+{
+	return ioda_eeh_dbgfs_set(data, 0xD10, val);
+}
+
+static int ioda_eeh_outb_dbgfs_get(void *data, u64 *val)
+{
+	return ioda_eeh_dbgfs_get(data, 0xD10, val);
+}
+
+static int ioda_eeh_inbA_dbgfs_set(void *data, u64 val)
+{
+	return ioda_eeh_dbgfs_set(data, 0xD90, val);
+}
+
+static int ioda_eeh_inbA_dbgfs_get(void *data, u64 *val)
+{
+	return ioda_eeh_dbgfs_get(data, 0xD90, val);
+}
+
+static int ioda_eeh_inbB_dbgfs_set(void *data, u64 val)
+{
+	return ioda_eeh_dbgfs_set(data, 0xE10, val);
+}
+
+static int ioda_eeh_inbB_dbgfs_get(void *data, u64 *val)
+{
+	return ioda_eeh_dbgfs_get(data, 0xE10, val);
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_outb_dbgfs_ops, ioda_eeh_outb_dbgfs_get,
+			ioda_eeh_outb_dbgfs_set, "0x%llx\n");
+DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_inbA_dbgfs_ops, ioda_eeh_inbA_dbgfs_get,
+			ioda_eeh_inbA_dbgfs_set, "0x%llx\n");
+DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_inbB_dbgfs_ops, ioda_eeh_inbB_dbgfs_get,
+			ioda_eeh_inbB_dbgfs_set, "0x%llx\n");
 #endif /* CONFIG_DEBUG_FS */
 
 /**
@@ -123,10 +157,17 @@ static int ioda_eeh_post_init(struct pci_controller *hose)
 	}
 
 #ifdef CONFIG_DEBUG_FS
-	if (phb->dbgfs)
-		debugfs_create_file("err_injct", 0600,
+	if (phb->dbgfs) {
+		debugfs_create_file("err_injct_outbound", 0600,
+				    phb->dbgfs, hose,
+				    &ioda_eeh_outb_dbgfs_ops);
+		debugfs_create_file("err_injct_inboundA", 0600,
 				    phb->dbgfs, hose,
-				    &ioda_eeh_dbgfs_ops);
+				    &ioda_eeh_inbA_dbgfs_ops);
+		debugfs_create_file("err_injct_inboundB", 0600,
+				    phb->dbgfs, hose,
+				    &ioda_eeh_inbB_dbgfs_ops);
+	}
 #endif
 
 	phb->eeh_state |= PNV_EEH_STATE_ENABLED;
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 5/6] powerpc/eeh: Output PHB3 diag-data
From: Gavin Shan @ 2013-09-06  1:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1378429205-16248-1-git-send-email-shangw@linux.vnet.ibm.com>

The patch adds function ioda_eeh_phb3_phb_diag() to dump PHB3
PHB diag-data. That's called while detecting informative errors
or frozen PE on the specific PHB.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/opal.h           |   65 ++++++++++++++++++++++++++
 arch/powerpc/platforms/powernv/eeh-ioda.c |   70 +++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 029fe85..fed4b7d 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -444,10 +444,12 @@ enum {
 
 enum {
 	OPAL_PHB_ERROR_DATA_TYPE_P7IOC = 1,
+	OPAL_PHB_ERROR_DATA_TYPE_PHB3 = 2
 };
 
 enum {
 	OPAL_P7IOC_NUM_PEST_REGS = 128,
+	OPAL_PHB3_NUM_PEST_REGS = 256
 };
 
 struct OpalIoPhbErrorCommon {
@@ -515,6 +517,69 @@ struct OpalIoP7IOCPhbErrorData {
 	uint64_t pestB[OPAL_P7IOC_NUM_PEST_REGS];
 };
 
+struct OpalIoPhb3ErrorData {
+	struct OpalIoPhbErrorCommon common;
+
+	uint32_t brdgCtl;
+
+	/* PHB3 UTL regs */
+	uint32_t portStatusReg;
+	uint32_t rootCmplxStatus;
+	uint32_t busAgentStatus;
+
+	/* PHB3 cfg regs */
+	uint32_t deviceStatus;
+	uint32_t slotStatus;
+	uint32_t linkStatus;
+	uint32_t devCmdStatus;
+	uint32_t devSecStatus;
+
+	/* cfg AER regs */
+	uint32_t rootErrorStatus;
+	uint32_t uncorrErrorStatus;
+	uint32_t corrErrorStatus;
+	uint32_t tlpHdr1;
+	uint32_t tlpHdr2;
+	uint32_t tlpHdr3;
+	uint32_t tlpHdr4;
+	uint32_t sourceId;
+
+	uint32_t rsv3;
+
+	/* Record data about the call to allocate a buffer */
+	uint64_t errorClass;
+	uint64_t correlator;
+
+	uint64_t nFir;			/* 000 */
+	uint64_t nFirMask;		/* 003 */
+	uint64_t nFirWOF;		/* 008 */
+
+	/* PHB3 MMIO Error Regs */
+	uint64_t phbPlssr;		/* 120 */
+	uint64_t phbCsr;		/* 110 */
+	uint64_t lemFir;		/* C00 */
+	uint64_t lemErrorMask;		/* C18 */
+	uint64_t lemWOF;		/* C40 */
+	uint64_t phbErrorStatus;	/* C80 */
+	uint64_t phbFirstErrorStatus;	/* C88 */
+	uint64_t phbErrorLog0;		/* CC0 */
+	uint64_t phbErrorLog1;		/* CC8 */
+	uint64_t mmioErrorStatus;	/* D00 */
+	uint64_t mmioFirstErrorStatus;	/* D08 */
+	uint64_t mmioErrorLog0;		/* D40 */
+	uint64_t mmioErrorLog1;		/* D48 */
+	uint64_t dma0ErrorStatus;	/* D80 */
+	uint64_t dma0FirstErrorStatus;	/* D88 */
+	uint64_t dma0ErrorLog0;		/* DC0 */
+	uint64_t dma0ErrorLog1;		/* DC8 */
+	uint64_t dma1ErrorStatus;	/* E00 */
+	uint64_t dma1FirstErrorStatus;	/* E08 */
+	uint64_t dma1ErrorLog0;		/* E40 */
+	uint64_t dma1ErrorLog1;		/* E48 */
+	uint64_t pestA[OPAL_PHB3_NUM_PEST_REGS];
+	uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS];
+};
+
 typedef struct oppanel_line {
 	const char * 	line;
 	uint64_t 	line_len;
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index d60ba3b..be68fd8 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -754,6 +754,73 @@ static void ioda_eeh_p7ioc_phb_diag(struct pci_controller *hose,
 	}
 }
 
+static void ioda_eeh_phb3_phb_diag(struct pci_controller *hose,
+				    struct OpalIoPhbErrorCommon *common)
+{
+	struct OpalIoPhb3ErrorData *data;
+	int i;
+
+	data = (struct OpalIoPhb3ErrorData*)common;
+	pr_info("PHB3 PHB#%x Diag-data (Version: %d)\n\n",
+		hose->global_number, common->version);
+
+	pr_info("  brdgCtl:              %08x\n", data->brdgCtl);
+
+	pr_info("  portStatusReg:        %08x\n", data->portStatusReg);
+	pr_info("  rootCmplxStatus:      %08x\n", data->rootCmplxStatus);
+	pr_info("  busAgentStatus:       %08x\n", data->busAgentStatus);
+
+	pr_info("  deviceStatus:         %08x\n", data->deviceStatus);
+	pr_info("  slotStatus:           %08x\n", data->slotStatus);
+	pr_info("  linkStatus:           %08x\n", data->linkStatus);
+	pr_info("  devCmdStatus:         %08x\n", data->devCmdStatus);
+	pr_info("  devSecStatus:         %08x\n", data->devSecStatus);
+
+	pr_info("  rootErrorStatus:      %08x\n", data->rootErrorStatus);
+	pr_info("  uncorrErrorStatus:    %08x\n", data->uncorrErrorStatus);
+	pr_info("  corrErrorStatus:      %08x\n", data->corrErrorStatus);
+	pr_info("  tlpHdr1:              %08x\n", data->tlpHdr1);
+	pr_info("  tlpHdr2:              %08x\n", data->tlpHdr2);
+	pr_info("  tlpHdr3:              %08x\n", data->tlpHdr3);
+	pr_info("  tlpHdr4:              %08x\n", data->tlpHdr4);
+	pr_info("  sourceId:             %08x\n", data->sourceId);
+	pr_info("  errorClass:           %016llx\n", data->errorClass);
+	pr_info("  correlator:           %016llx\n", data->correlator);
+	pr_info("  nFir:                 %016llx\n", data->nFir);
+	pr_info("  nFirMask:             %016llx\n", data->nFirMask);
+	pr_info("  nFirWOF:              %016llx\n", data->nFirWOF);
+	pr_info("  PhbPlssr:             %016llx\n", data->phbPlssr);
+	pr_info("  PhbCsr:               %016llx\n", data->phbCsr);
+	pr_info("  lemFir:               %016llx\n", data->lemFir);
+	pr_info("  lemErrorMask:         %016llx\n", data->lemErrorMask);
+	pr_info("  lemWOF:               %016llx\n", data->lemWOF);
+	pr_info("  phbErrorStatus:       %016llx\n", data->phbErrorStatus);
+	pr_info("  phbFirstErrorStatus:  %016llx\n", data->phbFirstErrorStatus);
+	pr_info("  phbErrorLog0:         %016llx\n", data->phbErrorLog0);
+	pr_info("  phbErrorLog1:         %016llx\n", data->phbErrorLog1);
+	pr_info("  mmioErrorStatus:      %016llx\n", data->mmioErrorStatus);
+	pr_info("  mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus);
+	pr_info("  mmioErrorLog0:        %016llx\n", data->mmioErrorLog0);
+	pr_info("  mmioErrorLog1:        %016llx\n", data->mmioErrorLog1);
+	pr_info("  dma0ErrorStatus:      %016llx\n", data->dma0ErrorStatus);
+	pr_info("  dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus);
+	pr_info("  dma0ErrorLog0:        %016llx\n", data->dma0ErrorLog0);
+	pr_info("  dma0ErrorLog1:        %016llx\n", data->dma0ErrorLog1);
+	pr_info("  dma1ErrorStatus:      %016llx\n", data->dma1ErrorStatus);
+	pr_info("  dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus);
+	pr_info("  dma1ErrorLog0:        %016llx\n", data->dma1ErrorLog0);
+	pr_info("  dma1ErrorLog1:        %016llx\n", data->dma1ErrorLog1);
+
+	for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) {
+		if ((data->pestA[i] >> 63) == 0 &&
+		    (data->pestB[i] >> 63) == 0)
+			continue;
+
+		pr_info("  PE[%3d] PESTA:        %016llx\n", i, data->pestA[i]);
+		pr_info("          PESTB:        %016llx\n", data->pestB[i]);
+	}
+}
+
 static void ioda_eeh_phb_diag(struct pci_controller *hose)
 {
 	struct pnv_phb *phb = hose->private_data;
@@ -772,6 +839,9 @@ static void ioda_eeh_phb_diag(struct pci_controller *hose)
 	case OPAL_PHB_ERROR_DATA_TYPE_P7IOC:
 		ioda_eeh_p7ioc_phb_diag(hose, common);
 		break;
+	case OPAL_PHB_ERROR_DATA_TYPE_PHB3:
+		ioda_eeh_phb3_phb_diag(hose, common);
+		break;
 	default:
 		pr_warning("%s: Unrecognized I/O chip %d\n",
 			   __func__, common->ioType);
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 1/6] powerpc/powernv: Enable EEH for PHB3
From: Gavin Shan @ 2013-09-06  1:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1378429205-16248-1-git-send-email-shangw@linux.vnet.ibm.com>

The EEH isn't enabled for PHB3 and the patch intends to enable it.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/eeh-ioda.c    |   26 +++++++++++---------------
 arch/powerpc/platforms/powernv/eeh-powernv.c |    5 +----
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 0cd1c4a..855c1d5 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -113,27 +113,23 @@ static int ioda_eeh_post_init(struct pci_controller *hose)
 		ioda_eeh_nb_init = 1;
 	}
 
-	/* FIXME: Enable it for PHB3 later */
-	if (phb->type == PNV_PHB_IODA1) {
+	/* We needn't HUB diag-data on PHB3 */
+	if (phb->type == PNV_PHB_IODA1 && !hub_diag) {
+		hub_diag = (char *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
 		if (!hub_diag) {
-			hub_diag = (char *)__get_free_page(GFP_KERNEL |
-							   __GFP_ZERO);
-			if (!hub_diag) {
-				pr_err("%s: Out of memory !\n",
-				       __func__);
-				return -ENOMEM;
-			}
+			pr_err("%s: Out of memory !\n", __func__);
+			return -ENOMEM;
 		}
+	}
 
 #ifdef CONFIG_DEBUG_FS
-		if (phb->dbgfs)
-			debugfs_create_file("err_injct", 0600,
-					    phb->dbgfs, hose,
-					    &ioda_eeh_dbgfs_ops);
+	if (phb->dbgfs)
+		debugfs_create_file("err_injct", 0600,
+				    phb->dbgfs, hose,
+				    &ioda_eeh_dbgfs_ops);
 #endif
 
-		phb->eeh_state |= PNV_EEH_STATE_ENABLED;
-	}
+	phb->eeh_state |= PNV_EEH_STATE_ENABLED;
 
 	return 0;
 }
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c
index 79663d2..73b9814 100644
--- a/arch/powerpc/platforms/powernv/eeh-powernv.c
+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c
@@ -144,11 +144,8 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag)
 	/*
 	 * Enable EEH explicitly so that we will do EEH check
 	 * while accessing I/O stuff
-	 *
-	 * FIXME: Enable that for PHB3 later
 	 */
-	if (phb->type == PNV_PHB_IODA1)
-		eeh_subsystem_enabled = 1;
+	eeh_subsystem_enabled = 1;
 
 	/* Save memory bars */
 	eeh_save_bars(edev);
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 6/6] powerpc/eeh: Reorder output messages
From: Gavin Shan @ 2013-09-06  1:00 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1378429205-16248-1-git-send-email-shangw@linux.vnet.ibm.com>

We already had some output messages from EEH core. Occasionally,
we can see the output messages from EEH core before the stack
dump. That's not what we expected. The patch fixes that and shows
the stack dump prior to output messages from EEH core.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/eeh.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 55593ee..1fb331d 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -327,11 +327,11 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
 	/* Isolate the PHB and send event */
 	eeh_pe_state_mark(phb_pe, EEH_PE_ISOLATED);
 	eeh_serialize_unlock(flags);
-	eeh_send_failure_event(phb_pe);
 
 	pr_err("EEH: PHB#%x failure detected\n",
 		phb_pe->phb->global_number);
 	dump_stack();
+	eeh_send_failure_event(phb_pe);
 
 	return 1;
 out:
@@ -454,8 +454,6 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
 	eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
 	eeh_serialize_unlock(flags);
 
-	eeh_send_failure_event(pe);
-
 	/* Most EEH events are due to device driver bugs.  Having
 	 * a stack trace will help the device-driver authors figure
 	 * out what happened.  So print that out.
@@ -464,6 +462,8 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
 		pe->addr, pe->phb->global_number);
 	dump_stack();
 
+	eeh_send_failure_event(pe);
+
 	return 1;
 
 dn_unlock:
-- 
1.7.5.4

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox