Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1174255rwd; Thu, 8 Jun 2023 13:26:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uNytruFf7d/zRWkNfRrtm/P1+QRq0e1AATlw4WzwEWFpAySBHqRi5t8VPUdFO4qQPdiSF X-Received: by 2002:a05:6358:be99:b0:129:cade:3cfd with SMTP id di25-20020a056358be9900b00129cade3cfdmr7337565rwb.8.1686256015637; Thu, 08 Jun 2023 13:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686256015; cv=none; d=google.com; s=arc-20160816; b=EiuB+UhknnobO46J2a/OuNpT3qVklsnf+Wbow4HRfygRTehIM/PS0LtdZ0NCNCG9Ki qYx/Aj9NkjSz09qgl1O++wjIh77WjzuQg+gr/+LgYyC2wsFKkd0ch5buxliOm6rItwty WIePuc7SRjs+6eYXmLEU80IBNLH2ifg38ryyZSiwiPGiJ5fb3oe2cS22lFWRoN8WtZC0 9b1rixWkO9V/CE3pu4wgsSXU8TXwIvzYjFF5AIsxTlpoHgAaOVJyCm7RVMCy4xqtJedC Dl3lxa5mEV5P0aZjuf0j7jECw8Ni1jbY4rGBuFl7muTPKzrGMzEM5eJ7FgcKp783TV5s Q4qg== 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=TudUMTtuz7TwoHhWN8DKhOATNk5Lt4LoeR3j0kwo+PIbHL8Zzy15WULzXkcjNQLT+C jTxysK1M+7RL5TGCgiri583ACWVeabWE0DSrjJ5lYskrl6OItoIDv6PBXZLWu6/1sU4c Eywd1nxAWOJMuAKKkowIq73GdhDzRrfuawqhvJ9ddeJ/A801Zt3UCSwApHvCmeMbrklv f5gFJQOBq+pvwIjM4KfLQg6lcs1Vw1m8pqG4LfY4RyG6f5HKXYPO/uKOLMstI8toHGeS kLyo8fuWgmUW2AbprkepRFpgs8jzujtrd45cqtjnGtHOuaTacH9O91q4YHT3XlcV2xUH 7gnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=7iZl7qFo; 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 b17-20020a637151000000b005440dcf6d1asi1479742pgn.175.2023.06.08.13.26.41; Thu, 08 Jun 2023 13:26:55 -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=7iZl7qFo; 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 S236702AbjFHTgf (ORCPT + 99 others); Thu, 8 Jun 2023 15:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235282AbjFHTgd (ORCPT ); Thu, 8 Jun 2023 15:36:33 -0400 Received: from mail-yw1-x112b.google.com (mail-yw1-x112b.google.com [IPv6:2607:f8b0:4864:20::112b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 905C82733 for ; Thu, 8 Jun 2023 12:36:31 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-565c3aa9e82so9448347b3.2 for ; Thu, 08 Jun 2023 12:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686252991; x=1688844991; 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=7iZl7qFoE643/vqqfaylOOM4UugSzxQOXfGxIkvhFgrLBJMpREbmLbhzK1Dfpeq7sW vLxMNbMxtYruESXi/vLA/FRPFy86oy/Rlv/K+QRhWyPjxrgHE6clF71I8HICL+Wbu4D8 52TIPF5OsTmaSTlVcpOmlJ2hXgN4iVitvobit3uBB1+XryThJwAiK1B3ovBLWTXnWBEi ML7bTpBpfErXrO5jZn41yk5x35HzdiBPWQx9RrfkGfIWSKYY13HndzOzcbi8dz53N7Pe Ykc3xEYKN/aDtb36dEI3aYN9owd5brP5GXTjP0NKjFTbVVbOSNnZMLMGudJLdaSlcXEi 8u1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686252991; x=1688844991; 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=GR8NkwAIfwDGJb8ViRrsuw++iOjUgvtoV5uXzaHoxfnL81r1ezvIyxcvWuFapKB2om 0wyKnzzgPyH34Leu1FkdyvfO3oAGeHruoVnTlZQkx46Y/Zpopapdnzb2VuJ4Rz0nygAo cCNsYsEgMsW+OyJK/o1eQdCUo+kd6/NpJwnjNRgJIyzEhFdIXA/dZJuNipkvxAQ4VfKL 3dOAwlaRI2MSqGGEeFfsQACFoA7p3MC0DlOqkY2257g/7K6hmcQ8s1U7a7lbc7A38YRn IY7QZ1356x+6HRLXEz4ECpL5lHLGq2Dlu1aEv5eoYu78woB+VGAeFBCn/I58qv3rGESi 2+ig== X-Gm-Message-State: AC+VfDy9AckfDHckSaszms+W29F7JoZzaLD1ajNAoPSd7Ae2MXEN86Jt qtoFSpvkyktpNYUwqmG3o/0dHg== X-Received: by 2002:a0d:ef01:0:b0:568:d586:77bb with SMTP id y1-20020a0def01000000b00568d58677bbmr743298ywe.14.1686252990588; Thu, 08 Jun 2023 12:36:30 -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 a11-20020a81bb4b000000b00545dc7c4a9esm108298ywl.111.2023.06.08.12.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 12:36:30 -0700 (PDT) Date: Thu, 8 Jun 2023 12:36:26 -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 , Peter Zijlstra , 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 , Alexander Gordeev , 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 v2 22/23] x86: sme_populate_pgd() use pte_offset_kernel() In-Reply-To: Message-ID: <497d7777-736e-85f2-c37-aa6bcf155e4@google.com> References: 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