* [Qemu-devel] [PATCH] PPC: e500: Only expose even TLB sizes in initial TLB
@ 2012-10-04 16:55 Alexander Graf
2012-10-06 18:35 ` Aurelien Jarno
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2012-10-04 16:55 UTC (permalink / raw)
To: qemu-devel qemu-devel; +Cc: qemu-ppc@nongnu.org List
When booting our e500 machine, we automatically generate a big TLB entry
in TLB1 that covers all of the code we need to run in there until the guest
can handle its TLB on its own.
However, e500v2 can only handle MAS1.0 sizes. However, we keep our TLB
information in MAS2.0 layout, which means we have twice as many TLB sizes
to choose from. That also means we can run into a situation where we try
to add a TLB size that could not fit into the MAS1.0 size bits.
Fix it by making sure we always have the lower bit set to 0. That way we
are always guaranteed to have MAS1.0 compatible TLB size information.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/ppc/e500.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index feb712e..d23f9b2 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -362,6 +362,10 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env)
the device tree top */
dt_end = bi->dt_base + bi->dt_size;
ps = booke206_page_size_to_tlb(dt_end) + 1;
+ if (ps & 1) {
+ /* e500v2 can only do even TLB size bits */
+ ps++;
+ }
size = (ps << MAS1_TSIZE_SHIFT);
tlb->mas1 = MAS1_VALID | size;
tlb->mas2 = 0;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] PPC: e500: Only expose even TLB sizes in initial TLB
2012-10-04 16:55 [Qemu-devel] [PATCH] PPC: e500: Only expose even TLB sizes in initial TLB Alexander Graf
@ 2012-10-06 18:35 ` Aurelien Jarno
2012-10-06 20:08 ` Alexander Graf
0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Jarno @ 2012-10-06 18:35 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-ppc@nongnu.org List, qemu-devel qemu-devel
On Thu, Oct 04, 2012 at 06:55:35PM +0200, Alexander Graf wrote:
> When booting our e500 machine, we automatically generate a big TLB entry
> in TLB1 that covers all of the code we need to run in there until the guest
> can handle its TLB on its own.
>
> However, e500v2 can only handle MAS1.0 sizes. However, we keep our TLB
> information in MAS2.0 layout, which means we have twice as many TLB sizes
> to choose from. That also means we can run into a situation where we try
> to add a TLB size that could not fit into the MAS1.0 size bits.
>
> Fix it by making sure we always have the lower bit set to 0. That way we
> are always guaranteed to have MAS1.0 compatible TLB size information.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> hw/ppc/e500.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index feb712e..d23f9b2 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -362,6 +362,10 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env)
> the device tree top */
> dt_end = bi->dt_base + bi->dt_size;
> ps = booke206_page_size_to_tlb(dt_end) + 1;
> + if (ps & 1) {
> + /* e500v2 can only do even TLB size bits */
> + ps++;
> + }
> size = (ps << MAS1_TSIZE_SHIFT);
> tlb->mas1 = MAS1_VALID | size;
> tlb->mas2 = 0;
Applied (actually as part of the PPC pull).
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] PPC: e500: Only expose even TLB sizes in initial TLB
2012-10-06 18:35 ` Aurelien Jarno
@ 2012-10-06 20:08 ` Alexander Graf
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2012-10-06 20:08 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-ppc@nongnu.org List, qemu-devel qemu-devel
On 06.10.2012, at 20:35, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Thu, Oct 04, 2012 at 06:55:35PM +0200, Alexander Graf wrote:
>> When booting our e500 machine, we automatically generate a big TLB entry
>> in TLB1 that covers all of the code we need to run in there until the guest
>> can handle its TLB on its own.
>>
>> However, e500v2 can only handle MAS1.0 sizes. However, we keep our TLB
>> information in MAS2.0 layout, which means we have twice as many TLB sizes
>> to choose from. That also means we can run into a situation where we try
>> to add a TLB size that could not fit into the MAS1.0 size bits.
>>
>> Fix it by making sure we always have the lower bit set to 0. That way we
>> are always guaranteed to have MAS1.0 compatible TLB size information.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> ---
>> hw/ppc/e500.c | 4 ++++
>> 1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
>> index feb712e..d23f9b2 100644
>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -362,6 +362,10 @@ static void mmubooke_create_initial_mapping(CPUPPCState *env)
>> the device tree top */
>> dt_end = bi->dt_base + bi->dt_size;
>> ps = booke206_page_size_to_tlb(dt_end) + 1;
>> + if (ps & 1) {
>> + /* e500v2 can only do even TLB size bits */
>> + ps++;
>> + }
>> size = (ps << MAS1_TSIZE_SHIFT);
>> tlb->mas1 = MAS1_VALID | size;
>> tlb->mas2 = 0;
>
> Applied (actually as part of the PPC pull).
Yes, these were quite critical bugfixes that I folded into the pull request. Sorry for not noting it anywhere :).
Alex
>
>
> --
> Aurelien Jarno GPG: 1024D/F1BCDB73
> aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-06 20:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 16:55 [Qemu-devel] [PATCH] PPC: e500: Only expose even TLB sizes in initial TLB Alexander Graf
2012-10-06 18:35 ` Aurelien Jarno
2012-10-06 20:08 ` Alexander Graf
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).