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-changelog

[Xen-changelog] [xen-unstable] [IA64] xenoprof: make xenoprofile_get_mod

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] xenoprof: make xenoprofile_get_mode() vti domain aware
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Dec 2007 05:40:17 -0800
Delivery-date: Wed, 19 Dec 2007 05:40:54 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1197909406 25200
# Node ID e88253dfefdc33e773ce5c4489512875fec262ad
# Parent  d3881629d572b46d4ba7fe5f5009166948d1ca84
[IA64] xenoprof: make xenoprofile_get_mode() vti domain aware

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/oprofile/xenoprof.c |   55 +++++++++++++++++++++++++---------
 1 files changed, 42 insertions(+), 13 deletions(-)

diff -r d3881629d572 -r e88253dfefdc xen/arch/ia64/xen/oprofile/xenoprof.c
--- a/xen/arch/ia64/xen/oprofile/xenoprof.c     Mon Dec 17 09:33:52 2007 -0700
+++ b/xen/arch/ia64/xen/oprofile/xenoprof.c     Mon Dec 17 09:36:46 2007 -0700
@@ -24,29 +24,58 @@
 #include <xen/sched.h>
 #include <public/xen.h>
 #include <xen/xenoprof.h>
+#include <asm/vmx.h>    /* for vmx_user_mode() */
 
 int
 xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
 {
     int mode;
 
-    // mode
-    // 0: user, 1: kernel, 2: xen
-    switch (ring(regs))
-    {
+    /*
+     * mode
+     * 0: user, 1: kernel, 2: xen
+     * see linux/driver/oprofile/cpu_buffer.h
+     */
+#define CPU_MODE_USER           0
+#define CPU_MODE_KERNEL         1
+#define CPU_MODE_XEN            2
+    if (VMX_DOMAIN(v)) {
+        if (vmx_user_mode(regs)) {
+            switch (ring(regs)) {
+            case 3:
+                mode = CPU_MODE_USER;
+                break;
+            case 0:
+                mode = CPU_MODE_KERNEL;
+                break;
+            /* case 0: case 1: */
+            default:
+                gdprintk(XENLOG_ERR, "%s:%d ring%d in vmx is used!\n",
+                         __func__, __LINE__, ring(regs));
+                mode = CPU_MODE_KERNEL; /* fall back to kernel mode. */
+                break;
+            }
+        } else {
+            mode = CPU_MODE_XEN;
+            BUG_ON(ring(regs) != 0);
+        }
+    } else {
+        switch (ring(regs)) {
         case 3:
-                mode = 0;
-                break;
+            mode = CPU_MODE_USER;
+            break;
         case CONFIG_CPL0_EMUL:
-                mode = 1;
-                break;
+            mode = CPU_MODE_KERNEL;
+            break;
         case 0:
-                mode = 2;
-                break;
+            mode = CPU_MODE_XEN;
+            break;
         default:
-                gdprintk(XENLOG_ERR, "%s:%d ring%d is used!\n", __func__,
-                         __LINE__, 3 - CONFIG_CPL0_EMUL);
-                mode = 1; /* fall back to kernel mode. */
+            gdprintk(XENLOG_ERR, "%s:%d ring%d in pv is used!\n", __func__,
+                     __LINE__, 3 - CONFIG_CPL0_EMUL);
+            mode = CPU_MODE_KERNEL; /* fall back to kernel mode. */
+            break;
+        }
     }
     return mode;
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] xenoprof: make xenoprofile_get_mode() vti domain aware, Xen patchbot-unstable <=