Message ID | 20210714222454.48891-1-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=SYtF=MG=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05B8EC12002 for <linux-mm@archiver.kernel.org>; Wed, 14 Jul 2021 22:25:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFC8D600D1 for <linux-mm@archiver.kernel.org>; Wed, 14 Jul 2021 22:25:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFC8D600D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C6606B00C7; Wed, 14 Jul 2021 18:25:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 076E76B00C8; Wed, 14 Jul 2021 18:25:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E32698D0003; Wed, 14 Jul 2021 18:25:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id BF0126B00C7 for <linux-mm@kvack.org>; Wed, 14 Jul 2021 18:25:01 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B1FF11CB18 for <linux-mm@kvack.org>; Wed, 14 Jul 2021 22:25:00 +0000 (UTC) X-FDA: 78362624760.28.CC98FF0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 641F7500C711 for <linux-mm@kvack.org>; Wed, 14 Jul 2021 22:25:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626301499; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SAmjiglASlkj6C13Cutnvz5k0d0w8IXdZ7Qyh6+DwYY=; b=h5kYj4PgQM4cGkmzj/kvNZhQylSoYTnUxWRCwPDutaAngKfg1/2EPlHej7ggPuNYYImY+E 0pcCsW+EoMw5TiD6fTKLeWDob8PaF8x9ZHY/TeoGIpTTIwMK3Eay7MbJRWThHXbKrpW9TK zzRwvGZzOBDR7dChNZP5aVr4Nfq8VO0= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-u8AHv9z0PQG1bAx1aq_gVQ-1; Wed, 14 Jul 2021 18:24:59 -0400 X-MC-Unique: u8AHv9z0PQG1bAx1aq_gVQ-1 Received: by mail-qk1-f198.google.com with SMTP id f203-20020a379cd40000b02903b861bec838so2312509qke.7 for <linux-mm@kvack.org>; Wed, 14 Jul 2021 15:24:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SAmjiglASlkj6C13Cutnvz5k0d0w8IXdZ7Qyh6+DwYY=; b=kV4jUX9dmtUIk2ehol6JEPBQ84jgJU+Du8lxRhf9TgwXGI7Fr0FEGhjxXdMMV2Uizc dLMWfN8h8r6DJJs7iwIhqEmWWenoDeitmNuk2LmaGLIIqsRvMUSDDdiCYS6Z56kNyAfA o9OZky0Ipds5M9cfetLxS+7IqujAwkMHiqkf5Lu+gsnW/MLSjcmGlQTdLqS0ab8shYSs Aoc2IUj8vLmtqEN2PujNZVSo4qml3zptoLFsHlrz/KmZL6BGJRXKPX149jh3oGPIxzkc GOD8V0l7rVLr0siYoFnFfveY4w+p1FCiozX/RjTbcPZdjAaCyKTb32BhXPJ9xs+E2dEq fFdw== X-Gm-Message-State: AOAM530IZCfaO895YnYCQQo8MaQcsom4munerLhj7Yq1+jIm+pqjjeDl UrRQtbBbmfiOvHmPaCQe3tFrVMQ0Rdn2gZNMLzYqBUm2PXjf73PhJu5SpqTsv1hfNoJfZcyTjdV C0ViRXXs+/wbcBgyUOvjcILiXjd7wtnfMh46X8Q6g8qIToRcK5jhiaOQUHceY X-Received: by 2002:a0c:ff01:: with SMTP id w1mr251311qvt.28.1626301498218; Wed, 14 Jul 2021 15:24:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsaEytrl+N0UaFyQiUBIwG7Khd7frW2mnu6eY1ibxH9wfPndm7ab048Rnu8cItyAyW05WjVg== X-Received: by 2002:a0c:ff01:: with SMTP id w1mr251275qvt.28.1626301497935; Wed, 14 Jul 2021 15:24:57 -0700 (PDT) Received: from localhost.localdomain (bras-base-toroon474qw-grc-65-184-144-111-238.dsl.bell.ca. [184.144.111.238]) by smtp.gmail.com with ESMTPSA id r5sm1274775qtm.75.2021.07.14.15.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 15:24:57 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton <akpm@linux-foundation.org>, Mike Kravetz <mike.kravetz@oracle.com>, Axel Rasmussen <axelrasmussen@google.com>, Miaohe Lin <linmiaohe@huawei.com>, "Kirill A . Shutemov" <kirill@shutemov.name>, Hugh Dickins <hughd@google.com>, Jason Gunthorpe <jgg@ziepe.ca>, Alistair Popple <apopple@nvidia.com>, Matthew Wilcox <willy@infradead.org>, peterx@redhat.com, Jerome Glisse <jglisse@redhat.com>, Andrea Arcangeli <aarcange@redhat.com>, Mike Rapoport <rppt@linux.vnet.ibm.com>, Nadav Amit <nadav.amit@gmail.com>, David Hildenbrand <david@redhat.com> Subject: [PATCH v4 16/26] mm/hugetlb: Introduce huge pte version of uffd-wp helpers Date: Wed, 14 Jul 2021 18:24:54 -0400 Message-Id: <20210714222454.48891-1-peterx@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714222117.47648-1-peterx@redhat.com> References: <20210714222117.47648-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="US-ASCII" Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h5kYj4Pg; spf=none (imf01.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: o89c7dqnmhkw549bu1p8akk3ofigpp6b X-Rspamd-Queue-Id: 641F7500C711 X-Rspamd-Server: rspam01 X-HE-Tag: 1626301500-148862 Content-Transfer-Encoding: quoted-printable 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 |
userfaultfd-wp: Support shmem and hugetlbfs
|
expand
|
diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h index 8e1e6244a89d..c45b9deb41ff 100644 --- a/include/asm-generic/hugetlb.h +++ b/include/asm-generic/hugetlb.h @@ -32,6 +32,21 @@ static inline pte_t huge_pte_modify(pte_t pte, pgprot_t newprot) return pte_modify(pte, newprot); } +static inline pte_t huge_pte_mkuffd_wp(pte_t pte) +{ + return pte_mkuffd_wp(pte); +} + +static inline pte_t huge_pte_clear_uffd_wp(pte_t pte) +{ + return pte_clear_uffd_wp(pte); +} + +static inline int huge_pte_uffd_wp(pte_t pte) +{ + return pte_uffd_wp(pte); +} + #ifndef __HAVE_ARCH_HUGE_PTE_CLEAR static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz)
They will be used in the follow up patches to either check/set/clear uffd-wp bit of a huge pte. So far it reuses all the small pte helpers. Archs can overwrite these versions when necessary (with __HAVE_ARCH_HUGE_PTE_UFFD_WP* macros) in the future. Signed-off-by: Peter Xu <peterx@redhat.com> --- include/asm-generic/hugetlb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)