From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24B7FC433F5 for ; Wed, 13 Oct 2021 16:30:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0417D60D42 for ; Wed, 13 Oct 2021 16:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233899AbhJMQcq (ORCPT ); Wed, 13 Oct 2021 12:32:46 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:44259 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbhJMQcl (ORCPT ); Wed, 13 Oct 2021 12:32:41 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 19DGUNSB009348; Wed, 13 Oct 2021 18:30:23 +0200 Date: Wed, 13 Oct 2021 18:30:23 +0200 From: Willy Tarreau To: Michael Matz Cc: Borislav Petkov , Ammar Faizi , Paul Walmsley , Palmer Dabbelt , Albert Ou , Linux Kernel Mailing List , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH] tools/nolibc: x86: Remove `r8`, `r9` and `r10` from the clobber list Message-ID: <20211013163023.GD8557@1wt.eu> References: <20211012222311.578581-1-ammar.faizi@students.amikom.ac.id> <20211013125142.GD5485@1wt.eu> <20211013140723.GE5485@1wt.eu> <20211013142433.GB8557@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Michael, On Wed, Oct 13, 2021 at 04:24:28PM +0000, Michael Matz wrote: (...) > In short: Ammars initial claim: > > > Linux x86-64 syscall only clobbers rax, rcx and r11 (and "memory"). > > > > - rax for the return value. > > - rcx to save the return address. > > - r11 to save the rflags. > > > > Other registers are preserved. > > is accurate and I will clarify the psABI to make that explicit. Many thanks for this very detailed explanation! Ammar, I'll take your patch. Thanks all, Willy