qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Igor Kovalenko" <igor.v.kovalenko@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support
Date: Sat, 27 Sep 2008 22:51:25 +0400	[thread overview]
Message-ID: <b2fa41d60809271151w614d5d5ak50eb48b0bdab5a56@mail.gmail.com> (raw)

[-- 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;

             reply	other threads:[~2008-09-27 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-27 18:51 Igor Kovalenko [this message]
2008-09-27 19:54 ` [Qemu-devel] [PATCH] sparc64 add mmu tlb demap support Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2fa41d60809271151w614d5d5ak50eb48b0bdab5a56@mail.gmail.com \
    --to=igor.v.kovalenko@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).