Message ID | 20230228213738.272178-26-willy@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3268221wrd; Tue, 28 Feb 2023 13:41:55 -0800 (PST) X-Google-Smtp-Source: AK7set/dtxLuJ3Lf1dPDaswK6kVcXJOQ2vRNS4WSChup99IlEVqeg0XJbXfRVgOjGMxYPgOhSN8t X-Received: by 2002:a05:6402:40e:b0:4a2:4ed3:c151 with SMTP id q14-20020a056402040e00b004a24ed3c151mr4625106edv.39.1677620515115; Tue, 28 Feb 2023 13:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677620515; cv=none; d=google.com; s=arc-20160816; b=Tq2i+2x0IN/lP7cMZSmLs/mMgYCHvbRq6rpPTLLbw3jz9kdrs7r8BkdgH2nxnyGbhB GDdk+Fc5WlmS7bFCMtO5xeL9jSFepKZHo+yic/TY1moZc/EE8N8a2Nil5NbDvv5+OwSv jYzLwhX/RSF39S/do9iCwQHV1RWZTBdK/1RAI8UMxoPkDu4+94A0KJIScPYw7hhESKe5 3PjeSWAFvCKeUaRAotT6rgchdGZdCvEZbWPfMV0975QCwiMnl3fLWnOVrbpa/3tiilZt z8BU9oXt9c6A+dIsCOUE8zUA2V6JU5ZExi1tbFLVGHrL6VXROV6zyNRZnTD+CtlJDAY9 EKDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dtiP3hUvA6nDur052lXOuZXkJQbzfHLCDQRu6Y0/CbA=; b=Pgv/OvSRmMWNIIjT23lOpx6zRTLgBCDt7CgWt0uU8mUuhUGQW12axJ3nJDwcYDV3ON RKDP2cdwsfNC6uMysOqPsw/NjHhn8RiG4odC620SpFB7PwUZlHDKw0IVPDHA2vX/kDsb z6UZpHmEBBJNQY7mldvbbT/OlEFhYiNOGCAU2RkkvoWqU3pIvv9wjBqFIHWDya/UmnCc PtlmEF9POFdbh93Bk/zUn9XZuLVSUEprmzfB1NhwJKHVNyxTZd67M+JxmqN4oPoGXJf8 HkQOdFC+i7o4QeTdL5qwbvK6A9eNfO+GjvoUCoB8Z822rvGIK1/wxQTsZefv16rP54ru wSYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="nim/Ffuw"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020aa7d347000000b004af6f3c2ea5si4503201edr.642.2023.02.28.13.41.31; Tue, 28 Feb 2023 13:41:55 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b="nim/Ffuw"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230198AbjB1Vjc (ORCPT <rfc822;aaron.seo0120@gmail.com> + 99 others); Tue, 28 Feb 2023 16:39:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbjB1ViV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Feb 2023 16:38:21 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC1A35259; Tue, 28 Feb 2023 13:37:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=dtiP3hUvA6nDur052lXOuZXkJQbzfHLCDQRu6Y0/CbA=; b=nim/FfuwphiszxzJgRhRboHqcH vQzqCBkhh0tvLmMfPiIWWtFpSXipbb1iphhpFKTWFPAu/hVwVZoPc6ZHlCj2/jQKdF91GmZJ9na7T coRSAXj3oPuim8mixy7pm83Peo0keEkBTn2/bmTHwumG4lAQepukA68VsAXvrA39a+I9BJTE7Hs+Z 2u1V+pOEg9omjGjJIo7CRah2Vmhk48cMhBKDhpBAzTccVvBia7mHwuEn9QwqlNekN5TbgYvLfWOcz 1PHel/gzKJuYCRqdbehQTZEfjReDu/fMv2F9CyrAVcSivKYRhU/co/gP5obxRB7MApo8aNtsWl1xA sOVMrNJA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX7fK-0018qG-5T; Tue, 28 Feb 2023 21:37:42 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: linux-mm@kvack.org, linux-arch@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>, linux-kernel@vger.kernel.org, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, linux-um@lists.infradead.org Subject: [PATCH v3 25/34] um: Implement the new page table range API Date: Tue, 28 Feb 2023 21:37:28 +0000 Message-Id: <20230228213738.272178-26-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230228213738.272178-1-willy@infradead.org> References: <20230228213738.272178-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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?1759112609142483602?= X-GMAIL-MSGID: =?utf-8?q?1759112609142483602?= |
Series |
New page table range API
|
|
Commit Message
Matthew Wilcox
Feb. 28, 2023, 9:37 p.m. UTC
Add set_ptes() and update_mmu_cache_range().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-um@lists.infradead.org
---
arch/um/include/asm/pgtable.h | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h index a70d1618eb35..ca78c90ae74f 100644 --- a/arch/um/include/asm/pgtable.h +++ b/arch/um/include/asm/pgtable.h @@ -242,12 +242,20 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval) if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); } -static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *pteptr, pte_t pteval) +static inline void set_ptes(struct mm_struct *mm, unsigned long addr, + pte_t *ptep, pte_t pte, unsigned int nr) { - set_pte(pteptr, pteval); + for (;;) { + set_pte(ptep, pte); + if (--nr == 0) + break; + ptep++; + pte_val(pte) += PAGE_SIZE; + } } +#define set_pte_at(mm, addr, ptep, pte) set_ptes(mm, addr, ptep, pte, 1) + #define __HAVE_ARCH_PTE_SAME static inline int pte_same(pte_t pte_a, pte_t pte_b) { @@ -290,6 +298,7 @@ struct mm_struct; extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr); #define update_mmu_cache(vma,address,ptep) do {} while (0) +#define update_mmu_cache_range(vma, address, ptep, nr) do {} while (0) /* * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that