From mboxrd@z Thu Jan 1 00:00:00 1970 From: Big Strong Subject: rdmsr general protection error Date: Tue, 3 May 2016 23:01:32 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7180754349736372612==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============7180754349736372612== Content-Type: multipart/alternative; boundary=001a11401642795dd50531f162d5 --001a11401642795dd50531f162d5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I want to test if my processor support VMFUNC which is described as: > > > The IA32_VMX_VMFUNC MSR exists only on processors that support the > 1-setting of the =E2=80=9Cactivate secondary controls=E2=80=9D VM-executi= on control (only if* > bit 63 of the IA32_VMX_PROCBASED_CTLS MSR is 1*) and the 1-setting of the > =E2=80=9Cenable VM functions=E2=80=9D secondary processor-based VM-execut= ion control (only > if* bit 45 of the IA32_VMX_PROCBASED_CTLS2 MSR is 1*). So in order to do that, I need to use rdmsr as follows: //IA32_VMX_PROCBASED_CTLS > __asm__ __volatile__("rdmsr" : "=3Da" (eax), "=3Dd" (edx) : "c" (0x482))= ; //IA32_VMX_PROCBASED_CTLS 2 __asm__ __volatile__("rdmsr" : "=3Da" (eax), "=3Dd" (edx) : "c" (0x48B)); But both the rdmsr instruction would cause a #GP, even when I run it from the native linux as a root user and without xen running. So is there a way to use the rdmsr in dom0? --001a11401642795dd50531f162d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I want to test if my processor support VMFUNC which is des= cribed as:

The IA32_VMX_VMFUNC MSR exists = only on processors that support the 1-setting of the =E2=80=9Cactivate secondary controls=E2=80=9D VM-execution= control (only if bit 63 of the IA32_VMX_PROCBASED_CTLS MSR is 1) and the 1-setting of the =E2=80=9Cenable VM functions=E2=80= =9D secondary processor-based VM-execution control (only if bit 45 of the IA32_VMX_PRO= CBASED_CTLS2 MSR is 1).

So in or= der to do that, I need to use rdmsr as follows:

//IA32_VMX_PROCBASED_CTLS=C2=A0
=C2=A0__asm__ __volatile__(&qu= ot;rdmsr" : "=3Da" (eax), "=3Dd" (edx) : "c&q= uot; (0x482));=C2=A0
//IA32_VMX_PROCBASED_CTLS= =C2=A02=C2=A0
=C2=A0__asm__ __volatile__("= ;rdmsr" : "=3Da" (eax), "=3Dd" (edx) : "c&quo= t; (0x48B));=C2=A0

But both the rdmsr instr= uction would cause a #GP, even when I run it from the native linux as a roo= t user and without xen running.

So is there a way = to use the rdmsr in dom0?
--001a11401642795dd50531f162d5-- --===============7180754349736372612== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============7180754349736372612==--