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

[Xen-devel] [PATCH] allow all MSRs for dom0

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] allow all MSRs for dom0
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Fri, 20 Oct 2006 00:14:47 +0100
Delivery-date: Thu, 19 Oct 2006 16:25:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
# HG changeset patch
# User john.levon@xxxxxxx
# Date 1161299603 25200
# Node ID b67c721ced1d27a880cf155dc10f2381d2ee9bb9
# Parent  36c60bff1213a1844b56114b216f99ffce9f2230
allow dom0 to access MSRs

Signed-off-by: Mark Johnson <mark.johnson@xxxxxxx>

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1406,6 +1406,11 @@ static int emulate_privileged_op(struct 
             break;
 #endif
         default:
+            if (v->domain == dom0) {
+                if ( wrmsr_safe(regs->ecx, regs->eax, regs->edx) )
+                    goto fail;
+                break;
+            }
             if ( wrmsr_hypervisor_regs(regs->ecx, regs->eax, regs->edx) )
                 break;
 
@@ -1440,6 +1445,11 @@ static int emulate_privileged_op(struct 
                 goto fail;
             break;
         default:
+            if (v->domain == dom0) {
+                if ( rdmsr_safe(regs->ecx, regs->eax, regs->edx) )
+                    goto fail;
+                break;
+            }
             if ( rdmsr_hypervisor_regs(regs->ecx, &l, &h) )
             {
                 regs->eax = l;

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

<Prev in Thread] Current Thread [Next in Thread>