From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: [V0 PATCH 2/6] AMD-PVH: cpuid intercept Date: Fri, 12 Dec 2014 18:58:23 -0800 Message-ID: <1418439507-16027-3-git-send-email-mukesh.rathor@oracle.com> References: <1418439507-16027-1-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xzcut-00051M-Ao for xen-devel@lists.xenproject.org; Sat, 13 Dec 2014 02:58:47 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sBD2whRx010948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 13 Dec 2014 02:58:44 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id sBD2wg5w021457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 13 Dec 2014 02:58:43 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sBD2wg1u007038 for ; Sat, 13 Dec 2014 02:58:42 GMT In-Reply-To: <1418439507-16027-1-git-send-email-mukesh.rathor@oracle.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: boris.ostrovsky@oracle.com, elena.ufimtseva@oracle.com Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Call pv_cpuid for pvh cpuid intercept. Note, we modify svm_vmexit_do_cpuid instead of the intercept switch because the guest eip needs to be adjusted for pvh also. Signed-off-by: Mukesh Rathor --- xen/arch/x86/hvm/svm/svm.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 71b8a6a..4ff4a96 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1517,18 +1517,22 @@ static void svm_vmexit_do_cpuid(struct cpu_user_regs *regs) if ( (inst_len = __get_instruction_length(current, INSTR_CPUID)) == 0 ) return; - eax = regs->eax; - ebx = regs->ebx; - ecx = regs->ecx; - edx = regs->edx; - - svm_cpuid_intercept(&eax, &ebx, &ecx, &edx); + if ( is_pvh_vcpu(current) ) + pv_cpuid(regs); + else + { + eax = regs->eax; + ebx = regs->ebx; + ecx = regs->ecx; + edx = regs->edx; - regs->eax = eax; - regs->ebx = ebx; - regs->ecx = ecx; - regs->edx = edx; + svm_cpuid_intercept(&eax, &ebx, &ecx, &edx); + regs->eax = eax; + regs->ebx = ebx; + regs->ecx = ecx; + regs->edx = edx; + } __update_guest_eip(regs, inst_len); } -- 1.8.3.1