lkml.org 
[lkml]   [2022]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v1 3/6] tools/nolibc: i386: Implement syscall with 6 arguments
From
On 3/20/22 5:42 PM, Alviro Iskandar Setiawan wrote:
> On Sun, Mar 20, 2022 at 5:33 PM Alviro Iskandar Setiawan wrote:
[...]
>> I don't think you can safely use redzone from inline Assembly. The
>> compiler may also use redzone for a leaf function. In case the syscall
>> is done at the same time, your %ebp saving will clobber the redzone
>> that the compiler uses.

It turned out we don't have a redzone for 32-bit.

>>
>> -4(%esp) may be used by the compiler on a leaf call, you can't clobber that.

Yeah, this is still wrong even with a redzone.

> Using xchgl to preserve %ebp in the same place where the arg6 is
> stored in memory is a better solution and doesn't clobber anything.
>
> xchgl %ebp, %[arg6]
> int $0x80
> xchgl %ebp, %[arg6]

Addressed your review in my response to David.

Thanks!

--
Ammar Faizi

\
 
 \ /
  Last update: 2022-03-20 16:10    [W:0.069 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site