From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.12.80] (unknown [182.2.69.4]) by gnuweeb.org (Postfix) with ESMTPSA id E05F07E2C4; Sun, 20 Mar 2022 15:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1647788946; bh=RI2pkVzqveOuxBvWu4F+M+4HsSWEh++MgqMXUyJVxAU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SlHIXPUJv10qRdUSpDIrnBebOXtYKTB7PW7pS788CWApSybPqObMyCQLgooiENeyU eG7btVKoK70FC5a9oKEoc0JANIh/RBi3MFvMyPsPy6JfHJxHPXXe364cgYxWsaa8je ZdnrKtul2psQvyXeOLTKRUYLZIten7J/rn61AwixHNPZoE36oR5FDO/AtM2+G6UvLF AZIGhlzshtTcpobPbeOf6fyTkWxwQlBQ9YUtFy5T3IE4MxMuxFt3beD72P7Axh5h2/ R5keyd7OCg02CvBW5u4fr65q6ekM8FN5wWLwSgS6wkOO6sQcaNvMREy6I8cbr0Xc3M pzrNDHEntGM2Q== Message-ID: <9ba9c8bd-d4e1-a9c5-9269-4cecb1b109f6@gnuweeb.org> Date: Sun, 20 Mar 2022 22:09:00 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [RFC PATCH v1 3/6] tools/nolibc: i386: Implement syscall with 6 arguments Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Willy Tarreau , "Paul E. McKenney" , Nugraha , Linux Kernel Mailing List , GNU/Weeb Mailing List , x86@kernel.org, llvm@lists.linux.dev, David Laight References: <20220320093750.159991-1-ammarfaizi2@gnuweeb.org> <20220320093750.159991-4-ammarfaizi2@gnuweeb.org> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: 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