From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: [PATCH 22/23] PVH xen: preparatory patch for the pvh vmexit handler patch Date: Fri, 19 Jul 2013 18:45:04 -0700 Message-ID: <1374284705-23122-23-git-send-email-mukesh.rathor@oracle.com> References: <1374284705-23122-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: In-Reply-To: <1374284705-23122-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.xensource.com, keir.xen@gmail.com List-Id: xen-devel@lists.xenproject.org This is a preparatory patch for the next pvh vmexit handler patch. Signed-off-by: Mukesh Rathor --- xen/arch/x86/hvm/vmx/pvh.c | 5 +++++ xen/arch/x86/hvm/vmx/vmx.c | 6 ++++++ xen/arch/x86/traps.c | 4 ++-- xen/include/asm-x86/hvm/vmx/vmx.h | 1 + xen/include/asm-x86/processor.h | 2 ++ xen/include/asm-x86/traps.h | 2 ++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/pvh.c b/xen/arch/x86/hvm/vmx/pvh.c index b37e423..8e61d23 100644 --- a/xen/arch/x86/hvm/vmx/pvh.c +++ b/xen/arch/x86/hvm/vmx/pvh.c @@ -20,6 +20,11 @@ #include #include +/* Implemented in the next patch */ +void vmx_pvh_vmexit_handler(struct cpu_user_regs *regs) +{ +} + /* * Set vmcs fields in support of vcpu_op -> VCPUOP_initialise hcall. Called * from arch_set_info_guest() which sets the (PVH relevant) non-vmcs fields. diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 7b141d6..97c3f76 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2502,6 +2502,12 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) if ( unlikely(exit_reason & VMX_EXIT_REASONS_FAILED_VMENTRY) ) return vmx_failed_vmentry(exit_reason, regs); + if ( is_pvh_vcpu(v) ) + { + vmx_pvh_vmexit_handler(regs); + return; + } + if ( v->arch.hvm_vmx.vmx_realmode ) { /* Put RFLAGS back the way the guest wants it */ diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index fe8b94c..9c82b45 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -745,7 +745,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; @@ -1904,7 +1904,7 @@ static int is_cpufreq_controller(struct domain *d) #include "x86_64/mmconfig.h" -static int emulate_privileged_op(struct cpu_user_regs *regs) +int emulate_privileged_op(struct cpu_user_regs *regs) { enum x86_segment which_sel; struct vcpu *v = current; diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 9e6c481..44e4136 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -474,6 +474,7 @@ void vmx_dr_access(unsigned long exit_qualification, struct cpu_user_regs *regs); void vmx_fpu_enter(struct vcpu *v); int vmx_pvh_set_vcpu_info(struct vcpu *v, struct vcpu_guest_context *ctxtp); +void vmx_pvh_vmexit_handler(struct cpu_user_regs *regs); int alloc_p2m_hap_data(struct p2m_domain *p2m); void free_p2m_hap_data(struct p2m_domain *p2m); diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 5cdacc7..22a9653 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -566,6 +566,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 */ diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h index 1d9b087..8c3540a 100644 --- a/xen/include/asm-x86/traps.h +++ b/xen/include/asm-x86/traps.h @@ -50,4 +50,6 @@ extern int send_guest_trap(struct domain *d, uint16_t vcpuid, unsigned int trap_nr); int emulate_forced_invalid_op(struct cpu_user_regs *regs); +int emulate_privileged_op(struct cpu_user_regs *regs); + #endif /* ASM_TRAP_H */ -- 1.7.2.3