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

RE: [Xen-devel] Re: problem in using MSR in the hypervisor

To: Long Wang <longwang.longwang@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Re: problem in using MSR in the hypervisor
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Mon, 11 Oct 2010 08:38:22 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Sun, 10 Oct 2010 17:40:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTim6PdfewSzgJa0ORFkWhcS=kaCHc6vyjwtgYc9F@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTimj8-91y9SK2a+YK+8cP8qykkFs==RoY+C6v+cg@xxxxxxxxxxxxxx> <AANLkTim6PdfewSzgJa0ORFkWhcS=kaCHc6vyjwtgYc9F@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Actn5+i4ZBG9A/pRRdKcEiMdxd+uzAA9F4zw
Thread-topic: [Xen-devel] Re: problem in using MSR in the hypervisor
Are the MSRs invalid in the system? Invalid here means reserved or 
unimplemented MSR.

Thanks
--jyh

>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Long Wang
>Sent: Sunday, October 10, 2010 3:26 AM
>To: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [Xen-devel] Re: problem in using MSR in the hypervisor
>
>I added code in the hypervisor to manipulate MSR. Here is my code in
>emulate_privileged_op() in the Xen hypervisor:
>
>....
>       // for WRMSR
>       case MSR_P4_IQ_PERFCTR0:
>       case MSR_P4_IQ_CCCR0:
>       case MSR_P4_CRU_ESCR0:
>       case MSR_P4_IQ_PERFCTR2:
>       case MSR_P4_IQ_CCCR2:
>       case MSR_P4_CRU_ESCR1:
>           wrmsr_safe(regs->ecx, eax, edx);
>           break;
>......
>       // for RDMSR
>       case MSR_P4_IQ_PERFCTR0:
>       case MSR_P4_IQ_CCCR0:
>       case MSR_P4_CRU_ESCR0:
>       case MSR_P4_IQ_PERFCTR2:
>       case MSR_P4_IQ_CCCR2:
>       case MSR_P4_CRU_ESCR1:
>               printk("the_cs = 0x%x\n", the_cs);
>               __asm__ volatile(
>                         "mov %%cs, %0\n"
>                         :"=r"(the_cs)
>                         :
>               );
>               printk("the_cs = 0x%x\n", the_cs);
>               rdmsr_safe(regs->ecx, regs->eax, regs->edx);
>           break;
>
>
>The wrmsr_safe() and rdmsr_safe() trigger a general protection fault,
>and the value read from the msr is 0. But I printed out the cs
>descriptor, and found the CPL is 0. Why there is a general protection
>fault here? How can I fix this?
>
>
>thanks,
>long
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-devel

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

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