qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support
@ 2008-09-27 18:51 Igor Kovalenko
  2008-09-27 19:54 ` Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Kovalenko @ 2008-09-27 18:51 UTC (permalink / raw)
  To: qemu-devel

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

Hi!

This patch adds handling of explicit i/d demapping ASI writes. Tested
by examining i/d tlb dumps. This functionality is used by e.g. silo to
release mappings acquired to load kernel and initrd before proceeding
to kernel start.

Please apply.

-- 
Kind regards,
Igor V. Kovalenko

[-- Attachment #2: qemu-sparc64-mmu-demap.patch --]
[-- Type: application/octet-stream, Size: 1810 bytes --]

Index: target-sparc/op_helper.c
===================================================================
--- target-sparc/op_helper.c	(revision 5331)
+++ target-sparc/op_helper.c	(working copy)
@@ -1941,6 +1941,8 @@
         }
     case 0x55: // I-MMU data access
         {
+            // TODO: auto demap
+
             unsigned int i = (addr >> 3) & 0x3f;
 
             env->itlb_tag[i] = env->immuregs[6];
@@ -1949,6 +1951,20 @@
         }
     case 0x57: // I-MMU demap
         // XXX
+        {
+            unsigned int i;
+            for (i = 0; i < 64; i++) {
+                if ((env->itlb_tte[i] & 0x8000000000000000ULL) != 0) {
+                    target_ulong mask = 0xffffffffffffe000ULL;
+                    mask <<= 3 * ((env->itlb_tte[i] >> 61) & 3);
+                    if ((val & mask) == (env->itlb_tag[i] & mask)) {
+                        env->itlb_tag[i] = 0;
+                        env->itlb_tte[i] = 0;
+                    }
+                    return;
+                }
+            }
+        }
         return;
     case 0x58: // D-MMU regs
         {
@@ -2018,6 +2034,21 @@
             return;
         }
     case 0x5f: // D-MMU demap
+        {
+            unsigned int i;
+            for (i = 0; i < 64; i++) {
+                if ((env->dtlb_tte[i] & 0x8000000000000000ULL) != 0) {
+                    target_ulong mask = 0xffffffffffffe000ULL;
+                    mask <<= 3 * ((env->dtlb_tte[i] >> 61) & 3);
+                    if ((val & mask) == (env->dtlb_tag[i] & mask)) {
+                        env->dtlb_tag[i] = 0;
+                        env->dtlb_tte[i] = 0;
+                    }
+                    return;
+                }
+            }
+        }
+        return;
     case 0x49: // Interrupt data receive
         // XXX
         return;

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

* Re: [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support
  2008-09-27 18:51 [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support Igor Kovalenko
@ 2008-09-27 19:54 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2008-09-27 19:54 UTC (permalink / raw)
  To: qemu-devel

On 9/27/08, Igor Kovalenko <igor.v.kovalenko@gmail.com> wrote:
> Hi!
>
>  This patch adds handling of explicit i/d demapping ASI writes. Tested
>  by examining i/d tlb dumps. This functionality is used by e.g. silo to
>  release mappings acquired to load kernel and initrd before proceeding
>  to kernel start.
>
>  Please apply.

Thanks, applied. I removed the XXX comment from I-MMU demap and added
some blank lines between variable declarations and block body.

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

end of thread, other threads:[~2008-09-27 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-27 18:51 [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support Igor Kovalenko
2008-09-27 19:54 ` Blue Swirl

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