From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 23/24] PVH xen: preparatory patch for the pvh vmexit handler patch Date: Mon, 22 Jul 2013 15:24:05 -0400 Message-ID: <20130722192405.GK30300@phenom.dumpdata.com> References: <1374114788-27652-1-git-send-email-mukesh.rathor@oracle.com> <1374114788-27652-24-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1374114788-27652-24-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: Mukesh Rathor Cc: Xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Jul 17, 2013 at 07:33:07PM -0700, Mukesh Rathor wrote: > This is a preparatory patch for the next pvh vmexit handler patch. > > Signed-off-by: Mukesh Rathor Reviewed-by: Konrad Rzeszutek Wilk > --- > 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 8638850..fb55ac8 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 8f08253..59070a8 100644 > --- a/xen/arch/x86/hvm/vmx/vmx.c > +++ b/xen/arch/x86/hvm/vmx/vmx.c > @@ -2491,6 +2491,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 5325e92..1e8cf60 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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel