From mboxrd@z Thu Jan 1 00:00:00 1970 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 C1EBA11185 for ; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P9cBRiB3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57497C43330 for ; 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-lj1-f173.google.com with SMTP id 38308e7fff4ca-2cf2adac1ccso26740361fa.3 for ; Thu, 25 Jan 2024 15:24:48 -0800 (PST) X-Gm-Message-State: AOJu0YxmWAhKP0OllOVyzbtexG7oZkQOUmaKy2VAjhWRU1FFW8yFb9r2 14U1eNax5FlLUJeDnl7N+ekAW8d3my6y18yL0AYjGxtSkGL7KLMj4UvOk4WujU805gOtU1x9DzX wcmfvffIXMtGgB4loObRhTut6ntw= X-Google-Smtp-Source: AGHT+IHB0caDko9nY9w72/lzhdsdAzPG/BA9d4nmkX755oG9KiJmerbz5g9MrFbgaGaGkBg5kzf7ENnZGzaxh4X5JdA= 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: llvm@lists.linux.dev 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.