qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sparc64's get_physical_address_code should not fault on TTE's with V=0
@ 2009-01-12 20:53 Jakub Jermar
  2009-01-12 21:10 ` [Qemu-devel] " Blue Swirl
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jermar @ 2009-01-12 20:53 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

Hi,

when I make the following change to helper.c, get_physical_address_code:

-        // ctx match, vaddr match?
+        // ctx match, vaddr match, valid?
         if (env->dmmuregs[1] == (env->itlb_tag[i] & 0x1fff) &&
-            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL)) {
-            // valid, access ok?
-            if ((env->itlb_tte[i] & 0x8000000000000000ULL) == 0 ||
-                ((env->itlb_tte[i] & 0x4) && is_user)) {
+            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL) &&
+            env->itlb_tte[i] & 0x8000000000000000ULL) {
+            // access ok?
+            if ((env->itlb_tte[i] & 0x4) && is_user) {

HelenOS gets a little bit further than without this change and seems
to panic more or less gracefully later.

In short, non-valid entries should be skipped by the loop in
get_physical_address_code instead of causing TFAULT, because
the ITLB can contain a valid entry for the same address. The
same is true for DTLB.

Can you confirm this?

Thanks,
Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: sparc64's get_physical_address_code should not fault on TTE's with V=0
  2009-01-12 20:53 [Qemu-devel] sparc64's get_physical_address_code should not fault on TTE's with V=0 Jakub Jermar
@ 2009-01-12 21:10 ` Blue Swirl
  2009-01-12 22:03   ` Jakub Jermar
  0 siblings, 1 reply; 3+ messages in thread
From: Blue Swirl @ 2009-01-12 21:10 UTC (permalink / raw)
  To: Jakub Jermar; +Cc: qemu-devel

On 1/12/09, Jakub Jermar <jakub@jermar.eu> wrote:
> Hi,
>
>  when I make the following change to helper.c, get_physical_address_code:
>
>  -        // ctx match, vaddr match?
>  +        // ctx match, vaddr match, valid?
>          if (env->dmmuregs[1] == (env->itlb_tag[i] & 0x1fff) &&
>  -            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL)) {
>  -            // valid, access ok?
>  -            if ((env->itlb_tte[i] & 0x8000000000000000ULL) == 0 ||
>  -                ((env->itlb_tte[i] & 0x4) && is_user)) {
>  +            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL) &&
>  +            env->itlb_tte[i] & 0x8000000000000000ULL) {
>  +            // access ok?
>  +            if ((env->itlb_tte[i] & 0x4) && is_user) {
>
>  HelenOS gets a little bit further than without this change and seems
>  to panic more or less gracefully later.
>
>  In short, non-valid entries should be skipped by the loop in
>  get_physical_address_code instead of causing TFAULT, because
>  the ITLB can contain a valid entry for the same address. The
>  same is true for DTLB.
>
>  Can you confirm this?

Yes, this looks correct. I'll apply a fix.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: sparc64's get_physical_address_code should not fault on TTE's with V=0
  2009-01-12 21:10 ` [Qemu-devel] " Blue Swirl
@ 2009-01-12 22:03   ` Jakub Jermar
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jermar @ 2009-01-12 22:03 UTC (permalink / raw)
  To: Blue Swirl; +Cc: openbios, qemu-devel

Blue Swirl wrote:
> On 1/12/09, Jakub Jermar <jakub@jermar.eu> wrote:
>> Hi,
>>
>>  when I make the following change to helper.c, get_physical_address_code:
>>
>>  -        // ctx match, vaddr match?
>>  +        // ctx match, vaddr match, valid?
>>          if (env->dmmuregs[1] == (env->itlb_tag[i] & 0x1fff) &&
>>  -            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL)) {
>>  -            // valid, access ok?
>>  -            if ((env->itlb_tte[i] & 0x8000000000000000ULL) == 0 ||
>>  -                ((env->itlb_tte[i] & 0x4) && is_user)) {
>>  +            (address & mask) == (env->itlb_tag[i] & ~0x1fffULL) &&
>>  +            env->itlb_tte[i] & 0x8000000000000000ULL) {
>>  +            // access ok?
>>  +            if ((env->itlb_tte[i] & 0x4) && is_user) {
>>
>>  HelenOS gets a little bit further than without this change and seems
>>  to panic more or less gracefully later.
>>
>>  In short, non-valid entries should be skipped by the loop in
>>  get_physical_address_code instead of causing TFAULT, because
>>  the ITLB can contain a valid entry for the same address. The
>>  same is true for DTLB.
>>
>>  Can you confirm this?
> 
> Yes, this looks correct. I'll apply a fix.

Thanks!

With this fix in place, HelenOS most of the time panics on:

Kernel panic: Cannot find property 'screen'.

I.e. it searches property 'screen' in /aliases and doesn't
find any. If it is not there already, could you please add
it (together with keyboard) to openbios?

Thanks,
Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-12 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 20:53 [Qemu-devel] sparc64's get_physical_address_code should not fault on TTE's with V=0 Jakub Jermar
2009-01-12 21:10 ` [Qemu-devel] " Blue Swirl
2009-01-12 22:03   ` Jakub Jermar

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).