From: George Dunlap Subject: [PATCH v15 13/19] pvh: PV cpuid Date: Mon, 11 Nov 2013 14:57:15 +0000 Message-ID: <1384181841-22739-14-git-send-email-george.dunlap@eu.citrix.com> References: <1384181841-22739-1-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384181841-22739-1-git-send-email-george.dunlap@eu.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 Cc: Keir Fraser , Jan Beulich , George Dunlap , Eddie Dong , Tim Deegan , Jun Nakajima List-Id: xen-devel@lists.xenproject.org Call the PV version of CPUID. NB at the moment we do not handle forced emulated ops. This means, for example, that xen-detect will report an HVM Xen guest instead of a PV one. Signed-off-by: George Dunlap Signed-off-by: Mukesh Rathor --- v15: - Break pvcpuid into a separate patch CC: Jan Beulich CC: Tim Deegan CC: Keir Fraser CC: Jun Nakajima CC: Eddie Dong --- xen/arch/x86/hvm/vmx/vmx.c | 2 +- xen/arch/x86/traps.c | 2 +- xen/include/asm-x86/processor.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 8289e3a..bc86f93 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2748,8 +2748,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) break; } case EXIT_REASON_CPUID: + is_pvh_vcpu(v) ? pv_cpuid(regs) : vmx_do_cpuid(regs); update_guest_eip(); /* Safe: CPUID */ - vmx_do_cpuid(regs); break; case EXIT_REASON_HLT: update_guest_eip(); /* Safe: HLT */ diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index edb7a6a..852b8e6 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -729,7 +729,7 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx, return 1; } -static void pv_cpuid(struct cpu_user_regs *regs) +void pv_cpuid(struct cpu_user_regs *regs) { uint32_t a, b, c, d; diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 893afa3..551036d 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -567,6 +567,8 @@ void microcode_set_module(unsigned int); int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len); int microcode_resume_cpu(int cpu); +void pv_cpuid(struct cpu_user_regs *regs); + #endif /* !__ASSEMBLY__ */ #endif /* __ASM_X86_PROCESSOR_H */ -- 1.7.9.5