WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] cygwin longjmp error on Xen guest - gs not restored?

To: Mikel Ward <mward@xxxxxxxxxx>
Subject: Re: [Xen-users] cygwin longjmp error on Xen guest - gs not restored?
From: Pasi Kärkkäinen <pasik@xxxxxx>
Date: Wed, 16 Sep 2009 12:52:24 +0300
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 16 Sep 2009 02:54:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1253088683.2656.77.camel@mward-laptop>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <1253088683.2656.77.camel@mward-laptop>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
On Wed, Sep 16, 2009 at 06:11:23PM +1000, Mikel Ward wrote:
> Hi All
> 
> A colleague tells me there is a problem with Xen 3.0.3 on RHEL5 where
> Cygwin's bash fails to call longjmp() in a Windows guest.
> 
> The consensus is that Xen and KVM both had a bug, but that Xen has not
> yet fixed it.  Indeed I couldn't find any proof that it had been
> reported to Xen, hence this email.
>

You should post this to xen-devel. I don't think the developers will
notice it from xen-users.

-- Pasi

> Original KVM bug report:
> http://sourceforge.net/tracker/?func=detail&atid=893831&aid=1872255&group_id=180599
> 
> Test case:
> http://article.gmane.org/gmane.comp.emulators.kvm.devel/28099
> 
> #include <setjmp.h>
> 
>   jmp_buf env;
>   main()
>   {
>        if(setjmp(env)) return;
>        longjmp(env, 1);
>   }
> 
> More details: it's something to do with the GS register:
> http://markmail.org/message/5aqlqtrld4ti4gse
> 
> #include <stdio.h>
> 
> int main()
> {
>   unsigned short gs;
>   unsigned x;
> 
>   asm ("mov %%gs, %0\n" : "=g"(gs));
>   asm ("movl %%gs:0x30, %0\n" : "=r"(x));
> 
>   printf("gs: %x\n", gs);
>   printf("gs:0x30: %x\n", x);
> 
>   asm ("mov %0, %%gs\n" : : "g"(gs));
> 
>   printf("test\n");
> 
>   asm ("movl %%gs:0x30, %0\n" : "=r"(x));
> 
>   return 0;
> }
> 
> 
> KVM fix:
> http://article.gmane.org/gmane.comp.emulators.kvm.devel/28418
> 
> diff --git a/kernel/x86/vmx.c b/kernel/x86/vmx.c
> index 7507ce2..048460d 100644
> --- a/kernel/x86/vmx.c
> +++ b/kernel/x86/vmx.c
> @@ -910,6 +910,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 
> msr_index, u64 *pdata)
>               data = vmcs_readl(GUEST_SYSENTER_ESP);
>               break;
>       default:
> +             vmx_load_host_state(vcpu);
>               msr = find_msr_entry(to_vmx(vcpu), msr_index);
>               if (msr) {
>                       data = msr->data;
> 
> 
> Another related KVM thread:
> http://markmail.org/message/owy3x7pf6oywdx5e
> 
> Cygwin developers:
> http://www.cygwin.com/ml/cygwin/2009-05/msg00841.html
> http://www.cygwin.com/ml/cygwin/2008-08/msg00437.html
> 
> 
> I'll be happy to spend some time helping to test/diagnose if you can
> tell me what you need me to do.
> 
> Thanks
> 
> Mike
> 
> 
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>