From patchwork Wed May 10 05:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 91877 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3382282vqo; Tue, 9 May 2023 22:39:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6pHwMWE4k0HVT0UWwaGtn8PjpcY1FmLQYeroe71dbP+YvzAW2bwp11wDpuIFPH0jyz5yEz X-Received: by 2002:a05:6a20:3d84:b0:ee:6dc9:e794 with SMTP id s4-20020a056a203d8400b000ee6dc9e794mr20781343pzi.56.1683697152795; Tue, 09 May 2023 22:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683697152; cv=none; d=google.com; s=arc-20160816; b=wmazsxJ7ZVHtiCqNw4YokcXo7iEleuJVkwsDSOMYiGEqb1yfPsNTM3Qw5fqfVmJPnk EM1TfAGKKl1aS4dskq+8fyIde4wQFcMI6qpwPsBw+l4xUayjDGONd6sbIqLFeMQjhKcQ FtTFQkLKobizWfS5eR2WXGjrG+VvkdW8IYnoX/ClHuuSat15NukDLvfdfA/xMLYl49tK SVf38a5xROoh+QWcYD10g89OkOcVI+Xm9UcWFxCjLTdjeFWy4iEHgOgFSsomkeS8NQJN tt24vHN3VySB2SZQCx4P4tMA1FT9FELLc5b2ePcLi+Sh17Nd0yB9pVVEPyOewzZ5EWQ2 675g== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s28-20020a63525c000000b0051b28ed8df2si1003874pgl.571.2023.05.09.22.38.55; Tue, 09 May 2023 22:39:12 -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 S235950AbjEJFKB (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765484425780542807?= X-GMAIL-MSGID: =?utf-8?q?1765484425780542807?= 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)); }