On Feb 21, 2008, at 10:14 AM, Alexander Graf wrote:
On Feb 21, 2008, at 9:46 AM, Avi Kivity wrote:Bernhard Kaindl wrote:Hi,I found that on kvm-61 the cpuid in the guest was reported incorrectlywhen qemu-kvm was compiled with gcc-4.1 or 4.3. This resulted in linux-64bit not booting, complaining that it is not running on a 64-bit machine. Symptom: Unexpected behaviour after the assembly snippet.Solution: New assembly which is simpler and leaves optimizations to gcc,resulting in much shorter and maintainable code. Comments are welcome,There were two reasons for the obfuscated code: first, qemu-kvm.c usedto be compiled with ebx assigned to a global register, which can't beclobbered, and second not to cause excessive register pressure on i386.If a globally assigned register is in the clobbered list, gcc automatically stores and restores it. But if the problem is gone, that's even better.This new patch should address the second issue as well. For most of what I tested, using ebx worked perfectly fine. It failed with PIC code though, so here you are. We now save and restore ebx in the assembly and assign the value to a random free register.<kvm-cpuid.patch>
This version fixes a wrong identifier (%0 instead of %1) and makes things work without touching the stack. This works by using %esi as backup-register for %ebx. It furthermore moves "function" directly to eax, without relying on gcc optimizations to realize this.
Signed-off-by: Alexander Graf <[EMAIL PROTECTED]>
kvm-cpuid.patch
Description: Binary data
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel