LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Benjamin Herrenschmidt @ 2013-02-21 23:47 UTC (permalink / raw)
  To: Phileas Fogg; +Cc: linuxppc-dev
In-Reply-To: <51269A4B.1020501@mail.ru>

On Thu, 2013-02-21 at 23:06 +0100, Phileas Fogg wrote:
> Does it look like the new data at offset 0x80 and 0x88 in DT are MSR
> flags 
> MSR_DR, MSR_IR and MSR_EE ?

Yes, that looks plausible though I would have expected ME to be set as
well ... Or it could be a CCR value. But it does look like something
splattered the DT as if it was a stack... ie, bad r1 value.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH v6 00/46] CPU hotplug: stop_machine()-free CPU hotplug
From: Rusty Russell @ 2013-02-22  0:31 UTC (permalink / raw)
  To: Srivatsa S. Bhat, tglx, peterz, tj, oleg, paulmck, mingo, akpm,
	namhyung
  Cc: linux-arch, linux, nikunj, linux-pm, fweisbec, linux-doc,
	linux-kernel, rostedt, xiaoguangrong, rjw, sbw, wangyun,
	srivatsa.bhat, netdev, vincent.guittot, walken, linuxppc-dev,
	linux-arm-kernel
In-Reply-To: <20130218123714.26245.61816.stgit@srivatsabhat.in.ibm.com>

"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> writes:
> Hi,
>
> This patchset removes CPU hotplug's dependence on stop_machine() from the CPU
> offline path and provides an alternative (set of APIs) to preempt_disable() to
> prevent CPUs from going offline, which can be invoked from atomic context.
> The motivation behind the removal of stop_machine() is to avoid its ill-effects
> and thus improve the design of CPU hotplug. (More description regarding this
> is available in the patches).

If you're doing a v7, please put your benchmark results somewhere!

The obvious place is in the 44/46.

Thanks,
Rusty.

^ permalink raw reply

* Re: [RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage
From: David Gibson @ 2013-02-22  0:32 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: paulus, linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-6-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

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

On Thu, Feb 21, 2013 at 10:17:12PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> We now have PTE page consuming only 2K of the 64K page.This is in order to
> facilitate transparent huge page support, which works much better if our PMDs
> cover 16MB instead of 256MB.
> 
> Inorder to reduce the wastage, we now have multiple PTE page fragment
> from the same PTE page.

This needs a much better description of what you're doing here to
manage the allocations.  It's certainly not easy to figure out from
the code.


[snip]
> +#ifdef CONFIG_PPC_64K_PAGES
> +typedef pte_t *pgtable_t;
> +#else
>  typedef struct page *pgtable_t;
> +#endif

This looks really bogus.  A pgtable_t is a pointer to PTEs on 64K, but
a pointer to a struct page on 4k.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* [PATCH] powerpc: Remove unused postfix parameter to DEFINE_BITOP()
From: Michael Ellerman @ 2013-02-22  3:25 UTC (permalink / raw)
  To: linuxppc-dev

None of the users of DEFINE_BITOP pass a postfix, and as far as I can
tell none ever did, so drop it.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/include/asm/bitops.h |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index ef918a2..810c5fc 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -55,7 +55,7 @@
 #define BITOP_LE_SWIZZLE	((BITS_PER_LONG-1) & ~0x7)
 
 /* Macro for generating the ***_bits() functions */
-#define DEFINE_BITOP(fn, op, prefix, postfix)	\
+#define DEFINE_BITOP(fn, op, prefix)		\
 static __inline__ void fn(unsigned long mask,	\
 		volatile unsigned long *_p)	\
 {						\
@@ -68,16 +68,15 @@ static __inline__ void fn(unsigned long mask,	\
 	PPC405_ERR77(0,%3)			\
 	PPC_STLCX "%0,0,%3\n"			\
 	"bne- 1b\n"				\
-	postfix					\
 	: "=&r" (old), "+m" (*p)		\
 	: "r" (mask), "r" (p)			\
 	: "cc", "memory");			\
 }
 
-DEFINE_BITOP(set_bits, or, "", "")
-DEFINE_BITOP(clear_bits, andc, "", "")
-DEFINE_BITOP(clear_bits_unlock, andc, PPC_RELEASE_BARRIER, "")
-DEFINE_BITOP(change_bits, xor, "", "")
+DEFINE_BITOP(set_bits, or, "")
+DEFINE_BITOP(clear_bits, andc, "")
+DEFINE_BITOP(clear_bits_unlock, andc, PPC_RELEASE_BARRIER)
+DEFINE_BITOP(change_bits, xor, "")
 
 static __inline__ void set_bit(int nr, volatile unsigned long *addr)
 {
-- 
1.7.10.4

^ permalink raw reply related

* Re: [RFC PATCH -V2 01/21] powerpc: Use signed formatting when printing error
From: Paul Mackerras @ 2013-02-22  5:00 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:08PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> PAPR define these errors as negative values. So print them accordingly
       ^ defines

> for easy debugging.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Acked-by: Paul Mackerras <paulus@samba.org>

^ permalink raw reply

* Re: [RFC PATCH -V2 02/21] powerpc: Save DAR and DSISR in pt_regs on MCE
From: Paul Mackerras @ 2013-02-22  5:03 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-3-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:09PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> We were not saving DAR and DSISR on MCE. Save then and also print the values
> along with exception details in xmon.

The one reservation I have about this is that xmon will now be
printing bogus values on 32-bit and embedded processors.  However, it
seems 32-bit doesn't set regs->dar on a DSI (300) interrupt either.
So:

Acked-by: Paul Mackerras <paulus@samba.org>

^ permalink raw reply

* Re: [RFC PATCH -V2 03/21] powerpc: Don't hard code the size of pte page
From: Paul Mackerras @ 2013-02-22  5:06 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:10PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> USE PTRS_PER_PTE to indicate the size of pte page.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> powerpc: Don't hard code the size of pte page
> 
> USE PTRS_PER_PTE to indicate the size of pte page.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Description and signoff are duplicated.  Description could be more
informative, for example - why would we want to do this?

> +/*
> + * hidx is in the second half of the page table. We use the
> + * 8 bytes per each pte entry.

The casual reader probably wouldn't know what "hidx" is.  The comment
needs at least to use a better name than "hidx".

Paul.

^ permalink raw reply

* Re: [RFC PATCH -V2 04/21] powerpc: Reduce the PTE_INDEX_SIZE
From: Paul Mackerras @ 2013-02-22  5:07 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:11PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> This make one PMD cover 16MB range. That helps in easier implementation of THP
> on power. THP core code make use of one pmd entry to track the huge page and
> the range mapped by a single pmd entry should be equal to the huge page size
> supported by the hardware.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Acked-by: Paul Mackerras <paulus@samba.org>

^ permalink raw reply

* Re: [RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage
From: Aneesh Kumar K.V @ 2013-02-22  5:14 UTC (permalink / raw)
  To: David Gibson; +Cc: paulus, linuxppc-dev, linux-mm
In-Reply-To: <20130222003235.GJ21011@truffula.fritz.box>

David Gibson <david@gibson.dropbear.id.au> writes:

> On Thu, Feb 21, 2013 at 10:17:12PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>> 
>> We now have PTE page consuming only 2K of the 64K page.This is in order to
>> facilitate transparent huge page support, which works much better if our PMDs
>> cover 16MB instead of 256MB.
>> 
>> Inorder to reduce the wastage, we now have multiple PTE page fragment
>> from the same PTE page.
>
> This needs a much better description of what you're doing here to
> manage the allocations.  It's certainly not easy to figure out from
> the code.


I will add more detailed description in the commit message.

We allocate one page for the last level of linux page table. With THP and
large page size of 16MB, that would mean we are be wasting large part
of that page. To map 16MB area, we only need a PTE space of 2K with 64K
Page size. This patch reduce the space wastage by sharing the page
allocated for the last level of linux page table with multiple pmd
entries. We call these smaller chunks PTE page fragments and allocated
page, PTE page. We use the page->_mapcount as bitmap to indicate which
PTE fragments are free.


>
>
> [snip]
>> +#ifdef CONFIG_PPC_64K_PAGES
>> +typedef pte_t *pgtable_t;
>> +#else
>>  typedef struct page *pgtable_t;
>> +#endif
>
> This looks really bogus.  A pgtable_t is a pointer to PTEs on 64K, but
> a pointer to a struct page on 4k.
>

We enable all the above only with 64K Pages. 

-aneesh

^ permalink raw reply

* Re: [RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage
From: Paul Mackerras @ 2013-02-22  5:23 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-6-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:12PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> We now have PTE page consuming only 2K of the 64K page.This is in order to

In fact the PTE page together with the hash table indexes occupies 4k,
doesn't it?  The comments in the code are similarly confusing since
they talk about 2k but actually allocate 4k.

> facilitate transparent huge page support, which works much better if our PMDs
> cover 16MB instead of 256MB.
> 
> Inorder to reduce the wastage, we now have multiple PTE page fragment
  ^ In order (two words)

> from the same PTE page.

A patch like this needs a more complete description and explanation
than you have given.  For instance, you could mention that the code
that you're adding for the 32-bit and non-64k cases are just copies of
the previously generic code from pgalloc.h (actually, this movement
might be something that could be split out as a separate patch).
Also, you should describe in outline how you keep a list of pages that
aren't fully allocated and have a bitmap of which 4k sections are in
use, and also how your scheme interacts with RCU.

[snip]

> +#ifdef CONFIG_PPC_64K_PAGES
> +/*
> + * we support 15 fragments per PTE page. This is limited by how many

Why only 15?  Don't we get 16 fragments per page?

> + * bits we can pack in page->_mapcount. We use the first half for
> + * tracking the usage for rcu page table free.

What does "first" mean?  The high half or the low half?

> +unsigned long *page_table_alloc(struct mm_struct *mm, unsigned long vmaddr)
> +{
> +	struct page *page;
> +	unsigned int mask, bit;
> +	unsigned long *table;
> +
> +	/* Allocate fragments of a 4K page as 1K/2K page table */

A 4k page?  Do you mean a 64k page?  And what is 1K to do with
anything?

> +#ifdef CONFIG_SMP
> +static void __page_table_free_rcu(void *table)
> +{
> +	unsigned int bit;
> +	struct page *page;
> +	/*
> +	 * this is a PTE page free 2K page table
> +	 * fragment of a 64K page.
> +	 */
> +	page = virt_to_page(table);
> +	bit = 1 << ((__pa(table) & ~PAGE_MASK) / PTE_FRAG_SIZE);
> +	bit <<= FRAG_MASK_BITS;
> +	/*
> +	 * clear the higher half and if nobody used the page in
> +	 * between, even lower half would be zero.
> +	 */
> +	if (atomic_xor_bits(&page->_mapcount, bit) == 0) {
> +		pgtable_page_dtor(page);
> +		atomic_set(&page->_mapcount, -1);
> +		__free_page(page);
> +	}
> +}
> +
> +static void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table)
> +{
> +	struct page *page;
> +	struct mm_struct *mm;
> +	unsigned int bit, mask;
> +
> +	mm = tlb->mm;
> +	/* Free 2K page table fragment of a 64K page */
> +	page = virt_to_page(table);
> +	bit = 1 << ((__pa(table) & ~PAGE_MASK) / PTE_FRAG_SIZE);
> +	spin_lock(&mm->page_table_lock);
> +	/*
> +	 * stash the actual mask in higher half, and clear the lower half
> +	 * and selectively, add remove from pgtable list
> +	 */
> +	mask = atomic_xor_bits(&page->_mapcount, bit | (bit << FRAG_MASK_BITS));
> +	if (!(mask & FRAG_MASK))
> +		list_del(&page->lru);
> +	else {
> +		/*
> +		 * Add the page table page to pgtable_list so that
> +		 * the free fragment can be used by the next alloc
> +		 */
> +		list_del_init(&page->lru);
> +		list_add_tail(&page->lru, &mm->context.pgtable_list);
> +	}
> +	spin_unlock(&mm->page_table_lock);
> +	tlb_remove_table(tlb, table);
> +}

This looks like you're allowing a fragment that is being freed to be
reallocated and used again during the grace period when we are waiting
for any references to the fragment to disappear.  Doesn't that allow a
race where one CPU traversing the page table and using the fragment in
its old location in the tree could see a PTE created after the
fragment was reallocated?  In other words, why is it safe to allow the
fragment to be used during the grace period?  If it is safe, it at
least needs a comment explaining why.

Paul.

^ permalink raw reply

* Re: [RFC PATCH -V2 06/21] powerpc: Add size argument to pgtable_cache_add
From: Paul Mackerras @ 2013-02-22  5:27 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-7-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:13PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> We will use this later with THP changes. With THP we want to create PMD with
> twice the size. The second half will be used to depoist pgtable, which will
                                                  ^ deposit?
> carry the hpte hash index value

I'm not familiar with what "deposit" and "withdraw" mean in the THP
context.  If you can find a way to make the patch description more
informative for people who are not completely familiar with THP
(without adding a full-blown description of THP, of course) that would
be good.

Paul.

^ permalink raw reply

* Re: [RFC PATCH -V2 07/21] powerpc: Use encode avpn where we need only avpn values
From: Paul Mackerras @ 2013-02-22  5:28 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-8-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:14PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Needs a patch description.  What is the motivation for doing this?  Is
the new code completely equivalent to the old, or if not, what are the
differences?  Etc.

Paul.

^ permalink raw reply

* Re: [RFC PATCH -V2 08/21] powerpc: Decode the pte-lp-encoding bits correctly.
From: Paul Mackerras @ 2013-02-22  5:37 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <1361465248-10867-9-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Thu, Feb 21, 2013 at 10:17:15PM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
> 
> We look at both the segment base page size and actual page size and store
> the pte-lp-encodings in an array per base page size.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

This needs more than 2 lines of patch description.  In fact what
you're doing is adding general mixed page-size segment (MPSS)
support.  Doing this should mean that you can also get rid of the
MMU_PAGE_64K_AP value from the list in asm/mmu.h.

>  struct mmu_psize_def
>  {
>  	unsigned int	shift;	/* number of bits */
> -	unsigned int	penc;	/* HPTE encoding */
> +	unsigned int	penc[MMU_PAGE_COUNT];	/* HPTE encoding */

I guess this is reasonable, though adding space for 14 page size
encodings seems a little bit over the top.  Also, you don't seem to
have any way to indicate which encodings are valid, since 0 is a valid
encoding.  Maybe you need to add a valid bit higher up to indicate
which page sizes are valid.

> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 71d0c90..d2c9932 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -1515,7 +1515,12 @@ static void kvmppc_add_seg_page_size(struct kvm_ppc_one_seg_page_size **sps,
>  	(*sps)->page_shift = def->shift;
>  	(*sps)->slb_enc = def->sllp;
>  	(*sps)->enc[0].page_shift = def->shift;
> -	(*sps)->enc[0].pte_enc = def->penc;
> +	/*
> +	 * FIXME!!
> +	 * This is returned to user space. Do we need to
> +	 * return details of MPSS here ?

Yes, we do, probably a separate entry for each valid base/actual page
size pair.

> +static inline int hpte_actual_psize(struct hash_pte *hptep, int psize)
> +{
> +	unsigned int mask;
> +	int i, penc, shift;
> +	/* Look at the 8 bit LP value */
> +	unsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << (LP_BITS + 1)) - 1);

Why LP_BITS + 1 here?  You seem to be extracting and comparing 9 bits
rather than 8.  Why is that?

> @@ -395,12 +422,13 @@ static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
>  			/* valid entries have a shift value */
>  			if (!mmu_psize_defs[size].shift)
>  				continue;
> -
> -			if (penc == mmu_psize_defs[size].penc)
> -				break;
> +			for (a_size = 0; a_size < MMU_PAGE_COUNT; a_size++)
> +				if (penc == mmu_psize_defs[size].penc[a_size])
> +					goto out;

I think this will get false matches due to unused/invalid entries
in mmu_psize_defs[size].penc[] containing 0.

Paul.

^ permalink raw reply

* RE: [RFC][PATCH] powerpc: add Book E support to 64-bit hibernation
From: Wang Dongsheng-B40534 @ 2013-02-22  7:35 UTC (permalink / raw)
  To: benh@kernel.crashing.org, johannes@sipsolutions.net,
	linuxppc-dev@lists.ozlabs.org
  Cc: Wood Scott-B07421, Li Yang-R58472, Zhao Chenhui-B35336
In-Reply-To: <1360203915-22112-1-git-send-email-dongsheng.wang@freescale.com>

Hi Benjamin & Johannes,

Any thoughts about this patch?

> -----Original Message-----
> From: Wang Dongsheng-B40534
> Sent: Thursday, February 07, 2013 10:25 AM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Wood Scott-B07421; Li Yang-R58472; Zhao Chenhui-B35336; Wang
> Dongsheng-B40534
> Subject: [RFC][PATCH] powerpc: add Book E support to 64-bit hibernation
>=20
> Update the 64-bit hibernation code to support Book E CPUs.
> Some registers and instructions are not defined for Book3e
> (SDR reg, tlbia instruction).
> SDR: Storage Description Register. Book3S and Book3E have different
> address translation mode, we do not need HTABORG & HTABSIZE to
> translate virtual address to real address.
> More registers are saved in BookE-64bit.(TCR, SPRGx)
>=20
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> ---
>=20
> Hopefully someone can give me some advice about cache flush. It
> confused me that why only 1 MiB is flushed from KERNEL_START on
> Book3S. Is there a need to flush L2 cache if I have already flushed
> L1 cache? If yes, how about L3 cache? Cache levels are different
> in cores, the instruction sets may also be different.
>=20
>  1 files changed, 62 insertions(+), 2 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/swsusp_asm64.S
> b/arch/powerpc/kernel/swsusp_asm64.S
> index 86ac1d9..608e4ceb 100644
> --- a/arch/powerpc/kernel/swsusp_asm64.S
> +++ b/arch/powerpc/kernel/swsusp_asm64.S
> @@ -46,10 +46,29 @@
>  #define SL_r29		0xe8
>  #define SL_r30		0xf0
>  #define SL_r31		0xf8
> -#define SL_SIZE		SL_r31+8
> +#define SL_SPRG0	0x100
> +#define SL_SPRG1	0x108
> +#define SL_SPRG2	0x110
> +#define SL_SPRG3	0x118
> +#define SL_SPRG4	0x120
> +#define SL_SPRG5	0x128
> +#define SL_SPRG6	0x130
> +#define SL_SPRG7	0x138
> +#define SL_TCR		0x140
> +#define SL_SIZE		SL_TCR+8
>=20
>  /* these macros rely on the save area being
>   * pointed to by r11 */
> +
> +#define SAVE_SPR(register)		\
> +	mfspr	r0,SPRN_##register	;\
> +	std	r0,SL_##register(r11)
> +#define RESTORE_SPR(register)		\
> +	ld	r0,SL_##register(r11)	;\
> +	mtspr	SPRN_##register,r0
> +#define RESTORE_SPRG(n)			\
> +	ld	r0,SL_SPRG##n(r11)	;\
> +	mtsprg	n,r0
>  #define SAVE_SPECIAL(special)		\
>  	mf##special	r0		;\
>  	std	r0, SL_##special(r11)
> @@ -103,8 +122,21 @@ _GLOBAL(swsusp_arch_suspend)
>  	SAVE_REGISTER(r30)
>  	SAVE_REGISTER(r31)
>  	SAVE_SPECIAL(MSR)
> -	SAVE_SPECIAL(SDR1)
>  	SAVE_SPECIAL(XER)
> +#ifdef CONFIG_PPC_BOOK3S_64
> +	SAVE_SPECIAL(SDR1)
> +#else
> +	SAVE_SPR(TCR)
> +	/* Save SPRGs */
> +	SAVE_SPR(SPRG0)
> +	SAVE_SPR(SPRG1)
> +	SAVE_SPR(SPRG2)
> +	SAVE_SPR(SPRG3)
> +	SAVE_SPR(SPRG4)
> +	SAVE_SPR(SPRG5)
> +	SAVE_SPR(SPRG6)
> +	SAVE_SPR(SPRG7)
> +#endif
>=20
>  	/* we push the stack up 128 bytes but don't store the
>  	 * stack pointer on the stack like a real stackframe */
> @@ -151,6 +183,7 @@ copy_page_loop:
>  	bne+	copyloop
>  nothing_to_copy:
>=20
> +#ifdef CONFIG_PPC_BOOK3S_64
>  	/* flush caches */
>  	lis	r3, 0x10
>  	mtctr	r3
> @@ -167,6 +200,7 @@ nothing_to_copy:
>  	sync
>=20
>  	tlbia
> +#endif
>=20
>  	ld	r11,swsusp_save_area_ptr@toc(r2)
>=20
> @@ -208,16 +242,42 @@ nothing_to_copy:
>  	RESTORE_REGISTER(r29)
>  	RESTORE_REGISTER(r30)
>  	RESTORE_REGISTER(r31)
> +
> +#ifdef CONFIG_PPC_BOOK3S_64
>  	/* can't use RESTORE_SPECIAL(MSR) */
>  	ld	r0, SL_MSR(r11)
>  	mtmsrd	r0, 0
>  	RESTORE_SPECIAL(SDR1)
> +#else
> +	/* Save SPRGs */
> +	RESTORE_SPRG(0)
> +	RESTORE_SPRG(1)
> +	RESTORE_SPRG(2)
> +	RESTORE_SPRG(3)
> +	RESTORE_SPRG(4)
> +	RESTORE_SPRG(5)
> +	RESTORE_SPRG(6)
> +	RESTORE_SPRG(7)
> +
> +	RESTORE_SPECIAL(MSR)
> +
> +	/* Restore TCR and clear any pending bits in TSR. */
> +	RESTORE_SPR(TCR)
> +	lis	r0, (TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS)@h
> +	mtspr	SPRN_TSR,r0
> +
> +	/* Kick decrementer */
> +	li	r0,1
> +	mtdec	r0
> +#endif
>  	RESTORE_SPECIAL(XER)
>=20
>  	sync
>=20
>  	addi	r1,r1,-128
> +#ifdef CONFIG_PPC_BOOK3S_64
>  	bl	slb_flush_and_rebolt
> +#endif
>  	bl	do_after_copyback
>  	addi	r1,r1,128
>=20
> --
> 1.7.5.1

^ permalink raw reply

* Re: [RFC][PATCH] powerpc: add Book E support to 64-bit hibernation
From: Johannes Berg @ 2013-02-22  9:08 UTC (permalink / raw)
  To: Wang Dongsheng-B40534
  Cc: Zhao Chenhui-B35336, linuxppc-dev@lists.ozlabs.org,
	Li Yang-R58472, Wood Scott-B07421
In-Reply-To: <ABB05CD9C9F68C46A5CEDC7F15439259E728F2@039-SN2MPN1-021.039d.mgd.msft.net>

Hi,

> > Subject: [RFC][PATCH] powerpc: add Book E support to 64-bit hibernation

> Any thoughts about this patch?

Heh, honestly, no. I know nothing about Book E, and it's too long ago
that I wrote (some of) the 64-bit hibernation code.

johannes

^ permalink raw reply

* RE: [RFC][PATCH] powerpc: add Book E support to 64-bit hibernation
From: Wang Dongsheng-B40534 @ 2013-02-22  9:50 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Zhao Chenhui-B35336, linuxppc-dev@lists.ozlabs.org,
	Li Yang-R58472, Wood Scott-B07421
In-Reply-To: <1361524129.8146.1.camel@jlt4.sipsolutions.net>

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBKb2hhbm5lcyBCZXJnIFttYWls
dG86am9oYW5uZXNAc2lwc29sdXRpb25zLm5ldF0NCj4gU2VudDogRnJpZGF5LCBGZWJydWFyeSAy
MiwgMjAxMyA1OjA5IFBNDQo+IFRvOiBXYW5nIERvbmdzaGVuZy1CNDA1MzQNCj4gQ2M6IGJlbmhA
a2VybmVsLmNyYXNoaW5nLm9yZzsgbGludXhwcGMtZGV2QGxpc3RzLm96bGFicy5vcmc7IFdvb2Qg
U2NvdHQtDQo+IEIwNzQyMTsgTGkgWWFuZy1SNTg0NzI7IFpoYW8gQ2hlbmh1aS1CMzUzMzYNCj4g
U3ViamVjdDogUmU6IFtSRkNdW1BBVENIXSBwb3dlcnBjOiBhZGQgQm9vayBFIHN1cHBvcnQgdG8g
NjQtYml0DQo+IGhpYmVybmF0aW9uDQo+IA0KPiBIaSwNCj4gDQo+ID4gPiBTdWJqZWN0OiBbUkZD
XVtQQVRDSF0gcG93ZXJwYzogYWRkIEJvb2sgRSBzdXBwb3J0IHRvIDY0LWJpdA0KPiA+ID4gaGli
ZXJuYXRpb24NCj4gDQo+ID4gQW55IHRob3VnaHRzIGFib3V0IHRoaXMgcGF0Y2g/DQo+IA0KPiBI
ZWgsIGhvbmVzdGx5LCBuby4gSSBrbm93IG5vdGhpbmcgYWJvdXQgQm9vayBFLCBhbmQgaXQncyB0
b28gbG9uZyBhZ28NCj4gdGhhdCBJIHdyb3RlIChzb21lIG9mKSB0aGUgNjQtYml0IGhpYmVybmF0
aW9uIGNvZGUuDQo+IA0KVGhhbmtzIGZvciB5b3VyIGZlZWRiYWNrLg0KDQpDb3VsZCB5b3UgZ2l2
ZSBtZSBzb21lIGFkdmljZSBhYm91dCBjYWNoZSBmbHVzaC4gSXQgY29uZnVzZWQgbWUgdGhhdCB3
aHkNCm9ubHkgMSBNaUIgaXMgZmx1c2hlZCBmcm9tIEtFUk5FTF9TVEFSVCBvbiBQb3dlcm1hYyBH
NS4NCg0KT24gRlNMIEJvb2sgRShlNTAwIGZhbWlseSksIEV2ZW4gaWYgSSBkb24ndCBmbGFzaCBj
YWNoZSwgdGhlIHdvcmsgaXMNCmFsc28gbm9ybWFsKERjYWNoZXMgYXJlIGtlcHQgY29oZXJlbnQg
YnkgaGFyZHdhcmUsIGFuZCBpY2FjaGVzIGFyZSBrZXB0DQpjb2hlcmVudCBieSBzb2Z0d2FyZSku
IEJ1dCBJIHN0aWxsIHdvcnJ5IGFib3V0IGNhY2hlcy4gSXMgdGhlcmUgYSBuZWVkDQp0byBmbHVz
aCBMMiBjYWNoZSBpZiBJIGhhdmUgYWxyZWFkeSBmbHVzaGVkIEwxIGNhY2hlPyANCk9yIG9uIFBv
d2VybWFjIEc1LCBmbHVzaCBjYWNoZXMgaXMgYSBnZW5lcmFsIHdheT8NCg0KUG93ZXJtYWMgRzUg
Q29kZXM6DQogICAgICAgIC8qIGZsdXNoIGNhY2hlcyAqLw0KICAgICAgICBsaXMgICAgIHIzLCAw
eDEwDQogICAgICAgIG10Y3RyICAgcjMNCiAgICAgICAgbGkgICAgICByMywgMA0KICAgICAgICBv
cmkgICAgIHIzLCByMywgQ09ORklHX0tFUk5FTF9TVEFSVD4+NDgNCiAgICAgICAgbGkgICAgICBy
MCwgNDgNCiAgICAgICAgc2xkICAgICByMywgcjMsIHIwDQogICAgICAgIGxpICAgICAgcjAsIDAN
CjE6DQogICAgICAgIGRjYmYgICAgcjAscjMNCiAgICAgICAgYWRkaSAgICByMyxyMywweDIwDQog
ICAgICAgIGJkbnogICAgMWINCg0KICAgICAgICBzeW5jDQoNCiAgICAgICAgdGxiaWENCg0KPiBq
b2hhbm5lcw0KPiANCg==

^ permalink raw reply

* Re: [RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage
From: Aneesh Kumar K.V @ 2013-02-22 17:20 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <20130222052351.GE6139@drongo>

Paul Mackerras <paulus@samba.org> writes:

I will reply to the other parts in a seperate email, but the below

>> +static void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table)
>> +{
>> +	struct page *page;
>> +	struct mm_struct *mm;
>> +	unsigned int bit, mask;
>> +
>> +	mm = tlb->mm;
>> +	/* Free 2K page table fragment of a 64K page */
>> +	page = virt_to_page(table);
>> +	bit = 1 << ((__pa(table) & ~PAGE_MASK) / PTE_FRAG_SIZE);
>> +	spin_lock(&mm->page_table_lock);
>> +	/*
>> +	 * stash the actual mask in higher half, and clear the lower half
>> +	 * and selectively, add remove from pgtable list
>> +	 */
>> +	mask = atomic_xor_bits(&page->_mapcount, bit | (bit << FRAG_MASK_BITS));
>> +	if (!(mask & FRAG_MASK))
>> +		list_del(&page->lru);
>> +	else {
>> +		/*
>> +		 * Add the page table page to pgtable_list so that
>> +		 * the free fragment can be used by the next alloc
>> +		 */
>> +		list_del_init(&page->lru);
>> +		list_add_tail(&page->lru, &mm->context.pgtable_list);
>> +	}
>> +	spin_unlock(&mm->page_table_lock);
>> +	tlb_remove_table(tlb, table);
>> +}
>
> This looks like you're allowing a fragment that is being freed to be
> reallocated and used again during the grace period when we are waiting
> for any references to the fragment to disappear.  Doesn't that allow a
> race where one CPU traversing the page table and using the fragment in
> its old location in the tree could see a PTE created after the
> fragment was reallocated?  In other words, why is it safe to allow the
> fragment to be used during the grace period?  If it is safe, it at
> least needs a comment explaining why.
>

We don't allow it to be reallocated during the grace period. The trick
is in the below lines of page_table_alloc()

		/*
		 * Update with the higher order mask bits accumulated,
		 * added as a part of rcu free.
		 */
		mask = mask | (mask >> FRAG_MASK_BITS);

When checking for mask, we also look at the higher order bits.

The reason we add the page back to &mm->context.pgtable_list in
page_table_free_rcu is because we need to have access to struct
mm_struct. We don't have that in the rcu call back. So we add early and
make sure we don't reallocate them, until the grace period is over.

I will definitely add more comments around the code to clarify these details.

-aneesh

^ permalink raw reply

* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Phileas Fogg @ 2013-02-22 20:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1361490374.4676.58.camel@pasglop>

Benjamin Herrenschmidt wrote:
> On Thu, 2013-02-21 at 22:44 +0100, Phileas Fogg wrote:
>> Stripped OpenWRT image:
>> ------------------------
>>
>> c00000000001a474:       48 00 00 05     bl      0xc00000000001a478
>> c00000000001a478:       7c a8 02 a6     mflr    r5
>> c00000000001a47c:       38 a5 00 1c     addi    r5,r5,28
>> c00000000001a480:       7c 21 0b 78     mr      r1,r1
>> c00000000001a484:       80 85 00 00     lwz     r4,0(r5)
>> c00000000001a488:       2c 04 00 00     cmpwi   r4,0
>> c00000000001a48c:       40 82 00 62     bnea-   0x60
>> c00000000001a490:       4b ff ff f0     b       0xc00000000001a480
>> c00000000001a494:       00 00 00 00     .long 0x0
>> c00000000001a498:       a0 6d 00 48     lhz     r3,72(r13)
>> c00000000001a49c:       48 00 00 11     bl      0xc00000000001a4ac
>
>
> Smell like a bad stack pointer to me...
>
> One thing I noticed is that kexec doesn't seem to hard disable
> interrupts, which is ... fishy at best. It should do that
> before it switches stacks around. Dunno if that's the cause
> of the problem but it might be worth adding a hard_irq_disable()
> after all the local_irq_disable(), making sure we are hard
> disabled before going into asm.
>
> Cheers,
> Ben.
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>

Hi,

i wanted to let you know that i tested your advice. And let me say, it's was a 
damn good advice :) I can boot FreeBSD loader on Linux 3.8 now, no SHA256 
checksum failures. And no panics with FreeBSD LiveCD anymore too.

I just inserted hard_irq_disable() after each local_irq_disable() in 
arch/powerpc/kernel/machine_kexec_64.c

Thanks

regards

^ permalink raw reply

* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Benjamin Herrenschmidt @ 2013-02-22 19:52 UTC (permalink / raw)
  To: Phileas Fogg; +Cc: linuxppc-dev
In-Reply-To: <5127D9CE.2090500@mail.ru>

On Fri, 2013-02-22 at 21:49 +0100, Phileas Fogg wrote:
> i wanted to let you know that i tested your advice. And let me say, it's was a 
> damn good advice :) I can boot FreeBSD loader on Linux 3.8 now, no SHA256 
> checksum failures. And no panics with FreeBSD LiveCD anymore too.
> 
> I just inserted hard_irq_disable() after each local_irq_disable() in 
> arch/powerpc/kernel/machine_kexec_64.c

Awesome ! :-)

Care to send a patch with a Signed-off-by: ?

Cheers,
Ben.

^ permalink raw reply

* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Phileas Fogg @ 2013-02-22 23:41 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1361562773.15017.36.camel@pasglop>

Benjamin Herrenschmidt wrote:
> On Fri, 2013-02-22 at 21:49 +0100, Phileas Fogg wrote:
>> i wanted to let you know that i tested your advice. And let me say, it's was a
>> damn good advice :) I can boot FreeBSD loader on Linux 3.8 now, no SHA256
>> checksum failures. And no panics with FreeBSD LiveCD anymore too.
>>
>> I just inserted hard_irq_disable() after each local_irq_disable() in
>> arch/powerpc/kernel/machine_kexec_64.c
>
> Awesome ! :-)
>
> Care to send a patch with a Signed-off-by: ?
>
> Cheers,
> Ben.
>
>

No problem, but as i said it was your idea how to fix the issue with kexec.
Anyways here is the patch which i tested on my PS3 console with Linux 3.8.
After applying this patch i can boot any Linux kernel starting with 2.6,
FreeBSD loader, FreeBSD LiveCD and my own tiny ELF kernels too.
Even OpenBSD bootloader starts now too :)
And i don't see any failed SHA256 checksums in the purgatory code.

regards

 From c17cdf38dfe180b4a571827bb547aaf9b678cf29 Mon Sep 17 00:00:00 2001
From: Phileas Fogg <phileas-fogg@mail.ru>
Date: Sat, 23 Feb 2013 00:32:19 +0100
Subject: [PATCH] kexec: disable hard IRQ before kexec

Disable hard IRQ before kexec a new kernel image.
Not doing it can result in corrupted data in the memory segments
reserved for the new kernel.
---
  arch/powerpc/kernel/machine_kexec_64.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/machine_kexec_64.c 
b/arch/powerpc/kernel/machine_kexec_64.c
index 7206701..e08b9d0 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -162,6 +162,7 @@ static int kexec_all_irq_disabled = 0;
  static void kexec_smp_down(void *arg)
  {
  	local_irq_disable();
+	hard_irq_disable();
  	mb(); /* make sure our irqs are disabled before we say they are */
  	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
  	while(kexec_all_irq_disabled == 0)
@@ -244,6 +245,7 @@ static void kexec_prepare_cpus(void)
  	wake_offline_cpus();
  	smp_call_function(kexec_smp_down, NULL, /* wait */0);
  	local_irq_disable();
+	hard_irq_disable();
  	mb(); /* make sure IRQs are disabled before we say they are */
  	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;

@@ -281,6 +283,7 @@ static void kexec_prepare_cpus(void)
  	if (ppc_md.kexec_cpu_down)
  		ppc_md.kexec_cpu_down(0, 0);
  	local_irq_disable();
+	hard_irq_disable();
  }

  #endif /* SMP */
-- 
1.8.1.4

^ permalink raw reply related

* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Benjamin Herrenschmidt @ 2013-02-22 22:45 UTC (permalink / raw)
  To: Phileas Fogg; +Cc: linuxppc-dev
In-Reply-To: <51280223.9070109@mail.ru>

On Sat, 2013-02-23 at 00:41 +0100, Phileas Fogg wrote:
> Benjamin Herrenschmidt wrote:
> > On Fri, 2013-02-22 at 21:49 +0100, Phileas Fogg wrote:
> >> i wanted to let you know that i tested your advice. And let me say, it's was a
> >> damn good advice :) I can boot FreeBSD loader on Linux 3.8 now, no SHA256
> >> checksum failures. And no panics with FreeBSD LiveCD anymore too.
> >>
> >> I just inserted hard_irq_disable() after each local_irq_disable() in
> >> arch/powerpc/kernel/machine_kexec_64.c
> >
> > Awesome ! :-)
> >
> > Care to send a patch with a Signed-off-by: ?
>
> No problem, but as i said it was your idea how to fix the issue with kexec.
> Anyways here is the patch which i tested on my PS3 console with Linux 3.8.
> After applying this patch i can boot any Linux kernel starting with 2.6,
> FreeBSD loader, FreeBSD LiveCD and my own tiny ELF kernels too.
> Even OpenBSD bootloader starts now too :)
> And i don't see any failed SHA256 checksums in the purgatory code.

Thanks, but I still need the Signed-off-by: line before i can apply
it :-) (legal...)

Cheers,
Ben.

> regards
> 
>  From c17cdf38dfe180b4a571827bb547aaf9b678cf29 Mon Sep 17 00:00:00 2001
> From: Phileas Fogg <phileas-fogg@mail.ru>
> Date: Sat, 23 Feb 2013 00:32:19 +0100
> Subject: [PATCH] kexec: disable hard IRQ before kexec
> 
> Disable hard IRQ before kexec a new kernel image.
> Not doing it can result in corrupted data in the memory segments
> reserved for the new kernel.
> ---
>   arch/powerpc/kernel/machine_kexec_64.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/machine_kexec_64.c 
> b/arch/powerpc/kernel/machine_kexec_64.c
> index 7206701..e08b9d0 100644
> --- a/arch/powerpc/kernel/machine_kexec_64.c
> +++ b/arch/powerpc/kernel/machine_kexec_64.c
> @@ -162,6 +162,7 @@ static int kexec_all_irq_disabled = 0;
>   static void kexec_smp_down(void *arg)
>   {
>   	local_irq_disable();
> +	hard_irq_disable();
>   	mb(); /* make sure our irqs are disabled before we say they are */
>   	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
>   	while(kexec_all_irq_disabled == 0)
> @@ -244,6 +245,7 @@ static void kexec_prepare_cpus(void)
>   	wake_offline_cpus();
>   	smp_call_function(kexec_smp_down, NULL, /* wait */0);
>   	local_irq_disable();
> +	hard_irq_disable();
>   	mb(); /* make sure IRQs are disabled before we say they are */
>   	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
> 
> @@ -281,6 +283,7 @@ static void kexec_prepare_cpus(void)
>   	if (ppc_md.kexec_cpu_down)
>   		ppc_md.kexec_cpu_down(0, 0);
>   	local_irq_disable();
> +	hard_irq_disable();
>   }
> 
>   #endif /* SMP */

^ permalink raw reply

* Re: PS3: Strange issue with kexec and FreeBSD loader
From: Phileas Fogg @ 2013-02-22 23:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1361573108.15017.39.camel@pasglop>

Benjamin Herrenschmidt wrote:
> On Sat, 2013-02-23 at 00:41 +0100, Phileas Fogg wrote:
>> Benjamin Herrenschmidt wrote:
>>> On Fri, 2013-02-22 at 21:49 +0100, Phileas Fogg wrote:
>>>> i wanted to let you know that i tested your advice. And let me say, it's was a
>>>> damn good advice :) I can boot FreeBSD loader on Linux 3.8 now, no SHA256
>>>> checksum failures. And no panics with FreeBSD LiveCD anymore too.
>>>>
>>>> I just inserted hard_irq_disable() after each local_irq_disable() in
>>>> arch/powerpc/kernel/machine_kexec_64.c
>>>
>>> Awesome ! :-)
>>>
>>> Care to send a patch with a Signed-off-by: ?
>>
>> No problem, but as i said it was your idea how to fix the issue with kexec.
>> Anyways here is the patch which i tested on my PS3 console with Linux 3.8.
>> After applying this patch i can boot any Linux kernel starting with 2.6,
>> FreeBSD loader, FreeBSD LiveCD and my own tiny ELF kernels too.
>> Even OpenBSD bootloader starts now too :)
>> And i don't see any failed SHA256 checksums in the purgatory code.
>
> Thanks, but I still need the Signed-off-by: line before i can apply
> it :-) (legal...)
>
> Cheers,
> Ben.
>
>> regards
>>
>>   From c17cdf38dfe180b4a571827bb547aaf9b678cf29 Mon Sep 17 00:00:00 2001
>> From: Phileas Fogg <phileas-fogg@mail.ru>
>> Date: Sat, 23 Feb 2013 00:32:19 +0100
>> Subject: [PATCH] kexec: disable hard IRQ before kexec
>>
>> Disable hard IRQ before kexec a new kernel image.
>> Not doing it can result in corrupted data in the memory segments
>> reserved for the new kernel.
>> ---
>>    arch/powerpc/kernel/machine_kexec_64.c | 3 +++
>>    1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/powerpc/kernel/machine_kexec_64.c
>> b/arch/powerpc/kernel/machine_kexec_64.c
>> index 7206701..e08b9d0 100644
>> --- a/arch/powerpc/kernel/machine_kexec_64.c
>> +++ b/arch/powerpc/kernel/machine_kexec_64.c
>> @@ -162,6 +162,7 @@ static int kexec_all_irq_disabled = 0;
>>    static void kexec_smp_down(void *arg)
>>    {
>>    	local_irq_disable();
>> +	hard_irq_disable();
>>    	mb(); /* make sure our irqs are disabled before we say they are */
>>    	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
>>    	while(kexec_all_irq_disabled == 0)
>> @@ -244,6 +245,7 @@ static void kexec_prepare_cpus(void)
>>    	wake_offline_cpus();
>>    	smp_call_function(kexec_smp_down, NULL, /* wait */0);
>>    	local_irq_disable();
>> +	hard_irq_disable();
>>    	mb(); /* make sure IRQs are disabled before we say they are */
>>    	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
>>
>> @@ -281,6 +283,7 @@ static void kexec_prepare_cpus(void)
>>    	if (ppc_md.kexec_cpu_down)
>>    		ppc_md.kexec_cpu_down(0, 0);
>>    	local_irq_disable();
>> +	hard_irq_disable();
>>    }
>>
>>    #endif /* SMP */
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>

Next attempt.


Signed-off-by: Phileas Fogg <phileas-fogg@mail.ru>
---

 From c17cdf38dfe180b4a571827bb547aaf9b678cf29 Mon Sep 17 00:00:00 2001
From: Phileas Fogg <phileas-fogg@mail.ru>
Date: Sat, 23 Feb 2013 00:32:19 +0100
Subject: [PATCH] kexec: disable hard IRQ before kexec

Disable hard IRQ before kexec a new kernel image.
Not doing it can result in corrupted data in the memory segments
reserved for the new kernel.
---
  arch/powerpc/kernel/machine_kexec_64.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/kernel/machine_kexec_64.c 
b/arch/powerpc/kernel/machine_kexec_64.c
index 7206701..e08b9d0 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -162,6 +162,7 @@ static int kexec_all_irq_disabled = 0;
  static void kexec_smp_down(void *arg)
  {
  	local_irq_disable();
+	hard_irq_disable();
  	mb(); /* make sure our irqs are disabled before we say they are */
  	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;
  	while(kexec_all_irq_disabled == 0)
@@ -244,6 +245,7 @@ static void kexec_prepare_cpus(void)
  	wake_offline_cpus();
  	smp_call_function(kexec_smp_down, NULL, /* wait */0);
  	local_irq_disable();
+	hard_irq_disable();
  	mb(); /* make sure IRQs are disabled before we say they are */
  	get_paca()->kexec_state = KEXEC_STATE_IRQS_OFF;

@@ -281,6 +283,7 @@ static void kexec_prepare_cpus(void)
  	if (ppc_md.kexec_cpu_down)
  		ppc_md.kexec_cpu_down(0, 0);
  	local_irq_disable();
+	hard_irq_disable();
  }

  #endif /* SMP */
-- 
1.8.1.4

^ permalink raw reply related

* Re: [RFC PATCH -V2 03/21] powerpc: Don't hard code the size of pte page
From: Aneesh Kumar K.V @ 2013-02-23 16:17 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <20130222050607.GC6139@drongo>

Paul Mackerras <paulus@samba.org> writes:

> On Thu, Feb 21, 2013 at 10:17:10PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>> 
>> USE PTRS_PER_PTE to indicate the size of pte page.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> powerpc: Don't hard code the size of pte page
>> 
>> USE PTRS_PER_PTE to indicate the size of pte page.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> Description and signoff are duplicated.  Description could be more
> informative, for example - why would we want to do this?
>
>> +/*
>> + * hidx is in the second half of the page table. We use the
>> + * 8 bytes per each pte entry.
>
> The casual reader probably wouldn't know what "hidx" is.  The comment
> needs at least to use a better name than "hidx".

how about

+/*
+ * We save the slot number & secondary bit in the second half of the
+ * PTE page. We use the 8 bytes per each pte entry.
+ */


-aneesh

^ permalink raw reply

* Re: [RFC PATCH -V2 05/21] powerpc: Reduce PTE table memory wastage
From: Aneesh Kumar K.V @ 2013-02-23 16:38 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-mm
In-Reply-To: <20130222052351.GE6139@drongo>

Paul Mackerras <paulus@samba.org> writes:

> On Thu, Feb 21, 2013 at 10:17:12PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>> 
>> We now have PTE page consuming only 2K of the 64K page.This is in order to
>
> In fact the PTE page together with the hash table indexes occupies 4k,
> doesn't it?  The comments in the code are similarly confusing since
> they talk about 2k but actually allocate 4k.
>
>> facilitate transparent huge page support, which works much better if our PMDs
>> cover 16MB instead of 256MB.
>> 
>> Inorder to reduce the wastage, we now have multiple PTE page fragment
>   ^ In order (two words)
>
>> from the same PTE page.
>
> A patch like this needs a more complete description and explanation
> than you have given.  For instance, you could mention that the code
> that you're adding for the 32-bit and non-64k cases are just copies of
> the previously generic code from pgalloc.h (actually, this movement
> might be something that could be split out as a separate patch).
> Also, you should describe in outline how you keep a list of pages that
> aren't fully allocated and have a bitmap of which 4k sections are in
> use, and also how your scheme interacts with RCU.

will do

>
> [snip]
>
>> +#ifdef CONFIG_PPC_64K_PAGES
>> +/*
>> + * we support 15 fragments per PTE page. This is limited by how many
>
> Why only 15?  Don't we get 16 fragments per page?
>

That was one of the details I wanted to come back and closely look at
before posting. But missed that in the excitement of getting this
all working :). ._mapcount is a signed value and hence I was not sure
whether setting the top bit have any impact on how we deal with the page
in other part of VM. 


>> + * bits we can pack in page->_mapcount. We use the first half for
>> + * tracking the usage for rcu page table free.
>
> What does "first" mean?  The high half or the low half?
>

high half.

>> +unsigned long *page_table_alloc(struct mm_struct *mm, unsigned long vmaddr)
>> +{
>> +	struct page *page;
>> +	unsigned int mask, bit;
>> +	unsigned long *table;
>> +
>> +	/* Allocate fragments of a 4K page as 1K/2K page table */
>
> A 4k page?  Do you mean a 64k page?  And what is 1K to do with
> anything?
>

That should be completely dropped, Cut-paste from s390 code :)

>> +#ifdef CONFIG_SMP
>> +static void __page_table_free_rcu(void *table)
>> +{
>> +	unsigned int bit;
>> +	struct page *page;
>> +	/*
>> +	 * this is a PTE page free 2K page table
>> +	 * fragment of a 64K page.
>> +	 */
>> +	page = virt_to_page(table);
>> +	bit = 1 << ((__pa(table) & ~PAGE_MASK) / PTE_FRAG_SIZE);
>> +	bit <<= FRAG_MASK_BITS;
>> +	/*
>> +	 * clear the higher half and if nobody used the page in
>> +	 * between, even lower half would be zero.
>> +	 */
>> +	if (atomic_xor_bits(&page->_mapcount, bit) == 0) {
>> +		pgtable_page_dtor(page);
>> +		atomic_set(&page->_mapcount, -1);
>> +		__free_page(page);
>> +	}
>> +}
>> +
>> +static void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table)
>> +{
>> +	struct page *page;
>> +	struct mm_struct *mm;
>> +	unsigned int bit, mask;
>> +
>> +	mm = tlb->mm;
>> +	/* Free 2K page table fragment of a 64K page */
>> +	page = virt_to_page(table);
>> +	bit = 1 << ((__pa(table) & ~PAGE_MASK) / PTE_FRAG_SIZE);
>> +	spin_lock(&mm->page_table_lock);
>> +	/*
>> +	 * stash the actual mask in higher half, and clear the lower half
>> +	 * and selectively, add remove from pgtable list
>> +	 */
>> +	mask = atomic_xor_bits(&page->_mapcount, bit | (bit << FRAG_MASK_BITS));
>> +	if (!(mask & FRAG_MASK))
>> +		list_del(&page->lru);
>> +	else {
>> +		/*
>> +		 * Add the page table page to pgtable_list so that
>> +		 * the free fragment can be used by the next alloc
>> +		 */
>> +		list_del_init(&page->lru);
>> +		list_add_tail(&page->lru, &mm->context.pgtable_list);
>> +	}
>> +	spin_unlock(&mm->page_table_lock);
>> +	tlb_remove_table(tlb, table);
>> +}

-aneesh

^ permalink raw reply

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

Hi Linus !

So from the depth of frozen Minnesota, here's the powerpc pull request
for 3.9. It has a few interesting highlights, in addition to the usual
bunch of bug fixes, minor updates, embedded device tree updates and new
boards:

 - Hand tuned asm implementation of SHA1 (by Paulus & Michael Ellerman)

 - Support for Doorbell interrupts on Power8 (kind of fast thread-thread
IPIs) by Ian Munsie

 - Long overdue cleanup of the way we handle relocation of our open
firmware trampoline (prom_init.c) on 64-bit by Anton Blanchard

 - Support for saving/restoring & context switching the PPR (Processor
Priority Register) on server processors that support it. This allows the
kernel to preserve thread priorities established by userspace. By Haren
Myneni.

 - DAWR (new watchpoint facility) support on Power8 by Michael Neuling

 - Ability to change the DSCR (Data Stream Control Register) which
controls cache prefetching on a running process via ptrace by Alexey
Kardashevskiy

 - Support for context switching the TAR register on Power8 (new branch
target register meant to be used by some new specific userspace perf
event interrupt facility which is yet to be enabled) by Ian Munsie.

 - Improve preservation of the CFAR register (which captures the origin
of a branch) on various exception conditions by Paulus.

 - Move the Bestcomm DMA driver from arch powerpc to drivers/dma where
it belongs by Philippe De Muyter

 - Support for Transactional Memory on Power8 by Michael Neuling
(based on original work by Matt Evans). For those curious about the
feature, the patch contains a pretty good description.

Cheers,
Ben.

The following changes since commit 689dfa894c57842a05bf6dc9f97e6bb71ec5f386:

  powerpc: Max next_tb to prevent from replaying timer interrupt (2013-01-29 10:18:16 +1100)

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 8520e443aa56cc157b015205ea53e7b9fc831291:

  powerpc/kexec: Disable hard IRQ before kexec (2013-02-24 03:49:28 +1100)

----------------------------------------------------------------
Alexey Kardashevskiy (1):
      powerpc: Add DSCR support to ptrace

Anatolij Gustschin (11):
      powerpc/mpc5121: add common .dtsi and use it in mpc5121ads.dts
      powerpc/mpc5121: pdm360ng.dts: use common mpc5121.dtsi
      mpc5121: remove obsolete cell-index property from PSC clock code
      mpc5121: don't check PSC ac97 using node name
      powerpc/512x: initialize clocks before bus probing
      drivers/video: fsl-diu-fb: fix pixel formats for 24 and 16 bpp
      drivers/video: fsl-diu-fb: fix bugs in interrupt handling
      powerpc/512x: add function for chip select parameter configuration
      powerpc/mpc512x: fix noderef sparse warnings
      powerpc/mpc512x: fix sparce warnings for non static symbols
      powerpc/mpc5xxx: fix sparse warning for non static symbol

Anshuman Khandual (1):
      powerpc/perf: Change PMU flag representation from decimal to hex

Anton Blanchard (7):
      powerpc: Relocate prom_init.c on 64bit
      powerpc: Remove RELOC() macro
      powerpc: Build kernel with -mcmodel=medium
      powerpc: Run savedefconfig over pseries, ppc64 and ppc64e defconfig
      powerpc: Cleanup NLS config options on pseries, ppc64 and ppc64e defconfig
      powerpc: Enable devtmpfs, EFI partition support and tmpfs ACLs on pseries, ppc64 and ppc64e defconfig
      powerpc: Avoid load of static chain register when calling nested functions through a pointer on 64bit

Benjamin Collins (1):
      powerpc: Add support for CTS-1000 GPIO controlled system poweroff

Benjamin Herrenschmidt (4):
      powerpc: Make room in exception vector area
      Merge branch 'merge' into next
      Merge remote-tracking branch 'kumar/next' into next
      Merge remote-tracking branch 'agust/next' into next

Chris Freehill (1):
      powerpc/perf: Add stalled-cycles events

Cody P Schafer (1):
      powerpc/mm: Eliminate unneeded for_each_memblock

Daniel Borkmann (1):
      powerpc: fix ics_rtas_init and start_secondary section mismatch

David Woodhouse (1):
      powerpc: Enable ARCH_USE_BUILTIN_BSWAP

Geoff Levand (4):
      powerpc/ps3: Add macro PS3_VERBOSE_RESULT
      powerpc/ps3: Increase verbosity of htab errors
      powerpc/ps3: Refresh ps3_defconfig
      powerpc: Move boot_paca into early_setup

Gerlando Falauto (2):
      powerpc/83xx: refactor mpc8360e quirk for kmeter1
      powerpc/83xx: apply mpc8360e quirk for kmeter1 only when par_io is present

Gernot Vormayr (1):
      powerpc/dts/virtex440: Add ethernet phy to virtex440-ml507 board

Grant Likely (2):
      powerpc/5200: Add Lite5200 on-board LEDs as devices
      powerpc/5200: Use the gpt* labels to simplify mpc5200 dts files

Haren Myneni (6):
      powerpc: Move branch instruction from ACCOUNT_CPU_USER_ENTRY to caller
      powerpc: Enable PPR save/restore
      powerpc: Increase exceptions arrays in paca struct to save PPR
      powerpc: Define ppr in thread_struct
      powerpc: Macros for saving/restore PPR
      powerpc: Implement PPR save/restore

Harninder Rai (2):
      powerpc/85xx: bsc9131 - Correct typo in SDHC device node
      powerpc/85xx: l2sram - Add compatible string for BSC9131 platform

Holger Brunck (3):
      powerpc/82xx: fix checkpatch warnings for km82xx.c
      powerpc/83xx: fix checkpatch warnings for km83xx.c
      powerpc/83xx: update kmeter1_defconfig

Ian Munsie (10):
      powerpc: Define differences between doorbells on book3e and book3s
      powerpc: Add book3s hypervisor doorbell exception vectors
      powerpc: Add book3s privileged doorbell exception vectors
      powerpc: Select either privileged or hypervisor doorbell when sending
      powerpc: Add code to handle soft-disabled doorbells on server
      powerpc: Update Kconfig + Makefile to prepare for server doorbells
      powerpc: Hook up doorbells on server
      powerpc: Disable relocation on exceptions whenever PR KVM is active
      powerpc: Add helper functions set the DAWR and CIABR using set_mode
      powerpc: Add support for context switching the TAR register

Jason Gunthorpe (1):
      powerpc: Enable the Watchdog vector for 405

Jimi Xenidis (1):
      powerpc/kexec: Add kexec "hold" support for Book3e processors

Joe Perches (1):
      powerpc: Convert print_symbol to %pSR

Julia Lawall (1):
      arch/powerpc/platforms/85xx/p1022_ds.c: adjust duplicate test

Kim Phillips (4):
      powerpc/fsl: lbc: sparse fixes
      powerpc/fsl: fsl_soc: sparse fixes
      powerpc/fsl: ifc: sparse fixes
      powerpc/fsl: msi: sparse fixes

Li Zhong (3):
      powerpc: Fix a lazy irq related WARING in arch_local_irq_restore()
      powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32
      powerpc: Avoid debug_smp_processor_id() check in SHARED_PROCESSOR

Michael Ellerman (2):
      powerpc: Add a powerpc implementation of SHA-1
      powerpc: Apply early paca fixups to boot_paca and the boot cpu's paca

Michael Neuling (32):
      powerpc/pseries: Allow firmware features to match partial strings
      powerpc/pseries: Cleanup best_energy_hcall detection
      powerpc: Remove extra zeros from 32 bit CPU features definitions
      powerpc: Repack 64bit CPU features to remove holes
      powerpc: Add DAWR CPU feature bit definition
      powerpc: Add DAWR/X SPR number definitions
      powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers
      powerpc: Add the DAWR support to the set_break()
      powerpc/perf: Fix finding overflowed PMC in interrupt
      powerpc/perf: Fix for PMCs not making progress
      powerpc: Fix typo in breakpoint kgdb code.
      powerpc: Rename set_break to avoid naming conflict
      powerpc/ptrace: Make #defines for all request numbers hex
      powerpc: Add length setting to set_dawr
      powerpc: Change hardware breakpoint to allow longer ranges
      powerpc: Add new CPU feature bit for transactional memory
      powerpc: Add new instructions for transactional memory
      powerpc: Add additional state needed for transactional memory to thread struct
      powerpc: New macros for transactional memory support
      powerpc: Register defines for various transactional memory registers
      powerpc: Add transactional memory paca scratch register to show_regs
      powerpc: Add helper functions for transactional memory context switching
      powerpc: Add FP/VSX and VMX register load functions for transactional memory
      powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes
      powerpc: Add transactional memory unavaliable execption handler
      powerpc: Routines for FP/VSX/VMX unavailable during a transaction
      powerpc: Hook in new transactional memory code
      powerpc: Add new transactional memory state to the signal context
      powerpc: Add transactional memory to POWER8 cpu features
      powerpc: Add config option for transactional memory
      powerpc: Add transactional memory to pseries and ppc64 defconfigs
      powerpc: Documentation for transactional memory on powerpc

Nishanth Aravamudan (4):
      pseries/iommu: Fix iteration in DDW TCE clearrange
      pseries/iommu: Ensure TCEs are cleared with non-huge DDW
      pseries/iommu: Restore_default_window does not use liobn parameter
      pseries/iommu: Remove DDW on kexec

Olof Johansson (1):
      powerpc/pasemi: Enable PRINTK_TIME in defconfig

Paul Gortmaker (4):
      powerpc/85xx: split sbc8548 dts file into pre and post chunks
      powerpc/85xx: update sbc8548 flash information to match recent u-boot
      powerpc/85xx: add alternate dts file for sbc8548 boot via SODIMM
      powerpc/85xx: enable MTD options in sbc8548 defconfig

Paul Mackerras (4):
      powerpc: Remove Cell-specific relocation-on interrupt vector code
      powerpc: Save CFAR before branching in interrupt entry paths
      powerpc/kvm/book3s_hv: Preserve guest CFAR register value
      powerpc/kvm/book3s_pr: Fix compilation on 32-bit machines

Phileas Fogg (1):
      powerpc/kexec: Disable hard IRQ before kexec

Philippe De Muyter (1):
      powerpc, dma: move bestcomm driver from arch/powerpc/sysdev to drivers/dma

Po Liu (1):
      powerpc/85xx: dts - add ranges property for SEC

Scott Wood (4):
      powerpc/mpic: Make distribute_irqs obey MPIC_SINGLE_DEST_CPU
      powerpc/fsl: Remove CONFIG_IRQ_ALL_CPUS from mpc85xx/mpc86xx defconfig
      powerpc/mpic: allow coreint to be determined by MPIC version
      powerpc/e500/qemu-e500: enable coreint

Stef van Os (1):
      powerpc/85xx: Board support for ppa8548

Suzuki K. Poulose (1):
      uprobes/powerpc: Add dependency on single step emulation

Thadeu Lima de Souza Cascardo (3):
      powerpc/iommu: Prevent false TCE leak message
      powerpc/eeh/of: Checking for CONFIG_EEH is not needed
      powerpc/eeh: Fix crash when adding a device in a slot with DDW

Thomas Waldecker (1):
      Documentation/powerpc: Fix path to the powerpc directory

Timur Tabi (3):
      powerpc/85xx: describe the PAMU topology in the device tree
      powerpc/85xx: fix various PCI node compatible strings
      powerpc/fsl: remove extraneous DIU platform functions

Tushar Behera (1):
      powerpc/pseries/pci: Use NULL instead of 0 for pointers

Vakul Garg (1):
      crypto: caam - Added property fsl, sec-era in SEC4.0 device tree binding.

Varun Sethi (1):
      powerpc/fsl_pci: Store the pci ctlr device ptr in the pci ctlr struct

Vinh Nguyen Huu Tuong (1):
      powerpc/44x: Support OCM(On Chip Memory) for APM821xx SoC and Bluestone board

Wei Yongjun (5):
      powerpc/windfarm: Use for_each_node_by_type() macro
      tty/hvsi: Use for_each_compatible_node() macro
      powerpc/celleb: Use for_each_compatible_node() macro
      powerpc/82xx: Use for_each_compatible_node() macro
      powerpc/85xx: use for_each_compatible_node() macro

sukadev@linux.vnet.ibm.com (1):
      perf/Power: PERF_EVENT_IOC_ENABLE does not reenable event

 .../devicetree/bindings/crypto/fsl-sec4.txt        |   12 +-
 .../devicetree/bindings/powerpc/fsl/guts.txt       |   13 +-
 .../devicetree/bindings/powerpc/fsl/pamu.txt       |  140 +++++
 Documentation/powerpc/cpu_features.txt             |   10 +-
 Documentation/powerpc/transactional_memory.txt     |  175 ++++++
 arch/powerpc/Kconfig                               |   13 +
 arch/powerpc/Makefile                              |   22 +-
 arch/powerpc/boot/dts/a3m071.dts                   |    6 +-
 arch/powerpc/boot/dts/a4m072.dts                   |   27 +-
 arch/powerpc/boot/dts/bluestone.dts                |    8 +
 arch/powerpc/boot/dts/bsc9131rdb.dtsi              |    2 +-
 arch/powerpc/boot/dts/cm5200.dts                   |    6 +-
 arch/powerpc/boot/dts/digsy_mtc.dts                |   14 +-
 arch/powerpc/boot/dts/fsl/p1010si-post.dtsi        |    4 +-
 arch/powerpc/boot/dts/fsl/p1022si-post.dtsi        |    6 +-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |   87 ++-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |   87 ++-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        |   74 ++-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |   92 ++-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |   92 ++-
 arch/powerpc/boot/dts/fsl/pq3-sec4.4-0.dtsi        |    1 +
 arch/powerpc/boot/dts/lite5200b.dts                |   23 +-
 arch/powerpc/boot/dts/media5200.dts                |    6 +-
 arch/powerpc/boot/dts/motionpro.dts                |   26 +-
 arch/powerpc/boot/dts/mpc5121.dtsi                 |  410 +++++++++++++
 arch/powerpc/boot/dts/mpc5121ads.dts               |  319 ++--------
 arch/powerpc/boot/dts/mpc5200b.dtsi                |   25 +-
 arch/powerpc/boot/dts/mucmc52.dts                  |   48 +-
 arch/powerpc/boot/dts/o2d.dtsi                     |   27 +-
 arch/powerpc/boot/dts/pcm030.dts                   |   48 +-
 arch/powerpc/boot/dts/pcm032.dts                   |   45 +-
 arch/powerpc/boot/dts/pdm360ng.dts                 |  273 +--------
 arch/powerpc/boot/dts/ppa8548.dts                  |  166 ++++++
 arch/powerpc/boot/dts/sbc8548-altflash.dts         |  115 ++++
 arch/powerpc/boot/dts/sbc8548-post.dtsi            |  295 +++++++++
 arch/powerpc/boot/dts/sbc8548-pre.dtsi             |   52 ++
 arch/powerpc/boot/dts/sbc8548.dts                  |  356 +----------
 arch/powerpc/boot/dts/uc101.dts                    |   52 +-
 arch/powerpc/boot/dts/virtex440-ml507.dts          |    6 +
 arch/powerpc/configs/83xx/kmeter1_defconfig        |    6 +-
 arch/powerpc/configs/85xx/ge_imp3a_defconfig       |    1 -
 arch/powerpc/configs/85xx/ppa8548_defconfig        |   65 ++
 arch/powerpc/configs/85xx/sbc8548_defconfig        |   19 +
 arch/powerpc/configs/86xx/gef_ppc9a_defconfig      |    1 -
 arch/powerpc/configs/86xx/gef_sbc310_defconfig     |    1 -
 arch/powerpc/configs/86xx/gef_sbc610_defconfig     |    1 -
 arch/powerpc/configs/86xx/sbc8641d_defconfig       |    1 -
 arch/powerpc/configs/corenet32_smp_defconfig       |    1 -
 arch/powerpc/configs/corenet64_smp_defconfig       |    1 -
 arch/powerpc/configs/mpc85xx_smp_defconfig         |    1 -
 arch/powerpc/configs/pasemi_defconfig              |   31 +-
 arch/powerpc/configs/ppc64_defconfig               |  147 ++---
 arch/powerpc/configs/ppc64e_defconfig              |  107 +---
 arch/powerpc/configs/ps3_defconfig                 |   15 +-
 arch/powerpc/configs/pseries_defconfig             |   91 +--
 arch/powerpc/crypto/Makefile                       |    9 +
 arch/powerpc/crypto/sha1-powerpc-asm.S             |  179 ++++++
 arch/powerpc/crypto/sha1.c                         |  157 +++++
 arch/powerpc/include/asm/cputable.h                |  126 ++--
 arch/powerpc/include/asm/dbell.h                   |   30 +-
 arch/powerpc/include/asm/debug.h                   |   15 +-
 arch/powerpc/include/asm/eeh.h                     |    3 +
 arch/powerpc/include/asm/exception-64s.h           |  138 ++++-
 arch/powerpc/include/asm/firmware.h                |    3 +-
 arch/powerpc/include/asm/hvcall.h                  |    9 +
 arch/powerpc/include/asm/hw_breakpoint.h           |   35 +-
 arch/powerpc/include/asm/kvm_book3s_asm.h          |    3 +
 arch/powerpc/include/asm/kvm_host.h                |    1 +
 arch/powerpc/include/asm/machdep.h                 |    4 +
 arch/powerpc/include/asm/mpc5121.h                 |   17 +
 arch/powerpc/include/asm/paca.h                    |   10 +-
 arch/powerpc/include/asm/perf_event_server.h       |   10 +-
 arch/powerpc/include/asm/ppc-opcode.h              |   13 +
 arch/powerpc/include/asm/ppc4xx_ocm.h              |   45 ++
 arch/powerpc/include/asm/ppc_asm.h                 |  110 +++-
 arch/powerpc/include/asm/processor.h               |   48 +-
 arch/powerpc/include/asm/ps3.h                     |    2 +-
 arch/powerpc/include/asm/reg.h                     |   43 +-
 arch/powerpc/include/asm/sections.h                |    3 +
 arch/powerpc/include/asm/spinlock.h                |    2 +-
 arch/powerpc/include/asm/tm.h                      |   20 +
 arch/powerpc/include/uapi/asm/ptrace.h             |   29 +-
 arch/powerpc/kernel/Makefile                       |   10 +-
 arch/powerpc/kernel/asm-offsets.c                  |   34 ++
 arch/powerpc/kernel/cpu_setup_power.S              |    7 +
 arch/powerpc/kernel/dbell.c                        |    4 +-
 arch/powerpc/kernel/entry_64.S                     |   43 +-
 arch/powerpc/kernel/exceptions-64e.S               |    3 +-
 arch/powerpc/kernel/exceptions-64s.S               |  351 +++++++----
 arch/powerpc/kernel/fpu.S                          |   66 +++
 arch/powerpc/kernel/head_40x.S                     |   47 +-
 arch/powerpc/kernel/head_64.S                      |   34 +-
 arch/powerpc/kernel/hw_breakpoint.c                |   84 ++-
 arch/powerpc/kernel/iommu.c                        |    7 +
 arch/powerpc/kernel/irq.c                          |   11 +-
 arch/powerpc/kernel/kgdb.c                         |   10 +-
 arch/powerpc/kernel/machine_kexec_64.c             |    5 +
 arch/powerpc/kernel/module_64.c                    |   30 +
 arch/powerpc/kernel/of_platform.c                  |    7 +-
 arch/powerpc/kernel/paca.c                         |    2 -
 arch/powerpc/kernel/pci-common.c                   |    7 +-
 arch/powerpc/kernel/process.c                      |  241 +++++++-
 arch/powerpc/kernel/prom_init.c                    |  626 ++++++++++----------
 arch/powerpc/kernel/prom_init_check.sh             |    2 +-
 arch/powerpc/kernel/ptrace.c                       |   89 ++-
 arch/powerpc/kernel/ptrace32.c                     |    8 +-
 arch/powerpc/kernel/setup_64.c                     |   18 +-
 arch/powerpc/kernel/signal.c                       |    5 +-
 arch/powerpc/kernel/signal.h                       |    8 +
 arch/powerpc/kernel/signal_32.c                    |  500 +++++++++++++++-
 arch/powerpc/kernel/signal_64.c                    |  337 ++++++++++-
 arch/powerpc/kernel/smp.c                          |    2 +-
 arch/powerpc/kernel/tm.S                           |  388 ++++++++++++
 arch/powerpc/kernel/traps.c                        |  150 ++++-
 arch/powerpc/kernel/vector.S                       |   51 ++
 arch/powerpc/kernel/vmlinux.lds.S                  |    5 +
 arch/powerpc/kvm/book3s_hv_rmhandlers.S            |    9 +
 arch/powerpc/kvm/book3s_pr.c                       |   19 +
 arch/powerpc/lib/Makefile                          |    6 +-
 arch/powerpc/mm/Makefile                           |    2 +-
 arch/powerpc/mm/fault.c                            |    4 +-
 arch/powerpc/mm/hash_utils_64.c                    |   16 +
 arch/powerpc/mm/mem.c                              |   11 +-
 arch/powerpc/oprofile/Makefile                     |    2 +-
 arch/powerpc/perf/core-book3s.c                    |   93 ++-
 arch/powerpc/perf/e500-pmu.c                       |    2 +
 arch/powerpc/platforms/44x/Kconfig                 |    8 +
 arch/powerpc/platforms/512x/clock.c                |   34 +-
 arch/powerpc/platforms/512x/mpc512x_shared.c       |   37 +-
 arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c      |    6 +-
 arch/powerpc/platforms/82xx/km82xx.c               |    6 +-
 arch/powerpc/platforms/82xx/pq2.c                  |    4 +-
 arch/powerpc/platforms/83xx/km83xx.c               |  161 ++---
 arch/powerpc/platforms/85xx/Kconfig                |   15 +
 arch/powerpc/platforms/85xx/Makefile               |    2 +
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |    4 +-
 arch/powerpc/platforms/85xx/p1022_ds.c             |   40 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c            |   12 -
 arch/powerpc/platforms/85xx/ppa8548.c              |   98 +++
 arch/powerpc/platforms/85xx/qemu_e500.c            |    7 +-
 arch/powerpc/platforms/85xx/sgy_cts1000.c          |  176 ++++++
 arch/powerpc/platforms/Kconfig                     |    2 -
 arch/powerpc/platforms/Kconfig.cputype             |    6 +
 arch/powerpc/platforms/cell/celleb_scc_sio.c       |    5 +-
 arch/powerpc/platforms/cell/spu_callbacks.c        |   13 +-
 arch/powerpc/platforms/ps3/htab.c                  |   14 +-
 arch/powerpc/platforms/pseries/Kconfig             |    1 +
 arch/powerpc/platforms/pseries/Makefile            |    2 +-
 arch/powerpc/platforms/pseries/eeh.c               |   24 +-
 arch/powerpc/platforms/pseries/firmware.c          |   21 +-
 arch/powerpc/platforms/pseries/hotplug-cpu.c       |    8 +
 arch/powerpc/platforms/pseries/iommu.c             |  104 ++--
 arch/powerpc/platforms/pseries/pci.c               |    3 +-
 arch/powerpc/platforms/pseries/plpar_wrappers.h    |   18 +
 arch/powerpc/platforms/pseries/pseries_energy.c    |   37 +-
 arch/powerpc/platforms/pseries/setup.c             |   20 +-
 arch/powerpc/platforms/pseries/smp.c               |   33 +-
 arch/powerpc/platforms/wsp/Makefile                |    2 +-
 arch/powerpc/sysdev/Makefile                       |    4 +-
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c              |    1 +
 arch/powerpc/sysdev/fsl_ifc.c                      |    2 +-
 arch/powerpc/sysdev/fsl_lbc.c                      |    6 +-
 arch/powerpc/sysdev/fsl_msi.c                      |    4 +-
 arch/powerpc/sysdev/fsl_pci.c                      |   24 +-
 arch/powerpc/sysdev/fsl_pci.h                      |    2 +-
 arch/powerpc/sysdev/fsl_soc.c                      |    4 +-
 arch/powerpc/sysdev/mpc5xxx_clocks.c               |    4 +-
 arch/powerpc/sysdev/mpic.c                         |   28 +-
 arch/powerpc/sysdev/ppc4xx_ocm.c                   |  415 +++++++++++++
 arch/powerpc/sysdev/xics/ics-rtas.c                |    2 +-
 arch/powerpc/xmon/Makefile                         |    2 +-
 arch/powerpc/xmon/xmon.c                           |   21 +-
 crypto/Kconfig                                     |    7 +
 drivers/Makefile                                   |    2 +-
 drivers/ata/pata_mpc52xx.c                         |    6 +-
 drivers/dma/Kconfig                                |    2 +
 drivers/dma/Makefile                               |    1 +
 .../sysdev => drivers/dma}/bestcomm/Kconfig        |    0
 .../sysdev => drivers/dma}/bestcomm/Makefile       |    0
 .../powerpc/sysdev => drivers/dma}/bestcomm/ata.c  |    6 +-
 .../dma}/bestcomm/bcom_ata_task.c                  |    0
 .../dma}/bestcomm/bcom_fec_rx_task.c               |    0
 .../dma}/bestcomm/bcom_fec_tx_task.c               |    0
 .../dma}/bestcomm/bcom_gen_bd_rx_task.c            |    0
 .../dma}/bestcomm/bcom_gen_bd_tx_task.c            |    0
 .../sysdev => drivers/dma}/bestcomm/bestcomm.c     |    6 +-
 .../powerpc/sysdev => drivers/dma}/bestcomm/fec.c  |    6 +-
 .../sysdev => drivers/dma}/bestcomm/gen_bd.c       |    6 +-
 .../powerpc/sysdev => drivers/dma}/bestcomm/sram.c |    2 +-
 drivers/macintosh/windfarm_pm112.c                 |    2 +-
 drivers/macintosh/windfarm_pm72.c                  |    2 +-
 drivers/macintosh/windfarm_rm31.c                  |    2 +-
 drivers/net/ethernet/freescale/fec_mpc52xx.c       |    4 +-
 drivers/tty/hvc/hvsi.c                             |    4 +-
 drivers/video/fsl-diu-fb.c                         |   64 +-
 .../sysdev => include/linux/fsl}/bestcomm/ata.h    |    0
 .../linux/fsl}/bestcomm/bestcomm.h                 |    0
 .../linux/fsl}/bestcomm/bestcomm_priv.h            |    0
 .../sysdev => include/linux/fsl}/bestcomm/fec.h    |    0
 .../sysdev => include/linux/fsl}/bestcomm/gen_bd.h |    0
 .../sysdev => include/linux/fsl}/bestcomm/sram.h   |    0
 sound/soc/fsl/mpc5200_dma.c                        |    4 +-
 202 files changed, 7076 insertions(+), 2584 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/pamu.txt
 create mode 100644 Documentation/powerpc/transactional_memory.txt
 create mode 100644 arch/powerpc/boot/dts/mpc5121.dtsi
 create mode 100644 arch/powerpc/boot/dts/ppa8548.dts
 create mode 100644 arch/powerpc/boot/dts/sbc8548-altflash.dts
 create mode 100644 arch/powerpc/boot/dts/sbc8548-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/sbc8548-pre.dtsi
 create mode 100644 arch/powerpc/configs/85xx/ppa8548_defconfig
 create mode 100644 arch/powerpc/crypto/Makefile
 create mode 100644 arch/powerpc/crypto/sha1-powerpc-asm.S
 create mode 100644 arch/powerpc/crypto/sha1.c
 create mode 100644 arch/powerpc/include/asm/ppc4xx_ocm.h
 create mode 100644 arch/powerpc/include/asm/tm.h
 create mode 100644 arch/powerpc/kernel/tm.S
 create mode 100644 arch/powerpc/platforms/85xx/ppa8548.c
 create mode 100644 arch/powerpc/platforms/85xx/sgy_cts1000.c
 create mode 100644 arch/powerpc/sysdev/ppc4xx_ocm.c
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/Kconfig (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/Makefile (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/ata.c (97%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bcom_ata_task.c (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bcom_fec_rx_task.c (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bcom_fec_tx_task.c (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bcom_gen_bd_rx_task.c (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bcom_gen_bd_tx_task.c (100%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/bestcomm.c (99%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/fec.c (98%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/gen_bd.c (98%)
 rename {arch/powerpc/sysdev => drivers/dma}/bestcomm/sram.c (99%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/ata.h (100%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/bestcomm.h (100%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/bestcomm_priv.h (100%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/fec.h (100%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/gen_bd.h (100%)
 rename {arch/powerpc/sysdev => include/linux/fsl}/bestcomm/sram.h (100%)

^ permalink raw reply


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