Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1082635lqp; Sun, 14 Apr 2024 13:31:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKcqu0oQVgeXXak5r2eKR4Zk9CZHOY71TFJ7xHssKpu/1ksPFgFzZ69B0bXQghMs7Sc4qRvqQ9xrpzzPBeA4kuxZ7dXZTrilFY/RzXGQ== X-Google-Smtp-Source: AGHT+IEt8K8QtVCndsPkSf11e8xb4IAetVJ3n2QG+BaPIbI/qgkrDx6VggOWszGZABdXK4z3W8eZ X-Received: by 2002:a17:906:6a1d:b0:a52:5230:b076 with SMTP id qw29-20020a1709066a1d00b00a525230b076mr3069459ejc.2.1713126673349; Sun, 14 Apr 2024 13:31:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713126673; cv=pass; d=google.com; s=arc-20160816; b=yAUVaHx2F3nGqGKcH6oGGTac+KBTV7hXN3hMONtH1bs1riSHvTiaVQlx9fc6MJXBBd ok0wZE+bqX8+R1F9FUEQTvywD+/WY0DbFDYQ2swsNUYD9X4Q2BoWonEN5F9hiOC4urqU zwHSId8Lsl4KrYhzNNGxmRBbuMGoY02MSbMfo0eBYti9VkXdPZ0ojTBzpLgF2TZwhmtv gISKr/MHgiWXOO+c8b2BNX50KtcaxKZ7UBp0tkl3Peb6q1K4OoB+0lUw9x5cCYhopIRM fr5ZOWmCSltdiDaW7gYB8rP4/DTsBI39ZQ1Gii+EbKevnU2ILe8g6MD4mqFvmANrGOLp bVDw== 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=jzfnCt6MwA7mlbD5Ni975zwHrqskJjfA2Vc3Q48aQ9U=; fh=PWuAr+XPFpCbunXbZa1Yzef2JI4uxi1V7IN3Rq2MhVw=; b=X6LEDE0pRlmagpfZJ0nMHxcKT3ZvBwdKpPXXvg/n8yMpybJXJqN6rE9BPBuS8EJ4PS cgKZqijfBaVC13xqQb+z7wxo9FslfzB7hOIcldkb5z8fALeOL7Zne24T/kZGDW2LHEkc fIWkE1l9oRHVP7NLMxmsrDrlc7KSzALrBWslW4N1gel2HUpNuOduSr75z4hISbDsQbEm t4kffvUqIyk4+hJ7tvwtQdZaElfLqzqT9fm37CZbhfPyUZQZLLRXLmqkEq+TuZvZAh3x IHqHzR5ZxjOKq7vMrJ3GcF30Xs0MlJl8eNFU7fwL6Xg7wpRN/0c17e1GQ287I7NGatWi q8sQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ng0i0Szo; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/03f4xDg"; 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-144367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144367-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hv15-20020a17090760cf00b00a51a47b1e84si3968677ejc.1011.2024.04.14.13.31.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 13:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ng0i0Szo; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/03f4xDg"; 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-144367-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144367-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 18AB51F211AE for ; Sun, 14 Apr 2024 20:31:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42F3D57329; Sun, 14 Apr 2024 20:31:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ng0i0Szo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/03f4xDg" 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 37D7918E1D; Sun, 14 Apr 2024 20:31:02 +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=1713126665; cv=none; b=GC/XZmvatqERJEn+QhoQHxeK0FS6xiNx7+xq95fy0OL7CwaZpZZY/GKtGJKIHoueZ6YEtUk4Coih9feRPaQTIogrKcuhNVd0j35KZDV4amwFbS6N9G56k9yyP5vh6IG7B4/U/EEw8qFblO7eWwNgG0wVKkhmusY++Kxk7O5STWg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713126665; c=relaxed/simple; bh=Zr86x+Obz3aa/9/st1/IprGeAptvcgvhzJm6/aM7N9w=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=It3BfaHftRCoRXpwOZsqWf16PsTeyQdZxBk0cGbmPoDRVAKE14iGO+5oho7WMt6qcCosc5jH8F7Noe+PSFi398HSyiRxgpKbvOzjZRqiZuszfN8LsaUKwWZtjj0tYrld46yrXDEeVQJ4ZfKWcUlJPQTUdG0kC/5RShbjF2bWEAo= 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=ng0i0Szo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/03f4xDg; 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: Sun, 14 Apr 2024 20:31:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713126661; 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=jzfnCt6MwA7mlbD5Ni975zwHrqskJjfA2Vc3Q48aQ9U=; b=ng0i0Szoq9vzmuFEtPZoJEXsHuTWDbEq6IPDdppY/Dg/zJA9fYxB8stD5AY1cbOfUjSwR6 20gLk71NIGRYQcHWDO88PVv3l5nbkhrvom7UZBvCQiuNp31Z2sF7muqssjw6JwP3d/uUMS WqTnLBRNwoEQ3n5rZOncYDSZh9hzXZBAWamVBz6H1HjYW1KL0jB5VZ9Bn2i/zWiGSaiIRP QN7rNyfRM1ikp7U2Y2ahR2dKCYLcvooFqFx4XHfcWVTULo281zuwKSXrjpJD8mUUSs1cIn vw7M7rfsFMq8FtOVafZYSgVb0CnbiL9DrMHFWQ0ULlIpe66NeNFmxyYnSjP5IA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713126661; 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=jzfnCt6MwA7mlbD5Ni975zwHrqskJjfA2Vc3Q48aQ9U=; b=/03f4xDgOe9UaLxCDgnjbntTU7aeCdJ1Zkl+IWIFk8sw/mh5CJZBSNwQmiQ2P2K37w3zQW v75129qxNqIL/eBw== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] x86/pat: Restructure _lookup_address_cpa() Cc: Juergen Gross , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240412151258.9171-4-jgross@suse.com> References: <20240412151258.9171-4-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171312666005.10875.4683532431046752245.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/mm branch of tip: Commit-ID: 02eac06b820c3eae73e5736ae62f986d37fed991 Gitweb: https://git.kernel.org/tip/02eac06b820c3eae73e5736ae62f986d37fed991 Author: Juergen Gross AuthorDate: Fri, 12 Apr 2024 17:12:57 +02:00 Committer: Ingo Molnar CommitterDate: Sun, 14 Apr 2024 22:16:28 +02:00 x86/pat: Restructure _lookup_address_cpa() Modify _lookup_address_cpa() to no longer use lookup_address(), but only lookup_address_in_pgd(). This is done in preparation of using lookup_address_in_pgd_attr(). No functional change intended. Signed-off-by: Juergen Gross Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20240412151258.9171-4-jgross@suse.com --- arch/x86/mm/pat/set_memory.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c index bfa0aae..4ebccaf 100644 --- a/arch/x86/mm/pat/set_memory.c +++ b/arch/x86/mm/pat/set_memory.c @@ -744,11 +744,14 @@ EXPORT_SYMBOL_GPL(lookup_address); static pte_t *_lookup_address_cpa(struct cpa_data *cpa, unsigned long address, unsigned int *level) { - if (cpa->pgd) - return lookup_address_in_pgd(cpa->pgd + pgd_index(address), - address, level); + pgd_t *pgd; + + if (!cpa->pgd) + pgd = pgd_offset_k(address); + else + pgd = cpa->pgd + pgd_index(address); - return lookup_address(address, level); + return lookup_address_in_pgd(pgd, address, level); } /*