* [PATCH] powerpc/book3e: Fix extlb size
@ 2011-04-05 6:28 Michael Ellerman
2011-04-05 12:41 ` Kumar Gala
0 siblings, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2011-04-05 6:28 UTC (permalink / raw)
To: linuxppc-dev
The calculation of the size for the exception save area of the TLB
miss handler is wrong, luckily it's too big not too small.
Rework it to make it a bit clearer, and also correct. We want 3 save
areas, each EX_TLB_SIZE _bytes_.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/include/asm/paca.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index ec57540..f7aa4fd 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -106,7 +106,7 @@ struct paca_struct {
pgd_t *pgd; /* Current PGD */
pgd_t *kernel_pgd; /* Kernel PGD */
u64 exgen[8] __attribute__((aligned(0x80)));
- u64 extlb[EX_TLB_SIZE*3] __attribute__((aligned(0x80)));
+ u64 extlb[3][EX_TLB_SIZE / sizeof(u64)] __attribute__((aligned(0x80)));
u64 exmc[8]; /* used for machine checks */
u64 excrit[8]; /* used for crit interrupts */
u64 exdbg[8]; /* used for debug interrupts */
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/book3e: Fix extlb size
2011-04-05 6:28 [PATCH] powerpc/book3e: Fix extlb size Michael Ellerman
@ 2011-04-05 12:41 ` Kumar Gala
2011-04-05 23:39 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 6+ messages in thread
From: Kumar Gala @ 2011-04-05 12:41 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Apr 5, 2011, at 1:28 AM, Michael Ellerman wrote:
> The calculation of the size for the exception save area of the TLB
> miss handler is wrong, luckily it's too big not too small.
>=20
> Rework it to make it a bit clearer, and also correct. We want 3 save
> areas, each EX_TLB_SIZE _bytes_.
Where does the 3 come from? I have a guess, and think its possible we =
(FSL) want 4?
>=20
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/include/asm/paca.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>=20
> diff --git a/arch/powerpc/include/asm/paca.h =
b/arch/powerpc/include/asm/paca.h
> index ec57540..f7aa4fd 100644
> --- a/arch/powerpc/include/asm/paca.h
> +++ b/arch/powerpc/include/asm/paca.h
> @@ -106,7 +106,7 @@ struct paca_struct {
> pgd_t *pgd; /* Current PGD */
> pgd_t *kernel_pgd; /* Kernel PGD */
> u64 exgen[8] __attribute__((aligned(0x80)));
> - u64 extlb[EX_TLB_SIZE*3] __attribute__((aligned(0x80)));
> + u64 extlb[3][EX_TLB_SIZE / sizeof(u64)] =
__attribute__((aligned(0x80)));
> u64 exmc[8]; /* used for machine checks */
> u64 excrit[8]; /* used for crit interrupts */
> u64 exdbg[8]; /* used for debug interrupts */
> --=20
> 1.7.1
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/book3e: Fix extlb size
2011-04-05 12:41 ` Kumar Gala
@ 2011-04-05 23:39 ` Benjamin Herrenschmidt
2011-04-06 1:45 ` Kumar Gala
0 siblings, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2011-04-05 23:39 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
On Tue, 2011-04-05 at 07:41 -0500, Kumar Gala wrote:
> > Rework it to make it a bit clearer, and also correct. We want 3 save
> > areas, each EX_TLB_SIZE _bytes_.
>
> Where does the 3 come from? I have a guess, and think its possible we
> (FSL) want 4?
Wrong guess :-) It's not about exception levels. It's about how much
the handler can re-enter (2 with E.PT, 3 with virtual linear)
For MC's, CRITs etc... which we don't support on Book3E 64-bit at this
stage, you'll have to probably backup the whole area... that or move
the TLB frame pointer SPR to a separate set of 3 levels, but then you'd
have to fix the code that makes assumption about level 0 being at a
fixed offset in the PACA and instead use alignment tricks. We need that
because that's how we "reset" the TLB frame when a second level finds
a fault.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/book3e: Fix extlb size
2011-04-05 23:39 ` Benjamin Herrenschmidt
@ 2011-04-06 1:45 ` Kumar Gala
0 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2011-04-06 1:45 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
On Apr 5, 2011, at 6:39 PM, Benjamin Herrenschmidt wrote:
> On Tue, 2011-04-05 at 07:41 -0500, Kumar Gala wrote:
>>> Rework it to make it a bit clearer, and also correct. We want 3 save
>>> areas, each EX_TLB_SIZE _bytes_.
>>
>> Where does the 3 come from? I have a guess, and think its possible we
>> (FSL) want 4?
>
> Wrong guess :-) It's not about exception levels. It's about how much
> the handler can re-enter (2 with E.PT, 3 with virtual linear)
>
> For MC's, CRITs etc... which we don't support on Book3E 64-bit at this
> stage, you'll have to probably backup the whole area... that or move
> the TLB frame pointer SPR to a separate set of 3 levels, but then you'd
> have to fix the code that makes assumption about level 0 being at a
> fixed offset in the PACA and instead use alignment tricks. We need that
> because that's how we "reset" the TLB frame when a second level finds
> a fault.
>
> Cheers,
> Ben.
Gotcha, can we add a comment here about what the '3' is about.
- k
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] powerpc/book3e: Fix extlb size
@ 2011-04-08 7:22 Michael Ellerman
2011-04-08 9:42 ` Kumar Gala
0 siblings, 1 reply; 6+ messages in thread
From: Michael Ellerman @ 2011-04-08 7:22 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Kumar Gala
The calculation of the size for the exception save area of the TLB
miss handler is wrong, luckily it's too big not too small.
Rework it to make it a bit clearer, and also correct. We want 3 save
areas, each EX_TLB_SIZE _bytes_.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/include/asm/paca.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index ec57540..c3416ca 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -106,7 +106,8 @@ struct paca_struct {
pgd_t *pgd; /* Current PGD */
pgd_t *kernel_pgd; /* Kernel PGD */
u64 exgen[8] __attribute__((aligned(0x80)));
- u64 extlb[EX_TLB_SIZE*3] __attribute__((aligned(0x80)));
+ /* We can have up to 3 levels of reentrancy in the TLB miss handler */
+ u64 extlb[3][EX_TLB_SIZE / sizeof(u64)] __attribute__((aligned(0x80)));
u64 exmc[8]; /* used for machine checks */
u64 excrit[8]; /* used for crit interrupts */
u64 exdbg[8]; /* used for debug interrupts */
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] powerpc/book3e: Fix extlb size
2011-04-08 7:22 Michael Ellerman
@ 2011-04-08 9:42 ` Kumar Gala
0 siblings, 0 replies; 6+ messages in thread
From: Kumar Gala @ 2011-04-08 9:42 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
On Apr 8, 2011, at 2:22 AM, Michael Ellerman wrote:
> The calculation of the size for the exception save area of the TLB
> miss handler is wrong, luckily it's too big not too small.
>
> Rework it to make it a bit clearer, and also correct. We want 3 save
> areas, each EX_TLB_SIZE _bytes_.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/include/asm/paca.h | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Acked-by: Kumar Gala <galak@kernel.crashing.org>
- k
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-08 9:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 6:28 [PATCH] powerpc/book3e: Fix extlb size Michael Ellerman
2011-04-05 12:41 ` Kumar Gala
2011-04-05 23:39 ` Benjamin Herrenschmidt
2011-04-06 1:45 ` Kumar Gala
-- strict thread matches above, loose matches on Subject: below --
2011-04-08 7:22 Michael Ellerman
2011-04-08 9:42 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).