From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: [V0 PATCH 2/6] AMD-PVH: cpuid intercept Date: Fri, 15 Aug 2014 18:53:12 -0700 Message-ID: <1408153996-16425-3-git-send-email-mukesh.rathor@oracle.com> References: <1408153996-16425-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XITBV-0007H4-8W for xen-devel@lists.xenproject.org; Sat, 16 Aug 2014 01:53:33 +0000 In-Reply-To: <1408153996-16425-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: xen-devel@lists.xenproject.org Cc: keir@xen.org, boris.ostrovsky@oracle.com, Aravind.Gopalakrishnan@amd.com, jbeulich@suse.com, suravee.suthikulpanit@amd.com 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