Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4468502pxb; Thu, 14 Oct 2021 05:54:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjUrnHAtQo46GEdK68Jyd20fzcHVYZ5UwM8L8kHMIhZqZrE+Ji+DmL4HgPVqZaALwN11KY X-Received: by 2002:a17:902:f545:b0:13f:7ea:ca43 with SMTP id h5-20020a170902f54500b0013f07eaca43mr4909430plf.76.1634216072662; Thu, 14 Oct 2021 05:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634216072; cv=none; d=google.com; s=arc-20160816; b=AqwieD9SNtUvTHeRUWLRVMapum2RN5KH65WAccw9RZWWW+n/cNCR3ygJNjxtmZ2q0L pVRyiz8NFh91qTWYyiQDH/3BnO1ChzAVFxxq+a2Cm8Lvs1Brkaf95uH3uWu8l9rXqSPC j4Kv6qGwxkKjKirxgWYzSxi5JiRk11+LteTJNvL3/c9e9vFZhl5rIUmu+/F8EoVFeu4r gixFXVrnwQ8K2WMkkl4Po3QgyO2EIz6Udoi87dcYN2ZMZ0FtBQ8WnDTXM7dCtTBUZKpm 8YUpE6U7QelQBb2WLPNA5NwjAKGIqA3z5DQMNUvLAXZSDFkf10XumS52hOBNyhQLM1NS GtmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature:dkim-signature; bh=lJId1ojWsub/w97ZHLFGuzH74soILV0egGkPDhG79p8=; b=ghPrVPfvQuH5XrgTJ3IdSD3HhaZOnQuYeoxZAeRlngTXl6l0PuSO6NOJ2N0sHAFU1a Qq/txVws0BcZHiJchgwbjKuHh9+S1B51LNd4Qc2R/njwIDEzZI8IzOCk7ew3ODRRg8fG GbZstHyQlrOXovYaqJ7fGHdGqW4hkFBOQjMcnfpr+NilmPVTXK3PSKsdnkLxN3d4oP9U dxNerPIzzQXoiLRTWtGbqWifJSepo9OuGFSOnSxg1jPcKaHqbEtG8mb6BgqJQ3pwj7W6 tTZk4xawsSM+hOVknmb9+/WUBYO/B+2fcDrCqqpCUf2jOFmjFZi5RS4B9I7TNZJyQVj3 Ip+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Skupsgu0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Y7Oqztqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si1111393pgh.201.2021.10.14.05.54.19; Thu, 14 Oct 2021 05:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Skupsgu0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Y7Oqztqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231310AbhJNMqe (ORCPT + 99 others); Thu, 14 Oct 2021 08:46:34 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:37704 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbhJNMqd (ORCPT ); Thu, 14 Oct 2021 08:46:33 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C3C8C1FD29; Thu, 14 Oct 2021 12:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1634215467; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lJId1ojWsub/w97ZHLFGuzH74soILV0egGkPDhG79p8=; b=Skupsgu0LPQOdGvCMShBoovoQGeZDaqxOS+WmGeBXG9VgXU2e77GqjGASYAYu2CmUI/x+D WsXBeZr6LfSshnMVwLdfv5PS42jd0pYRuHcVvog0fNznVkS2Czh1gYfWu27GieKkxWxMv+ AfebV2QmKhqJTcCCbewzA7Urk/oqGg4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1634215467; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lJId1ojWsub/w97ZHLFGuzH74soILV0egGkPDhG79p8=; b=Y7OqztqhUjhy8e5pfKzpER0OZm4Wt0SgPZL+BbpeAo2X+HnBAzauojX0ttc3LsVQ8p4zvu K9W7SFfN0h4uqsBw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 782A7A3B83; Thu, 14 Oct 2021 12:44:27 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 6A0A865F5; Thu, 14 Oct 2021 12:44:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 68EC56514; Thu, 14 Oct 2021 12:44:27 +0000 (UTC) Date: Thu, 14 Oct 2021 12:44:27 +0000 (UTC) From: Michael Matz To: Borislav Petkov cc: Willy Tarreau , 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 In-Reply-To: Message-ID: References: <20211012222311.578581-1-ammar.faizi@students.amikom.ac.id> <20211013125142.GD5485@1wt.eu> <20211013140723.GE5485@1wt.eu> <20211013142433.GB8557@1wt.eu> <20211013163023.GD8557@1wt.eu> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, 13 Oct 2021, Borislav Petkov 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. > > Great, why are we dealing with some funky document when the law is in > glibc sources?! In theory, theory and practice are the same, in practice, they are not. Usually it's good to resolve a conflict towards what the document says, or intended to say. But glibc of course provides a huge amount of pressure to resolve toward it ;-) (laws are also changed toward practice when the latter overtakes :) ) Ciao, Michael.