Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6790112rwr; Tue, 9 May 2023 22:24:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yD5kb8M2/wMNqWdlqpWYoAKQYKUNXDsPN3I/omao3DdbPplHqZTXwLHgQ6SLNGXSFehLb X-Received: by 2002:a17:902:b696:b0:1a9:bac2:21a2 with SMTP id c22-20020a170902b69600b001a9bac221a2mr15392878pls.21.1683696280616; Tue, 09 May 2023 22:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683696280; cv=none; d=google.com; s=arc-20160816; b=WYXGY1Z3BxdyLVxLtofCQYHKulKqbiySbBXCoiGIifq6zzALf7RmNtPGHSicZwcgMM LxvLTzSNns5LJ8sC2zSE6gqs3VLvRR6nr44mbPDuu+NwROa5IgtK7J/NDKB9ZbD234+3 rKH7vBUJEpWfhVyk+RInzvcMlCRwrjIB61RNEVOMyZJXlgt2tQKgQj4wl8MEbB40mjLB 0obpwDBFTf4hRGKe/IUYEChMF4k7OrFPb13d1YBOreaAwl0I/0WEfUGHGco3v9q+zbur +ShaPnsEGjU4sjGxxOFTAZf5GW5ME+ac/lB93jCh+YaR/WFhCcN04jiTzbejTs8kzOsx SV3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=UmemeLuI+WpEQXgz9TQT0mwehV8FTU9BDTa5EhoH+Rw=; b=zVzL702X99Cp/ixoxnptl/3OhBkIK3WxMpPH/uOWhCKD/5Q/S+xaq1EaD2RdZI2Hhg GszTgUaTl0PXp/NaOTm1yYfVl3BYkHwKJgiaUEkYuZMtnUT7FFEEKzOmwdjeJoyAetXj DepUbGuZXU+wQ0Jud/D32grnqokuOeIhTkeYNgEeVkn/nxvqunWhyIWR7PRXSNHw8bKn DUUIgnc71ppa4yyj4qECHvtM5CEG7rFaPaAAhCPiqeZWmtMqqVRPz7EiNyz21SPHduBd hFYyMAvGqVLKvtxYb6lWRbP4XN76WdspsyoCLfpYKzP5qW3aYW7WXszh+7PD3Qx2f287 rL1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ceZayvLc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z5-20020a170902834500b0019e9c8e51f4si3074882pln.165.2023.05.09.22.24.28; Tue, 09 May 2023 22:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ceZayvLc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235899AbjEJFKB (ORCPT + 99 others); Wed, 10 May 2023 01:10:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235935AbjEJFJ6 (ORCPT ); Wed, 10 May 2023 01:09:58 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8944D4EE3 for ; Tue, 9 May 2023 22:09:55 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-559f1819c5dso101998077b3.0 for ; Tue, 09 May 2023 22:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683695395; x=1686287395; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=UmemeLuI+WpEQXgz9TQT0mwehV8FTU9BDTa5EhoH+Rw=; b=ceZayvLcQzK/jEmDGFktdiBeLmAfZAcJomtj6b8LZ7UVBhK1PGvRLGtv3raaIkoA69 8du4wIfy3LTg4noNW6T56a8rTdYN7Kpn5/bm4yjB4emMMTggN1PcgpP7ET0zc6Ogox7V PacpXMb40YNuRMAqf3IboaGbQzDmk/4AhKXM1jLiRZe7o3tGAOJ6z3OSnXWDEM8MmOjy leDcr9V/CMd1mPfM2iHPwMwcuDGyHWo5yaj5bkj6ZD28Zg+yk0+3HzvQJBuo9qxnWea2 qCcGWwBxF4a0/bB7X0FeLhxKH1U3vpEQVW9dVdnIidnAwcXxE3l++8L3bRK0NJ7IyPS8 JZIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683695395; x=1686287395; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UmemeLuI+WpEQXgz9TQT0mwehV8FTU9BDTa5EhoH+Rw=; b=TmAWhsAZPQK0rkrmverZ3Z/krFCZe+A1B7B9U5qTxy10lGSIYgQbzKCG5cAIQV/0/p +DDkcfFxOvloyJD898SSE5DH3XdCtpvrSdPUZSUSIkP62LyUtdLe1CA0qGNx8izNAPU2 uKEsta6fM71vyVxtf6BnTKa1z7zpOyZX3W48tY/OtE7RYCp7V2HAS44VsmsE0HZG8GmL 7FYMDFJC58JB9xyNzRCr/67qkQbRYIpAZMmictBVbkt/ZxMsSyWSsGEls98gTm1+kIG3 A01iHkI4oIRhXAiF7lSMp0ISQpAj0gqLBNSC28pT4zyd0pwhd605/pWmuznHEMC2HgBW I60w== X-Gm-Message-State: AC+VfDzmGpEtCMn0vU/71JwoVmlse2SzTYdxzm5nMuh9s4QzRu7/YWCE aGY+KcFi9rf/u1WjB7e2krTYvA== X-Received: by 2002:a81:92d7:0:b0:55a:4828:182a with SMTP id j206-20020a8192d7000000b0055a4828182amr18309481ywg.36.1683695394676; Tue, 09 May 2023 22:09:54 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id l64-20020a0dc943000000b0055aad7d3f34sm3766659ywd.142.2023.05.09.22.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 22:09:54 -0700 (PDT) Date: Tue, 9 May 2023 22:09:50 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 22/23] x86: sme_populate_pgd() use pte_offset_kernel() In-Reply-To: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Message-ID: <6d75e7f-2266-1dda-8a70-c52c27f44da7@google.com> References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sme_populate_pgd() is an __init function for sme_encrypt_kernel(): it should use pte_offset_kernel() instead of pte_offset_map(), to avoid the question of whether a pte_unmap() will be needed to balance. Signed-off-by: Hugh Dickins --- arch/x86/mm/mem_encrypt_identity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c index c6efcf559d88..a1ab542bdfd6 100644 --- a/arch/x86/mm/mem_encrypt_identity.c +++ b/arch/x86/mm/mem_encrypt_identity.c @@ -188,7 +188,7 @@ static void __init sme_populate_pgd(struct sme_populate_pgd_data *ppd) if (pmd_large(*pmd)) return; - pte = pte_offset_map(pmd, ppd->vaddr); + pte = pte_offset_kernel(pmd, ppd->vaddr); if (pte_none(*pte)) set_pte(pte, __pte(ppd->paddr | ppd->pte_flags)); } -- 2.35.3