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] [XEN][POWERPC] Implement H_READ from the PAPR

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [XEN][POWERPC] Implement H_READ from the PAPR
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Aug 2006 18:40:34 +0000
Delivery-date: Fri, 25 Aug 2006 12:13: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 0b9462fe3fdf3cfe5caf51bb9cc2e549793d1828
# Parent  d87d602408d5a25715fc9bd19ec3fd02395a1c8f
[XEN][POWERPC] Implement H_READ from the PAPR

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/papr/xlate.c |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff -r d87d602408d5 -r 0b9462fe3fdf xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c     Thu Aug 24 21:07:46 2006 -0400
+++ b/xen/arch/powerpc/papr/xlate.c     Fri Aug 25 14:34:51 2006 -0400
@@ -30,12 +30,6 @@
 #include <asm/papr.h>
 #include <asm/hcalls.h>
 
-static void not_yet(struct cpu_user_regs *regs)
-{
-    printk("not implemented yet: 0x%lx\n", regs->gprs[3]);
-    for (;;);
-}
-
 #ifdef USE_PTE_INSERT
 static inline void pte_insert(union pte volatile *pte,
         ulong vsid, ulong rpn, ulong lrpn)
@@ -493,8 +487,42 @@ static void h_remove(struct cpu_user_reg
     pte_tlbie(&lpte, ptex);
 }
 
+static void h_read(struct cpu_user_regs *regs)
+{
+    ulong flags = regs->gprs[4];
+    ulong ptex = regs->gprs[5];
+    struct vcpu *v = get_current();
+    struct domain *d = v->domain;
+    struct domain_htab *htab = &d->arch.htab;
+    union pte volatile *pte;
+
+       if (flags & H_READ_4)
+        ptex &= ~0x3UL;
+
+    if (ptex > (1UL << htab->log_num_ptes)) {
+        regs->gprs[3] = H_Parameter;
+        printk("%s: bad ptex: 0x%lx\n", __func__, ptex);
+        return;
+    }
+    pte = &htab->map[ptex];
+    regs->gprs[4] = pte[0].words.vsid;
+    regs->gprs[5] = pte[0].words.rpn;
+
+    if (!(flags & H_READ_4)) {
+        /* dump another 3 PTEs */
+        regs->gprs[6] = pte[1].words.vsid;
+        regs->gprs[7] = pte[1].words.rpn;
+        regs->gprs[8] = pte[2].words.vsid;
+        regs->gprs[9] = pte[2].words.rpn;
+        regs->gprs[10] = pte[3].words.vsid;
+        regs->gprs[11] = pte[3].words.rpn;
+    }
+
+    regs->gprs[3] = H_Success;
+}
+
 __init_papr_hcall(H_ENTER, h_enter);
-__init_papr_hcall(H_READ, not_yet);
+__init_papr_hcall(H_READ, h_read);
 __init_papr_hcall(H_REMOVE, h_remove);
 __init_papr_hcall(H_CLEAR_MOD, h_clear_mod);
 __init_papr_hcall(H_CLEAR_REF, h_clear_ref);

_______________________________________________
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] [XEN][POWERPC] Implement H_READ from the PAPR, Xen patchbot-xenppc-unstable <=