Re: [uml-devel] Re: [PATCH 3/4] UML - Properly invoke x86_64 system calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 17 November 2005 21:37, linux-os (Dick Johnson) wrote:
> On Thu, 17 Nov 2005, Jeff Dike wrote:
> > This patch makes stub_segv use the stub_syscall macros.  This was
> > needed anyway, but the bug that prompted this was the discovery that
> > gcc was storing stuff in RCX, which is trashed across a system
> > call.

> But the C-calling convention used by gcc for 32-bit systems
> is supposed to allow the called-function to destroy general-
> purpose registers but not index registers. In other words,
> ECX, EDX are supposed to be available and EAX is used for
> return-values. The register size isn't supposed to have
> anything to do with it (longword/quadword)!

> In 64-bit world, the same is supposed to apply as well.
> If RCX is now precious, it's a GCC bug that should be fixed.

It's not _normally_ precious, for function calling conventions, but syscalls 
are different.

Read include/asm-x86_64/unistd.h and see that the _syscallX macros contain 
various register clobber. I.e. they explicitly tell GCC "don't use that". We 
(UML code) were missing that. Simple.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux