Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp278228rdb; Thu, 25 Jan 2024 15:24:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFowERxcDn7Obj883+h+dO+GpRDFZQ7ObiG067UDfVIgLgxGcpEh38/wDiHqiqUc0nwhEJD X-Received: by 2002:a17:906:254d:b0:a2c:fe9d:c6b8 with SMTP id j13-20020a170906254d00b00a2cfe9dc6b8mr193350ejb.31.1706225098378; Thu, 25 Jan 2024 15:24:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706225098; cv=pass; d=google.com; s=arc-20160816; b=bca8OUoU529l+mqd+WPZ784J1Q2pgg803fdcOIc7y3R3SMFU/TMaCslcoyalaTUGRW 8rDSysG49fxgCcjete+mOX6JLOEtrzLbvU09+1pgWauZmiTGVq4LHr6ZHH4O+yuVVZM3 sKhWZ0JtKqBNd2J18zSjTOHpk8WozWhuQddyfibL6f3Tl0xc0BHd+j1VSD+e4y45OMEg sBgxmIrE18O9LRy2g96btul0+SjGrbtSUs3u3pjxZVJxdxr+ySDzKaQU3Y0LDYsbJPll Ev3rqHz8ywV7nT+OMNJZzf8+Iug0gqUtv71iy6QVTC8hAEjvr3J8r1TZrjOdzqfQfvxB vNvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=vmOXvN9Ea++qW+Jeg/w8r0Siq2joLqRT6FIK+TskivE=; fh=8ipTAKJRfoWD1pW92hNyjh5ekPbzJlp56V5nfSn0siw=; b=kJJXFFdUO0JH0cCMhLaTpmXJSxD8+HctyazPZJb9RbrYo0SNxrtiTD8YHdkT3vNIzM ungAcVHQmd8FOTyulUe/YEgnhxkzN0oSoKcVnCE9JPID6JggRv6d2Coiy9Pf3/34vIPU +0ksQS1VeVqh9jsuwMAUSNE+irXfkkTjHAT9MwUHZta7Qc8LyrFSAyztfSYqCJ9EQw5G 5DFUbGYtVrb26UaDqYg1FxrkcyabOwvXxjBIYNKwpN79rQxmsZ2n8HHa1Oaj/cTucZVM BrTQMKmr28xxuECkXaiu93KDPcVx7ISmfeMMGTMzCmuLX4xDUWiYS7RgV+8YEnWHtgRk AGcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9cBRiB3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gz23-20020a170906f2d700b00a34a80848desi113848ejb.1024.2024.01.25.15.24.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 15:24:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9cBRiB3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 268EE1F21DB7 for ; Thu, 25 Jan 2024 23:24:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97F97134AD; Thu, 25 Jan 2024 23:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P9cBRiB3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1EFB11731; Thu, 25 Jan 2024 23:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706225088; cv=none; b=IiRP1rVHbdNGRtTNvcZX3ctVJg402wDiq9R1qzPOetVkVmMByw8ycfLkCuv12v5nTQ69R6xbVBjqzuiYv6CjImXXFIVscTFAW9GqDOd0oveLJKOUVdqlrevrIdK9B9mKHiDHJ3znHE1OKd3z8AV+8yRuLjBDZuIErpBknmLGmKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706225088; c=relaxed/simple; bh=nvWG+QBFahtKdRU5auqjQY0W/k/VTqwcLTuI7owHaJE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ecFHTYapnUGAmTdLRv9UWH5e/EPOhUhR1LS1tq7rUhBu4Rsyue2oXoru4rLgL+1DoKF2sWt0LZKGo5rE96M5FMoEUM6pT/hm94y0V1iXlPLAFUZLz3CQYGfA4cwLwgw03uj50riYQDtkA3p8iIkSOxN+zBIg2AOuNX5WWO/tve4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P9cBRiB3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49CF8C43399; Thu, 25 Jan 2024 23:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706225088; bh=nvWG+QBFahtKdRU5auqjQY0W/k/VTqwcLTuI7owHaJE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P9cBRiB3pg4MVANgKJWfoqL8wVJluMjvpChMlST17x8HO32e3RCdVnq4mefr9ofg5 jSr0AN31PSu9mQmC6ZRq/619iQMhSasdEq8SzsJajb9cyx9SSrg3/cOV1wx8gTbhm/ CgENoVeC0A+OGB2KGe9Sb81+UMuFQ0MoeUlvh3Up7NnqURYAmNRtIdcYgEaRqlHi8k FIlzVhOPEsvljKsJ01Umy2rxidUgQz7gXn0cw/Uyc9PzA5drHGbJElr2uRvk1Gbr5X a+mD5EcTzDvbYc0tU/zCEpfpbW9lWbvY68yhaiYTqNatCch34Ubma5oMDP0th+Krgg 6S4u1bn01kQ7g== Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-510133ed214so3416208e87.1; Thu, 25 Jan 2024 15:24:48 -0800 (PST) X-Gm-Message-State: AOJu0YyvnUFofRxta4V7Rq0d9RyqHc9IQqKrIEJfMKhVgNZSGH2CEalR eCsRF6QXWbHUp/f7ClIHHKDxlFqs6t7C4XtgdvUo9dro6s4KbMSmy1tLLN5wdmsCAFZlJKR4/JY IqcPoFB73ovuSzX1G+Awp5yJA4LI= X-Received: by 2002:ac2:58c6:0:b0:510:1ea5:f747 with SMTP id u6-20020ac258c6000000b005101ea5f747mr274447lfo.9.1706225086479; Thu, 25 Jan 2024 15:24:46 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240125112818.2016733-19-ardb+git@google.com> <20240125112818.2016733-35-ardb+git@google.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 26 Jan 2024 00:24:35 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 16/17] x86/sev: Drop inline asm LEA instructions for RIP-relative references To: Kevin Loughlin Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Tom Lendacky , Dionna Glaze , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Justin Stitt , Brian Gerst , linux-arch@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 25 Jan 2024 at 21:46, Kevin Loughlin wro= te: > > On Thu, Jan 25, 2024 at 3:33=E2=80=AFAM Ard Biesheuvel wrote: > > > > The SEV code that may run early is now built with -fPIC and so there is > > no longer a need for explicit RIP-relative references in inline asm, > > given that is what the compiler will emit as well. > > > > Signed-off-by: Ard Biesheuvel > > --- > > arch/x86/mm/mem_encrypt_identity.c | 37 +++----------------- > > 1 file changed, 5 insertions(+), 32 deletions(-) > > snp_cpuid_get_table() in arch/x86/kernel/sev-shared.c (a helper > function to provide the same inline assembly pattern for RIP-relative > references) would also no longer be needed, as all calls to it would > now be made in position-independent code. We can therefore eliminate > the function as part of this commit. Yes that would be another nice cleanup.