Jiang, Yunhong
2009-Dec-14 09:40 UTC
[Xen-devel] [PATCH] Fix build failure in 32 environment
Fix 32bit Hypervisor build issue, caused by memory hot-add changes and rdtscp patch. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> diff -r 45fc26e2d05a xen/arch/x86/hvm/vmx/vmx.c --- a/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 14 08:00:26 2009 +0000 +++ b/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 14 17:26:43 2009 +0800 @@ -2558,6 +2558,7 @@ asmlinkage void vmx_vmexit_handler(struc __update_guest_eip(inst_len); hvm_rdtsc_intercept(regs); break; +#ifdef __x86_64__ case EXIT_REASON_RDTSCP: { struct vmx_msr_state *guest_state = &v->arch.hvm_vmx.msr_state; @@ -2567,6 +2568,7 @@ asmlinkage void vmx_vmexit_handler(struc regs->ecx = (uint32_t)(guest_state->msrs[VMX_INDEX_MSR_TSC_AUX]); break; } +#endif case EXIT_REASON_VMCALL: { int rc; diff -r 45fc26e2d05a xen/include/asm-x86/mm.h --- a/xen/include/asm-x86/mm.h Mon Dec 14 08:00:26 2009 +0000 +++ b/xen/include/asm-x86/mm.h Mon Dec 14 17:33:13 2009 +0800 @@ -480,12 +480,14 @@ extern int pagefault_by_memadd(unsigned extern int pagefault_by_memadd(unsigned long addr, struct cpu_user_regs *regs); extern int handle_memadd_fault(unsigned long addr, struct cpu_user_regs *regs); #else -int pagefault_by_memadd(unsigned long addr, struct cpu_user_regs *regs) +static inline int pagefault_by_memadd(unsigned long addr, + struct cpu_user_regs *regs) { return 0; } -int handle_memadd_fault(unsigned long addr, struct cpu_user_regs *regs) +static inline int handle_memadd_fault(unsigned long addr, + struct cpu_user_regs *regs) { return 0; } @@ -533,7 +535,10 @@ int map_ldt_shadow_page(unsigned int); #ifdef CONFIG_X86_64 extern int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm); #else -int memory_add(uint64_t spfn, uint64_t epfn, uint32_t pxm) {return -ENOSYS}; +static inline int memory_add(uint64_t spfn, uint64_t epfn, uint32_t pxm) +{ + return -ENOSYS; +} #endif #ifdef CONFIG_COMPAT _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2009-Dec-14 15:48 UTC
RE: [Xen-devel] [PATCH] Fix build failure in 32 environment
If I remember correctly, rdtscp is a valid instruction in 32-bit mode so why are you disabling support for 32-bit Xen? Personally, I don''t care if 32-bit Xen is supported, but either we need to say it is supported or it is not supported, not have new features randomly choose to support it or not, especially features that have impact on userland applications.> -----Original Message----- > From: Jiang, Yunhong [mailto:yunhong.jiang@intel.com] > Sent: Monday, December 14, 2009 2:40 AM > To: Keir Fraser > Cc: Xu, Dongxiao; xen-devel@lists.xensource.com > Subject: [Xen-devel] [PATCH] Fix build failure in 32 environment > > > Fix 32bit Hypervisor build issue, caused by memory hot-add > changes and rdtscp patch. > > Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> > Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> > > diff -r 45fc26e2d05a xen/arch/x86/hvm/vmx/vmx.c > --- a/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 14 08:00:26 2009 +0000 > +++ b/xen/arch/x86/hvm/vmx/vmx.c Mon Dec 14 17:26:43 2009 +0800 > @@ -2558,6 +2558,7 @@ asmlinkage void vmx_vmexit_handler(struc > __update_guest_eip(inst_len); > hvm_rdtsc_intercept(regs); > break; > +#ifdef __x86_64__ > case EXIT_REASON_RDTSCP: > { > struct vmx_msr_state *guest_state = > &v->arch.hvm_vmx.msr_state; > @@ -2567,6 +2568,7 @@ asmlinkage void vmx_vmexit_handler(struc > regs->ecx = > (uint32_t)(guest_state->msrs[VMX_INDEX_MSR_TSC_AUX]); > break; > } > +#endif > case EXIT_REASON_VMCALL: > { > int rc; > diff -r 45fc26e2d05a xen/include/asm-x86/mm.h > --- a/xen/include/asm-x86/mm.h Mon Dec 14 08:00:26 2009 +0000 > +++ b/xen/include/asm-x86/mm.h Mon Dec 14 17:33:13 2009 +0800 > @@ -480,12 +480,14 @@ extern int pagefault_by_memadd(unsigned > extern int pagefault_by_memadd(unsigned long addr, struct > cpu_user_regs *regs); > extern int handle_memadd_fault(unsigned long addr, struct > cpu_user_regs *regs); > #else > -int pagefault_by_memadd(unsigned long addr, struct > cpu_user_regs *regs) > +static inline int pagefault_by_memadd(unsigned long addr, > + struct cpu_user_regs *regs) > { > return 0; > } > > -int handle_memadd_fault(unsigned long addr, struct > cpu_user_regs *regs) > +static inline int handle_memadd_fault(unsigned long addr, > + struct cpu_user_regs *regs) > { > return 0; > } > @@ -533,7 +535,10 @@ int map_ldt_shadow_page(unsigned int); > #ifdef CONFIG_X86_64 > extern int memory_add(unsigned long spfn, unsigned long > epfn, unsigned int pxm); > #else > -int memory_add(uint64_t spfn, uint64_t epfn, uint32_t pxm) > {return -ENOSYS}; > +static inline int memory_add(uint64_t spfn, uint64_t epfn, > uint32_t pxm) > +{ > + return -ENOSYS; > +} > #endif > > #ifdef CONFIG_COMPAT > > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Dec-14 16:28 UTC
Re: [Xen-devel] [PATCH] Fix build failure in 32 environment
On 14/12/2009 15:48, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:> If I remember correctly, rdtscp is a valid instruction > in 32-bit mode so why are you disabling support for > 32-bit Xen? > > Personally, I don''t care if 32-bit Xen is supported, > but either we need to say it is supported or it is > not supported, not have new features randomly choose > to support it or not, especially features that have > impact on userland applications.It can be supported for existign features but not all new ones. We can perhaps retire it all together after 4.0. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2009-Dec-14 16:52 UTC
RE: [Xen-devel] [PATCH] Fix build failure in 32 environment
> > If I remember correctly, rdtscp is a valid instruction > > in 32-bit mode so why are you disabling support for > > 32-bit Xen? > > > > Personally, I don''t care if 32-bit Xen is supported, > > but either we need to say it is supported or it is > > not supported, not have new features randomly choose > > to support it or not, especially features that have > > impact on userland applications. > > It can be supported for existign features but not all new ones. We can > perhaps retire it all together after 4.0.IMHO, this is not a new feature, this is an ABI incompatibility issue. If rdtscp is a valid 32-bit instruction, IMHO it should either work on both 32-bit Xen and 64-bit Xen or neither. Was this patch a quick hack to allow the code to compile for 32-bit Xen or was it a reasoned decision to disallow support on 32-bit Xen? (And, in any case, if rdtscp is a "new feature", why was the patch accepted post-freeze, especially when there is still lively debate going on? ;-) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Dec-14 17:45 UTC
Re: [Xen-devel] [PATCH] Fix build failure in 32 environment
On 14/12/2009 16:52, "Dan Magenheimer" <dan.magenheimer@oracle.com> wrote:>> It can be supported for existign features but not all new ones. We can >> perhaps retire it all together after 4.0. > > IMHO, this is not a new feature, this is an ABI incompatibility > issue. If rdtscp is a valid 32-bit instruction, IMHO it > should either work on both 32-bit Xen and 64-bit Xen or > neither.It only needs to work if we advertise RDTSCP in CPUID. Which we don''t for 32-bit hosts. There''s really nothing wrong with the patch that I can see. I''d rather have the CPUID frobbing in xc_cpuid_x86.c, but it''s a minor concern. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2009-Dec-14 18:22 UTC
RE: [Xen-devel] [PATCH] Fix build failure in 32 environment
> >> It can be supported for existign features but not all new > ones. We can > >> perhaps retire it all together after 4.0. > > > > IMHO, this is not a new feature, this is an ABI incompatibility > > issue. If rdtscp is a valid 32-bit instruction, IMHO it > > should either work on both 32-bit Xen and 64-bit Xen or > > neither. > > It only needs to work if we advertise RDTSCP in CPUID. Which > we don''t for > 32-bit hosts. There''s really nothing wrong with the patch > that I can see. > I''d rather have the CPUID frobbing in xc_cpuid_x86.c, but it''s a minor > concern.An application should be able to check the CPUID bit once and assume that it doesn''t change. If live migration and save/restore don''t work between a 32-bit Xen and a 64-bit Xen, you are technically correct. This is true of the open source xm tools, but I don''t know that it is true of all distro toolsets. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jiang, Yunhong
2009-Dec-15 01:45 UTC
RE: [Xen-devel] [PATCH] Fix build failure in 32 environment
This patch itself is only for 32-bit version compile success.>From this bug, seems the 32-bit xen hypervisor is really not so populated.--jyh>-----Original Message----- >From: xen-devel-bounces@lists.xensource.com >[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Dan Magenheimer >Sent: Tuesday, December 15, 2009 12:53 AM >To: Keir Fraser; Jiang, Yunhong >Cc: Xu, Dongxiao; xen-devel@lists.xensource.com >Subject: RE: [Xen-devel] [PATCH] Fix build failure in 32 environment > >> > If I remember correctly, rdtscp is a valid instruction >> > in 32-bit mode so why are you disabling support for >> > 32-bit Xen? >> > >> > Personally, I don''t care if 32-bit Xen is supported, >> > but either we need to say it is supported or it is >> > not supported, not have new features randomly choose >> > to support it or not, especially features that have >> > impact on userland applications. >> >> It can be supported for existign features but not all new ones. We can >> perhaps retire it all together after 4.0. > >IMHO, this is not a new feature, this is an ABI incompatibility >issue. If rdtscp is a valid 32-bit instruction, IMHO it >should either work on both 32-bit Xen and 64-bit Xen or >neither. > >Was this patch a quick hack to allow the code to compile >for 32-bit Xen or was it a reasoned decision to disallow >support on 32-bit Xen? > >(And, in any case, if rdtscp is a "new feature", why was >the patch accepted post-freeze, especially when there >is still lively debate going on? ;-) > >_______________________________________________ >Xen-devel mailing list >Xen-devel@lists.xensource.com >http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel