Message ID | 497d7777-736e-85f2-c37-aa6bcf155e4@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp521952vqr; Thu, 8 Jun 2023 13:24:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WVPb4NWwiPQ7p5u1qP0mysb1ZFOdh0Wlxx+kw0h3kqz3EuO2zmNWBPgN9Z9G9MbdNGkVN X-Received: by 2002:a05:6a20:e48f:b0:112:bdd3:9b81 with SMTP id ni15-20020a056a20e48f00b00112bdd39b81mr3874636pzb.15.1686255840377; Thu, 08 Jun 2023 13:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686255840; cv=none; d=google.com; s=arc-20160816; b=CM9jSn7F2afEZRI+HoG+zkmOgfuqBqF/NCMLM8w9t1IqGVOyvzZdTI/BY0iGh8OQox esXFSGkXjhDZUQb7eosEyl6oaDa8LgzV6OJqtFziLVzi4MUAyvEiuR21FwJIcRzOKbDV kYc2xF8dkT5pT8CT6xl+JcyuT9byKXpNpxuFBwbt6JUaUmc46nhfbp4hB8ANBoFDnCuT LfOvyCWlY+kV5pEx2j+kCq76OT0Xr2MHIZ4BiIZSajJ/z+C/TXjL3UcTKJ7lpLfnfnch LnIZxGMJdRVcUQTeUiM9PQ4q/j9lGrlQKz17w20RY5tZohyxHoYiAUQVX8gVIOstaKK+ 5goQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i14-20020a633c4e000000b0053ef158b0c3si1459135pgn.25.2023.06.08.13.23.44; Thu, 08 Jun 2023 13:24:00 -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 S234262AbjFHTgg (ORCPT <rfc822;literming00@gmail.com> + 99 others); Thu, 8 Jun 2023 15:36:36 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Thu, 8 Jun 2023 12:36:31 -0700 (PDT) Received: by mail-yw1-x112b.google.com with SMTP id 00721157ae682-565c3aa9e82so9448347b3.2 for <linux-kernel@vger.kernel.org>; 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 <hughd@google.com> X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton <akpm@linux-foundation.org> cc: Mike Kravetz <mike.kravetz@oracle.com>, Mike Rapoport <rppt@kernel.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Suren Baghdasaryan <surenb@google.com>, Qi Zheng <zhengqi.arch@bytedance.com>, Peter Zijlstra <peterz@infradead.org>, Russell King <linux@armlinux.org.uk>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Greg Ungerer <gerg@linux-m68k.org>, Michal Simek <monstr@monstr.eu>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Helge Deller <deller@gmx.de>, John David Anglin <dave.anglin@bell.net>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, Michael Ellerman <mpe@ellerman.id.au>, Alexandre Ghiti <alexghiti@rivosinc.com>, Palmer Dabbelt <palmer@dabbelt.com>, Heiko Carstens <hca@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "David S. Miller" <davem@davemloft.net>, Chris Zankel <chris@zankel.net>, Max Filippov <jcmvbkbc@gmail.com>, 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: <a4963be9-7aa6-350-66d0-2ba843e1af44@google.com> Message-ID: <497d7777-736e-85f2-c37-aa6bcf155e4@google.com> References: <a4963be9-7aa6-350-66d0-2ba843e1af44@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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768167404171252794?= X-GMAIL-MSGID: =?utf-8?q?1768167404171252794?= |
Series |
arch: allow pte_offset_map[_lock]() to fail
|
|
Commit Message
Hugh Dickins
June 8, 2023, 7:36 p.m. UTC
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 <hughd@google.com>
---
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)); }