From patchwork Mon Feb 26 12:12:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 206611 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2045023dyb; Mon, 26 Feb 2024 04:42:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUgPiQNQzfytdz9dDJ59bzMg/IwaQsRpjv4jfehDA4f3bTNirKcTZg97IO4baOHbXVEzc180sJ2EWtWimRVB8B5U5bRuA== X-Google-Smtp-Source: AGHT+IGT7ql3rm7bf+rqYdkeNPsIK2Wb6f4bLAX7S3SwdFi9+ihTKxHuIiJB6pMKJN6pmpk9CCzH X-Received: by 2002:a17:902:b198:b0:1dc:a837:7e1b with SMTP id s24-20020a170902b19800b001dca8377e1bmr1587391plr.63.1708951350793; Mon, 26 Feb 2024 04:42:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951350; cv=pass; d=google.com; s=arc-20160816; b=lskj88alu1KV9ybkE8j1L1cbEypR+4KZdVCkI8izVaVG2Fi5Httpd7qVKJYTjxpjLF BGCU8Ul71ZGLt5kCDpf/9HaTmOWnLw4Nq5lLpwLP7gRKrEkgd3cK30yLs++FyKClc/kz 2WQkEDgTg69mzsW8RNffmR2ifw77M47LI6geh1opQPAuLK1o9s/fqiyY1LVcGXG2wHvI DDXXcAKDZJv6iQG6EmXp9NaBXoOSZLJoUJsGEioY8FzBaB/5o+o/cNuSjFcfvNYTQlHw 6M5GYiCLSd207yL7IirO3hA0L8c3UBx7BfWgQ3zBqTNrTXG3x00KBSvrEvOleFuFYgSm U5Qg== 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 header.b=cU85OEgu; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81342-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q6-20020a170902f78600b001d95f009fd0si3588718pln.367.2024.02.26.04.42.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:42:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81342-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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 header.b=cU85OEgu; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81342-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C757AB25E21 for ; Mon, 26 Feb 2024 12:13:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1ACB6086C; Mon, 26 Feb 2024 12:12:51 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791965371438201491 X-GMAIL-MSGID: 1791965371438201491 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;