Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1262072rbb; Mon, 26 Feb 2024 04:13:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWrHCXidqTY/zaO3kzIBoSVaqajHOkhJpOGgIE3bPsO4eGCisZMY93U702psIcKhEuln/b8Ja317nUn0gMuGADM2Fd3AArYz3GffHNZzg== X-Google-Smtp-Source: AGHT+IHA1xewbpXY8ost8GdLL58pB9qWrkI7slauR5AgxeQxoVpPdItfN1eQgaEZx8nJ6c2d63pq X-Received: by 2002:a05:6a21:2d86:b0:1a0:f4d2:31ab with SMTP id ty6-20020a056a212d8600b001a0f4d231abmr6634263pzb.19.1708949586370; Mon, 26 Feb 2024 04:13:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708949586; cv=pass; d=google.com; s=arc-20160816; b=jA9/WyzWr3uBpPdnKd6zmwOZ++xRVwHVd0/wk2iBW8kRmy1+Th2gPbV7f5ZY6mUE22 0dEKLHHTUN4ux0C6Yo7Q3COqQsyYkWfNLGHDRAiS73D1zWOH5vy7cYykX8ls2+/6fdfx sSCdV/rnWWi44l+XPgWYw3dCyIWMjE5YD1b/2sX8B3+8yc1mlzdTA+yxHYnc4w7wYjX9 4jx3JLkRBwBrWXAay35fn4tOHJP8padk4HIVP8uLzmCHkdI6FralOCPDyTH41tkmIGtl b8kwVVVaz79x8zZVcpdi8vEfHFoEMh9w54wfDtdvz+ZxjrnucZ+2EoFq/udbB9RGncqt n4Bg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=TCS5+J7KvMvad6FLXR5WOTfaQ75X+hv4sRaw/+/OesA=; fh=mh/EFXDyWz6SYA4qEbcbMgOZ07AT4DlRJonTEXgTb50=; b=wI4YrB0qi7wf/S8YsWlS72Nep62DfYwqh1PtGmOykTZQU3nS497fWPTMHNJ4CGRVal YXrmUJvcOhvxyPFVt1KOZw3WdGWoCEBEp13RwJBgejwq5m24cLvjao5XAmD2MWt+eQH2 PEU+c1BwZTxzpxO//g/ALNh8HsKN5/f+3jUoMCgUTt1L4aXdqxGwhHNchpw5gCJRI8Ut VVCdlzTVwYgdKt1M8N9XvJ+PnyYBBzmcHQfSSckWKEyMCA4bxJe7URquFAfsniqr3Gql DkrlRYiMHb23Izkz2EgSzId32UtQFmO8/m1axwvxn31RfS3jFYwE9mVsHaiRzOWlULG5 AjIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="hAxVLl/r"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-81342-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id il17-20020a17090b165100b0029acc0f3b56si1021909pjb.50.2024.02.26.04.13.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:13:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81342-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="hAxVLl/r"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-81342-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81342-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1535F289705 for ; Mon, 26 Feb 2024 12:13:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E68175FEF3; Mon, 26 Feb 2024 12:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hAxVLl/r"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cU85OEgu" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 9A7BE604A6; Mon, 26 Feb 2024 12:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949569; cv=none; b=lNt/LQqVl/IinGkHcw76gsafSESr/uc1dAgv1PVAMBnbQ9vNQf4H8MK+SdXsRcnbenHTcN8I0SkdI/HTEcIE7r/3Mwx0TfVeEuxQikuItIzclIOds119MIyLKCpTkjJLvMhwya5WwpOL0XxMFfMRrXdCzh8miZ5qgf8SnHK7PWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708949569; c=relaxed/simple; bh=bwRzofoQc1RDGlHqXnA41HlMJKkt5r3QOFjZX8uCq8Y=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=LM4ngieT4eYsQn0cl8kWZae04Fbi8KrjCaNlhGBEJYGMxSlM/ihRZ1D6AKMIy6zhrsl+G/Ioqpayia5gQoZskX2oBrNZuEPV8hXfTSwMt/S4uY03ICDTAb6ppAUW9M9GE0Z3QsQWSBeUC3KX2qLZhHAxoDXLkQNINDt3jDkrnt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hAxVLl/r; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cU85OEgu; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Mon, 26 Feb 2024 12:12:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708949566; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TCS5+J7KvMvad6FLXR5WOTfaQ75X+hv4sRaw/+/OesA=; b=hAxVLl/r47Bmd1s1tEBB83qwc/2lyryrzayVM2DoRgQOmNU7YUmPI2pnsVzk6gIAZUrRcn W+7zPWsCiPrZN7HzRMa9Ct4HA3QR22YtWwO1d0MqdeoQTcfPyIF8xndKGa1evfyert4iHP HWGCCF0YBNRDJy0pI1GErArBZJkHc102pHc6+iTcIfzYlO/iRKSu5L5cpLCA3L8xVg0N3Y vHTN+rMQML+5l/p8Y7lQsN/iwit8FTufQDBMvM93tkrQ/T2oG5dqeMpYYPM/pI0c8znqNt ilSw1AU8IySpMhes8gyrgc2j4ot6LHObO3cC/mv8dV5P125T6s2FIhf29Tt/bw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708949566; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TCS5+J7KvMvad6FLXR5WOTfaQ75X+hv4sRaw/+/OesA=; b=cU85OEguit2eLo1qNz+mHPbsigTgUdRXFtsqeD8grVMzakybyrU1SKLS614zYqTXuPBZ5K O0M+riZyfIxo31Aw== From: "tip-bot2 for Ard Biesheuvel" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot/64: Use RIP_REL_REF() to access '__supported_pte_mask' Cc: Ard Biesheuvel , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240221113506.2565718-22-ardb+git@google.com> References: <20240221113506.2565718-22-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170894956531.398.13914554549519966538.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/boot branch of tip: Commit-ID: 4f8b6cf25f5c119b117cb2a4bacb604a6cd00ff1 Gitweb: https://git.kernel.org/tip/4f8b6cf25f5c119b117cb2a4bacb604a6cd00ff1 Author: Ard Biesheuvel AuthorDate: Wed, 21 Feb 2024 12:35:11 +01:00 Committer: Ingo Molnar CommitterDate: Mon, 26 Feb 2024 12:58:35 +01:00 x86/boot/64: Use RIP_REL_REF() to access '__supported_pte_mask' '__supported_pte_mask' is accessed from code that executes from a 1:1 mapping so it cannot use a plain access from C. Replace the use of fixup_pointer() with RIP_REL_REF(), which is better and simpler. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20240221113506.2565718-22-ardb+git@google.com --- arch/x86/kernel/head64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 2ac9041..e2573dd 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -177,7 +177,6 @@ unsigned long __head __startup_64(unsigned long physaddr, p4dval_t *p4d; pudval_t *pud; pmdval_t *pmd, pmd_entry; - pteval_t *mask_ptr; bool la57; int i; @@ -259,8 +258,7 @@ unsigned long __head __startup_64(unsigned long physaddr, pmd_entry = __PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL; /* Filter out unsupported __PAGE_KERNEL_* bits: */ - mask_ptr = fixup_pointer(&__supported_pte_mask, physaddr); - pmd_entry &= *mask_ptr; + pmd_entry &= RIP_REL_REF(__supported_pte_mask); pmd_entry += sme_get_me_mask(); pmd_entry += physaddr;