Skip to contentSkip to conversation

A clarification about sys32_execve/ia32_execve

Linux-ia64 Chandra Kapate 2 participants 3 messages Apr 4, 2003 – Apr 8, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
I was looking at how execve syscalls work wrt to 32/64 syscalls. I have a basic question. I appreciate if some once can clarify. I apologize if I am overlooking some thing very obvious.

The ia32_execve (in ia32_entry.S) sets up out0, out1, out2 and out3 before invoking sys32_execve. The out3 is setup for regs. But, in sys32_execve, the regs is set locally using 9th parameters. I can see how the regs is set using 9th parameter. I don't understand why is set again in sys32_execve when it is already set in out3 in ia32_execve and could have used as 4th parameter? Does args mis-match between ia32_execve and sys32_execve matter? OTH, sys_execve does use the regs set in ia64_execve. Sorry, if i am overlooking something.

Thanks,
Chandra

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

#1 lore raw

Hi Chandra,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Chandra Kapate

Chandra> Hi,
Chandra> I was looking at how execve syscalls work wrt to 32/64 Chandra> syscalls. I have a basic question. I appreciate if Chandra> some once can clarify. I apologize if I am overlooking Chandra> some thing very obvious.

Chandra> The ia32_execve (in ia32_entry.S) sets up out0, out1, Chandra> out2 and out3 before invoking sys32_execve. The out3 Chandra> is setup for regs. But, in sys32_execve, the regs Chandra> is set locally using 9th parameters. I can see how Chandra> the regs is set using 9th parameter. I don't Chandra> understand why is set again in sys32_execve Chandra> when it is already set in out3 in ia32_execve and Chandra> could have used as 4th parameter? Does args mis-match Chandra> between ia32_execve and sys32_execve matter? Chandra> OTH, sys_execve does use the regs set in ia64_execve. Chandra> Sorry, if i am overlooking something.

Looks like you found an inconsistency. The code should work as it stands, but it certainly looks confusing. It looks to me like one end of the interface was updated at one point but not the other.

The reason sys32_execve() works is because the 9th (scalar) argument is the first argument that gets passed on the stack. Taking its address will give "sp+16", which is exactly what out3 is set to.

Thanks for pointing out this inconsistency (I'll see about fixing it).

	--david
#2 lore raw
In reply to Chandra Kapate

Thanks for clarifying.
Chandra

Quoted 50 lines · --- David Mosberger

Hi Chandra,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, 4 Apr 2003 09:50:16 -0800 (PST),

Chandra Kapate <[email protected]> said:

Chandra> Hi,
Chandra> I was looking at how execve syscalls work
wrt to 32/64
Chandra> syscalls. I have a basic question. I
appreciate if
Chandra> some once can clarify. I apologize if I
am overlooking
Chandra> some thing very obvious.

Chandra> The ia32_execve (in ia32_entry.S) sets up
out0, out1,
Chandra> out2 and out3 before invoking
sys32_execve. The out3
Chandra> is setup for regs. But, in sys32_execve,
the regs
Chandra> is set locally using 9th parameters. I
can see how
Chandra> the regs is set using 9th parameter. I
don't
Chandra> understand why is set again in
sys32_execve
Chandra> when it is already set in out3 in
ia32_execve and
Chandra> could have used as 4th parameter? Does
args mis-match
Chandra> between ia32_execve and sys32_execve
matter?
Chandra> OTH, sys_execve does use the regs set in
ia64_execve.
Chandra> Sorry, if i am overlooking something.

Looks like you found an inconsistency. The code should work as it
stands, but it certainly looks confusing. It looks to me like one end
of the interface was updated at one point but not the other.

The reason sys32_execve() works is because the 9th (scalar) argument
is the first argument that gets passed on the stack.
Taking its
address will give "sp+16", which is exactly what out3 is set to.

Quoted 4 lines

Thanks for pointing out this inconsistency (I'll see about fixing it).

	--david

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com