From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: How to get a few MSR values from userspace? Date: Fri, 21 Dec 2012 15:26:11 +0200 Message-ID: <50D46373.10802@gmail.com> References: <50D459D3.4040101@gmail.com> <50D4611C.6030206@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50D4611C.6030206@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hello, thanks for the reply! > I'm not sure I understand what you are trying to achieve (nor am I > convinced I know how to help you, but if I don't understand the question > suffiiciently, I certainly can't advice you on what you can/should do or > can't/shouldn't do), but what MSR's are we talking about - the guest > MSR's or the host MSR's? Sorry if I've not been clear. I want to access the MSRs of a Xen HVM guest, from a userspace application running in dom0, with the help of libxc. Libxc already allows me to inspect the values of several registers, including a handful of MSRs, if I call: xc_domain_hvm_getcontext_partial(xch, domain_id, HVM_SAVE_CODE(CPU), instance, &hw_ctxt, sizeof hw_ctxt); and then examine, for example, hw_ctxt.msr_lstar. What I'd like is to be able to check hw_ctxt.msr_mc0_ctl, for example, after the xc_domain_hvm_getcontext_partial(). > Normally, reading MSR's in usermode is not allowed on bare-metal, so not > sure why you expect this to work in the guest (or Dom0) on top of Xen. > But maybe you don't actually mean userspace as opposed to "kernel mode"? I mean accessing a domU's MSRs from dom0 userspace. Thanks, Razvan Cojocaru