Skip to contentSkip to conversation

32-bit binaries failing in 64 bit guests after using vmport

DISCUSSION Soren Hansen 2 participants 3 messages Apr 21, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Esteemed kvm developers!

I've been trying to debug this bug

    https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/219165

It originally revealed itself by failing to run grub (which is a 32 bit binary) when installing Ubuntu from our live cd. It turned out to be a more general problem of 32 bit binaries failing to run. The server install worked like a charm. I eventually discovered that loading the vmmouse driver triggered it and narrowed it down to the call to kvm_load_registers in vmport_ioport_read.

We're releasing on Thursday, and I needed a quick fix, so I reverted the calls to kvm_{save,load}_registers in vmport_ioport_read to the old code that simply saved the eax, ebx, ecx, edx, esi, and edi registers, but I'm supposing kvm_{load,save}_registers really should work here.

I dug a bit further into the code and tried disabling various pieces of the kvm_load_registers until it finally worked again. The problem seems to only arise when the lstar msr is loaded. I've looked at the code, but seeing as three days ago I didn't know there was such a thing as an lstar msr, I'm finding myself getting stuck. :)

Any pointers in the right direction would be lovely.

Signature · 3 lines
Soren Hansen               | 
Virtualisation specialist  | Ubuntu Server Team
Canonical Ltd.             | http://www.ubuntu.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

#1 lore raw
Quoted 13 lines · Soren Hansen

Esteemed kvm developers!

I've been trying to debug this bug

    https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/219165

It originally revealed itself by failing to run grub (which is a 32 bit binary) when installing Ubuntu from our live cd. It turned out to be a more general problem of 32 bit binaries failing to run. The server install worked like a charm. I eventually discovered that loading the vmmouse driver triggered it and narrowed it down to the call to kvm_load_registers in vmport_ioport_read.

Quoted 5 lines

We're releasing on Thursday, and I needed a quick fix, so I reverted the calls to kvm_{save,load}_registers in vmport_ioport_read to the old code that simply saved the eax, ebx, ecx, edx, esi, and edi registers, but I'm supposing kvm_{load,save}_registers really should work here.

Ah, you may have missed the fix that updated the KVM load/save functions to deal with the in-kernel APIC.

It turns out, vmmouse was horribly broken with SMP guests too. See

commit 9949bd84ac4dfdfc60b2974557819637b8719911

Author: Anthony Liguori <[email protected]>
Date:   Thu Apr 3 18:37:16 2008 -0500

commit 5208ce19dca268f84a2b9441c2fbb6129161e44c

Author: Marcelo Tosatti <[email protected]>
Date:   Thu Apr 3 20:24:37 2008 -0300

commit 85a67aa2a1b942ddccfcbd625d280869367edc95

Author: Marcelo Tosatti <[email protected]>
Date:   Fri Apr 11 13:24:41 2008 -0300

Regards,

Anthony LIguori

Quoted 18 lines

I dug a bit further into the code and tried disabling various pieces of the kvm_load_registers until it finally worked again. The problem seems to only arise when the lstar msr is loaded. I've looked at the code, but seeing as three days ago I didn't know there was such a thing as an lstar msr, I'm finding myself getting stuck. :)

Any pointers in the right direction would be lovely.

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

#2 lore raw
Quoted 5 lines · Anthony Liguori
Quoted 5 lines

We're releasing on Thursday, and I needed a quick fix, so I reverted the calls to kvm_{save,load}_registers in vmport_ioport_read to the old code that simply saved the eax, ebx, ecx, edx, esi, and edi registers, but I'm supposing kvm_{load,save}_registers really should work here.

/me sighs very deeply

Ok, first chance I get, I'm signing up for "Patch management 101". :( I got some tests mixed around, so it failing is actually dependent on whether EIP (not LSTAR as I originally thought) is restored or not.

I have a patch that fixes it, but I need to work a few things out first before I submit it.

Quoted 2 lines

Ah, you may have missed the fix that updated the KVM load/save functions to deal with the in-kernel APIC.

Indeed.

Quoted 9 lines

It turns out, vmmouse was horribly broken with SMP guests too. See

commit 9949bd84ac4dfdfc60b2974557819637b8719911

Author: Anthony Liguori <[email protected]>
Date:   Thu Apr 3 18:37:16 2008 -0500

commit 5208ce19dca268f84a2b9441c2fbb6129161e44c

Author: Marcelo Tosatti <[email protected]>
Date:   Thu Apr 3 20:24:37 2008 -0300

I did my tests using kvm-65 userland and kernel, so these two should already be included, afaics.

Quoted 3 lines

commit 85a67aa2a1b942ddccfcbd625d280869367edc95

Author: Marcelo Tosatti <[email protected]>
Date:   Fri Apr 11 13:24:41 2008 -0300

This did not change anything for me.

Signature · 3 lines
Soren Hansen               | 
Virtualisation specialist  | Ubuntu Server Team
Canonical Ltd.             | http://www.ubuntu.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel