Message ID | 20210715201618.211711-1-peterx@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=osCV=MH=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 B19E4C636C9 for <linux-mm@archiver.kernel.org>; Thu, 15 Jul 2021 20:16:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5C1E5613C4 for <linux-mm@archiver.kernel.org>; Thu, 15 Jul 2021 20:16:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C1E5613C4 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 BFECF8D0109; Thu, 15 Jul 2021 16:16:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD59F8D00EC; Thu, 15 Jul 2021 16:16:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A50D18D0109; Thu, 15 Jul 2021 16:16:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 847168D00EC for <linux-mm@kvack.org>; Thu, 15 Jul 2021 16:16:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 68D02824805A for <linux-mm@kvack.org>; Thu, 15 Jul 2021 20:16:26 +0000 (UTC) X-FDA: 78365929572.25.B276E14 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 13E3D70000A6 for <linux-mm@kvack.org>; Thu, 15 Jul 2021 20:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626380185; 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=O0raG7RoZRj4JxMJYe1AYTp8TN0hqaHK50TIovCVo8le3ch/RNaUYQCCD84xGJPMsrqHqx DbPQLR2liTtpMvirSDNvHgGX91Ju9j//cnBI5fUDPzPBlPITCKnL99+RkLeBHZ5UY2m52x 90tvU46Sq5ANg/o/LBVp9e+srPe9kQM= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-qt3onfjjONuOoSwNKyVdrQ-1; Thu, 15 Jul 2021 16:16:22 -0400 X-MC-Unique: qt3onfjjONuOoSwNKyVdrQ-1 Received: by mail-qt1-f200.google.com with SMTP id d11-20020ac851cb0000b02902536d2bea0fso4908652qtn.19 for <linux-mm@kvack.org>; Thu, 15 Jul 2021 13:16:22 -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=Hmbb70SMr0gNaL+v5U0ttigKOZU64EZ+VQ0W1NRoQzJrUkdNGrZwEENbob56UVB1zh 4Q+zMRxPLZmquOICAVJqnXWlP+I3QNPxMCFrZZsiSrDz/wjW9b3vxDp2Hb0rsPylitd7 D3kspI97lnepJX7PPPbBOie0SSzb+Zh+F3RU7nION+/Tw1PPbJgX9mXz2i9aFCf31OSp 9ieU3cHh+t9SYEmWPFRWrjBI/aBaUCuKgdUeiAQXPwmb+4aZBUzEBGJFbfHqLWk3/dVD D7tn0jqZWVDRMfbIDzy51SeGK7+8YhJTlrhim3gi1GMmpDkUqbrhk0rz1T6PyKjyAP5N Na/g== X-Gm-Message-State: AOAM530U2h+4N/rHOj1MKa+xLPyWWaJ2L8RMg9LOVUXNNXYAJ8J2d81l f2Tzon4QvGbq4OE4biEGV34GhBPuPi2X2LKK4mgqXRsixo8KrwYQXLrFoKnEKQl2RDWoBr5/ir9 lT1H5YeCp3mM= X-Received: by 2002:a05:620a:1581:: with SMTP id d1mr5621663qkk.327.1626380182029; Thu, 15 Jul 2021 13:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+STah4KcKuvlzg9i197/e/L8C5x8jj3hDXyaJxIMFWefnLu+xgSMUTIS74eTgb1IlTUGlEQ== X-Received: by 2002:a05:620a:1581:: with SMTP id d1mr5621633qkk.327.1626380181806; Thu, 15 Jul 2021 13:16:21 -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 2sm1473664qka.68.2021.07.15.13.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 13:16:21 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Axel Rasmussen <axelrasmussen@google.com>, Nadav Amit <nadav.amit@gmail.com>, Jerome Glisse <jglisse@redhat.com>, "Kirill A . Shutemov" <kirill@shutemov.name>, Jason Gunthorpe <jgg@ziepe.ca>, Alistair Popple <apopple@nvidia.com>, Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, peterx@redhat.com, Andrea Arcangeli <aarcange@redhat.com>, Matthew Wilcox <willy@infradead.org>, Mike Kravetz <mike.kravetz@oracle.com>, Tiberiu Georgescu <tiberiu.georgescu@nutanix.com>, Hugh Dickins <hughd@google.com>, Miaohe Lin <linmiaohe@huawei.com>, Mike Rapoport <rppt@linux.vnet.ibm.com> Subject: [PATCH v5 16/26] mm/hugetlb: Introduce huge pte version of uffd-wp helpers Date: Thu, 15 Jul 2021 16:16:18 -0400 Message-Id: <20210715201618.211711-1-peterx@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715201422.211004-1-peterx@redhat.com> References: <20210715201422.211004-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: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=O0raG7Ro; spf=none (imf27.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Stat-Signature: esfhxe44mnppiz8xcesj8wybxd4owrtz X-Rspamd-Queue-Id: 13E3D70000A6 X-HE-Tag: 1626380185-398237 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(+)