Message ID | 497d7777-736e-85f2-c37-aa6bcf155e4@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D585C7EE29 for <linux-mm@archiver.kernel.org>; Thu, 8 Jun 2023 19:36:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EE228E0002; Thu, 8 Jun 2023 15:36:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0778D8E0001; Thu, 8 Jun 2023 15:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E33798E0002; Thu, 8 Jun 2023 15:36:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D1B998E0001 for <linux-mm@kvack.org>; Thu, 8 Jun 2023 15:36:33 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9B77BC0492 for <linux-mm@kvack.org>; Thu, 8 Jun 2023 19:36:33 +0000 (UTC) X-FDA: 80880587466.26.381CB64 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by imf21.hostedemail.com (Postfix) with ESMTP id A01F31C000F for <linux-mm@kvack.org>; Thu, 8 Jun 2023 19:36:31 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=7iZl7qFo; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of hughd@google.com designates 209.85.128.172 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686252991; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UmemeLuI+WpEQXgz9TQT0mwehV8FTU9BDTa5EhoH+Rw=; b=WCIPs6gvaZAEyYrc6z6IxqbNbjAlzAj2o71lMRh2oBayiVVUMAVMlyrKDo1PHYV7JUyCjh 7KzLBKNlYHqPUhWPFrZLDfsvrE1iCU7lBQuuXgCovsmnaINDD2hhmqRZqiFSXlAwvbEQ82 2kaSmD3Bpo6XEgP+s++FTYkbpZ/YZlo= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=7iZl7qFo; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of hughd@google.com designates 209.85.128.172 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686252991; a=rsa-sha256; cv=none; b=M4dT/fwTOA7E7r0R7JLhbYwFnVzX1gQq3MV4Qv3iXGBw1NJAzir0VkAWm51/Jhy+gwb9wk lbP/vR6F1Q02Z4D2jwLw94AXUt0eW3nFcYSHpm9CTSkhBMZl5YH7bx1GrxkOcRlT0fDyn3 TsKPcrteyJvlO9tX8AqPpbZtuTilWUk= Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-569fc874498so9483357b3.1 for <linux-mm@kvack.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=RLYWJFHcUhQEC0dEY1MfMnx8qIdOBbmaHfEl058+XexPQUa2fNjwcMvS6lVQKN2uCv l5baJpK3Xk+L1iCl518mXlp7wjwmPBlbP43vPfBIwzG4M6dSqdBQVgeXgP7WsKtpazfc k6i2emI8rpX4gmiojn7BR80zBs3nfANa3cwQ6f8Nnqsa8EyLoPMJEhhkqJGzODKZYK4p VyH4aplmuVCeGWq6CBSvbhr1qTE/TrUXuqdlXPTYdqajRM6ntpV6Plco+m4lbMGqxCr+ KaaHsnDebZ6wtuOCAZIqigTa1kCJ8A7xSMgWJscgJlcpFY6kY7sihBwrbR/SB2CYdABc 0xuA== X-Gm-Message-State: AC+VfDxBxQLxH2NPAwDDypLNud3YUvxgZXi+0qsmcGdM4nt+q8yle0zK o9fnoy6D0ol3hB/V2WqgUbqz8w== X-Google-Smtp-Source: ACHHUZ5QdxKuy9jo3MUvUBLJWa7hkCRN4WqLqFRikF/N35P5/sjJc9i1Jxr6DqBjKGQqjHCt1+UtTA== 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-Rspamd-Queue-Id: A01F31C000F X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: ji3q3urre34fsfhsctzuiq7fy8d5kpto X-HE-Tag: 1686252991-371228 X-HE-Meta: U2FsdGVkX1/q50oqrhLuL3ZRZeTgK7Fm6ce3rGWWlxyF4DYyj3IgckaE2KD+/wFz39Cbj1KAA0cFH5Z6fnOL4KkwFP7PuQYQb3F+m3fD5y2QU6pPRtqsKHbaMw9qUwkMLzPpAQXEF83CqozkuW1nb/jAvrKWqlNOmxl0IX6J40u5usIo4+7aWVHOe/TXmjJFU4+PacQW7c7S8k7NT7WK3y6KLWQ5V4VMqeXcwY6wKWDGBbGsRa8n/DFONi41YazcDEMzCiLMExALH1BMTzuiNf3UvzbdQwNmypYadXhejj0pr3BWfUbp4OE5jTytpkbWKavyNPH7I9tlGuo72Xch9XiEI1wKJ72n6l8crIwC2S4VtbSOKqhtfikMyKaIKvPaQXVwvhcOZjV5Cx7WPbUTDMtCCuuRVDW63cnkccwcPSMGcpEn5nG1ACg/c3o27vdcjPGa3OVjvLRAUSeu34Teu3sbPGqDfcPQ1UPuERmfdftuVUI8ZOw2az8ME80kXeP0JIh9wNWTPXCP+rWitFdkffsEptqAYfKDnleet42MB+ociR0DM/7wfnYMe5LCLwCCP/G+aFlmIPWsaS39Xn0joiEfKnYW4+fSj9xFyTN4BgXBTe02AFWd8l0tStxpnq9X72BmceOYVk/fKGxcbbvMED6nZo/5cRLm8nDgiHn4ceLlksmryChHCEc0iLK9L5jN2J1PzgEbW/n1bFm33EsmJQ4ms7hee/brkgYD+dPYyE9Yt4z6VTWcYmGbaSF91sdE94FXRx+Kf8SNxD8tjvsicrWUXvc7429w13RczyCYMuinaNDfUJI/xojoA4z6uxUYMSnQK3wcst0fBKfrY2IS7OLtIKb4GtLzw66VBC7vM5MpjnSov1MfnVxVcUpJziaFdwsmxc2qml1GUgVvpztUAGVclYjGltvJ1C7c0ETgCkCahXXhR3nCpLW3uZu5AgAkUwPMVJy/BXER0yFHvWf NBGvGsVw XYYUrQb9kj8ZlmFJLkf5npHt+jOdAGOZFqGkzbQJz1dJtsR4J0pTCPUTi0mN4OGfjGlxHrCOvhr66JEKwdePsXL30qmRalLXsfTBM32ecknW55FHs20vC/9ZL9sZx1mwEK1CSL7aObTNbi5qOkRArYpBROjWCblH1Rl47Jir/lg5aoI3v3rGxv1LrFY5Y+B2r3SCwDxxc+GH+ov+Fat/BnzSFnlnU2sn/nMfCpKXIGC8kojfNGYtEAfh1yoSYBdT2lTev+UTU5fyizYvAjzkfVTgsanm+bMgE8igErp7iIWhVQV8PLOFYBHivjO2M0kG8AC7NmKYM3s5CV6QvZkJpdYyFjBjyFHJAYUpWCOSpF2drHK9dhBNHkLtTJJyztbw68EkzR2jOEOOtKOCgauBMiCACorrrjZpN/zAmK4Ev+RauEOcWAcE/kDSqpH9YPA5sUQ9tZQEcj3MyhJo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
arch: allow pte_offset_map[_lock]() to fail
|
expand
|
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)); }
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(-)