WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [ppc] Handle memory accesses based on the MSR

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [ppc] Handle memory accesses based on the MSR value
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Jul 2006 18:40:44 +0000
Delivery-date: Wed, 26 Jul 2006 11:45:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 3adb8d61d667d977e967c7e757ef0775ef4c283d
# Parent  bde996cddbbaea72c260b04fd6b95c5f43973f67
[ppc] Handle memory accesses based on the MSR value

While in real mode, the upper bits of an effective address is
truncated, RW does not take care of this automaically.  This allows us
to debug the real mode areas of the linux kernel, especially the early
boot phase.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 tools/gpproxy/riscwatch.py |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff -r bde996cddbba -r 3adb8d61d667 tools/gpproxy/riscwatch.py
--- a/tools/gpproxy/riscwatch.py        Wed Jul 26 13:48:25 2006 -0400
+++ b/tools/gpproxy/riscwatch.py        Wed Jul 26 13:51:44 2006 -0400
@@ -76,6 +76,17 @@ class RISCWatchSession:
                self.telnet.write(cmd)
                return self._getprompt()
 
+       def adjust_addr(self, addr):
+               msr = int(self.get_register("msr"), 16)
+               # could come in as string or int
+               try:
+                       val = int(addr)
+               except:
+                       val = int(addr, 16)
+               if ((msr & 0x30) != 0x30) :
+                       val = val & ~(0xc000000000000000)
+               return val
+       
        def _command(self, cmd):
                """Send command and consume the echo."""
                cmd += "\n"
@@ -160,6 +171,7 @@ class RISCWatchSession:
 
        def set_memory(self, addr, len, val):
                assert len < 32
+               addr = self.adjust_addr(addr)
                result = self._command("m -d%d %x=%x" % (len, addr, val))
                m = ERRVAL.match(result)
                if m:
@@ -184,6 +196,7 @@ class RISCWatchSession:
                                if remaining >= size:
                                        break
 
+                       addr = self.adjust_addr(addr)
                        # do the read
                        hexaddr = "%x" % (addr + pos)
                        val = self._command("m -d%s %s" % (size, hexaddr))
@@ -206,36 +219,42 @@ class RISCWatchSession:
 
        def step(self, signal=None, addr=None):
                if addr:
-                       self._command("s 1 %s" % addr)
+                       addr = self.adjust_addr(addr)
+                       self._command("s 1 %x" % addr)
                else:
                        self._command("s")
 
        def resume(self, signal=None, addr=None):
                if addr:
-                       self._command("r %s" % addr)
+                       addr = self.adjust_addr(addr)
+                       self._command("r %x" % addr)
                else:
                        self._command("r")
 
        def break_insert_mem(self, addr):
-               result = self._command("bp %s" % addr)
+               addr = self.adjust_addr(addr)
+               result = self._command("bp %x" % addr)
                m = ERRVAL.match(result)
                if m:
                        raise IOError(m.group(2))
 
        def break_remove_mem(self, addr):
-               result = self._command("bp -r %s" % addr)
+               addr = self.adjust_addr(addr)
+               result = self._command("bp -r %x" % addr)
                m = ERRVAL.match(result)
                if m:
                        raise IOError(m.group(2))
 
        def break_insert_hardware(self, addr):
-               result = self._command("bp -h %s" % addr)
+               addr = self.adjust_addr(addr)
+               result = self._command("bp -h %x" % addr)
                m = ERRVAL.match(result)
                if m:
                        raise IOError(m.group(2))
 
        def break_remove_hardware(self, addr):
-               result = self._command("bp -h -r %s" % addr)
+               addr = self.adjust_addr(addr)
+               result = self._command("bp -h -r %x" % addr)
                m = ERRVAL.match(result)
                if m:
                        raise IOError(m.group(2))

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [ppc] Handle memory accesses based on the MSR value, Xen patchbot-xenppc-unstable <=