[vbox-dev] [PATCH] Some 64-bit fixes

Gwenole Beauchesne gbeauchesne at mandriva.com
Mon Feb 5 08:17:26 PST 2007


> Thanks for the patches. However it would help if you described briefly
> what problems the different changes attempt to fix and in some cases
> explain why they fix it...

OK, sorry, there were 4 parts:

- cpuid() stuff. I actually got a SIGSEGV when I built vbox in 
BUILD_TYPE=release (default) mode. I have not really looked at the 
generated code but rather reimplemented it the way I was used too. ;-) 
I believe the constraint should have used "+r" to indicate an 
input/output register for the "=r" (*(uint32_t *)pvEBX) part.

- For the QEMU part. I also got a SIGSEGV in either 
REMR3EmulateInstruction() or REMR3Run(). By binary code pattern 
matching, I determined that the offending code was actually cpu_exec() 
where I could realise the callee-saved registers (here, %rbx) where not 
saved completely (the upper-half 32-bit were trashed away).

- The xpidl_util.c change was motivated from code inspection after 
looking at the build logs (warnings). strdup() was not defined, thus 
defaulting to (int) return which can yield to pointer truncation. 
Actually, I have not experienced the problem but it was my first 
attempt to review all pending warnings when building on x86_64.

- The last part was obvious since the PIDs printed out in the VBox 
error box looked the same so one of them was likely 64-bit with 
upper-bits non-zero as a NIL_RTPROCESS would be. The correct fix would 
have been to make RTPROCESS an integer type exactly as large as an 
ULONG (which turns out to use the Win32 semantics, i.e. a 32-bit value).

Thank you for VirtualBox and its decently commented code. ;-)


More information about the vbox-dev mailing list