From patchwork Mon Jul 10 20:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13307635 Return-Path: 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 6D6CFEB64DA for ; Mon, 10 Jul 2023 20:44:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1E578E0025; Mon, 10 Jul 2023 16:44:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA86F8E001B; Mon, 10 Jul 2023 16:44:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF94C8E0025; Mon, 10 Jul 2023 16:44:09 -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 C16388E001B for ; Mon, 10 Jul 2023 16:44:09 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 969471C7F9C for ; Mon, 10 Jul 2023 20:44:09 +0000 (UTC) X-FDA: 80996879418.16.217628C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf09.hostedemail.com (Postfix) with ESMTP id D31B314000F for ; Mon, 10 Jul 2023 20:44:07 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=n3OahCLr; dmarc=none; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689021848; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sMQRt4vH1ObkP1bKXMUZ8zoM72SIlxiZjD55fkj3j0k=; b=4sOU71EPcPzp7k5/cAifpU55h6moVk+f0les5UqB5tNcDZ8S9g23QS67gYE60+8qCWKXpf gcThutLsPls7Y0ncJFD8Nh+SIA1Pox6zlDLaJYKKwM45ySpeE9uQ1eIt79HtNyyjANxwIK tvlgFWdqKCReaaO+McpuLDAbnnqgSIE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=n3OahCLr; dmarc=none; spf=none (imf09.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689021848; a=rsa-sha256; cv=none; b=CcEoPtvro2cwcgMHgfOX+6yssOvkecNhPRcVlJSLguoHqkHTc4cx3f0gvFrfz2w8+2Efch gGyP457mUPaMvqlmK//3BapfEP0CyitHrbLIwQFclEPAekb/gqqNdDHUhkB0+js62ke+2b Lg+wkYwcJCSdYkjVwcZ6i5XplEnWh68= 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=sMQRt4vH1ObkP1bKXMUZ8zoM72SIlxiZjD55fkj3j0k=; b=n3OahCLrH5ynSGq4TtitzKFZCm tCz7WUYXNr5RD1i/rXpMMwliW4bONdC7+C/iFgM/tLwwAtd+drGtecPi8nyKP+4KpGdkBguM8BzBL qm4OC/hSWVz0SYJS3P3id1s7KFaaC/BcXTAHQVR6MJP3POJnWrGtle2JD+xi7BusE+ns41ORyEKVr F1fyClyXhHiAK6uepDxgQX68J0kwUgdcAvl4PT8gRA/6kG2RUQrpaj+XO96r5BPI3XrTI9t9sTWWz Z3wad0zjHfsvX1okoo2p+8FuF/jgzM9RVpF49eI4rQ7zbzJbLiurc6Sr6UEju5X1kggGqjnRewSWo 7Hw+7bSg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qIxjU-00Euqd-Cy; Mon, 10 Jul 2023 20:43:44 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH v5 28/38] x86: Implement the new page table range API Date: Mon, 10 Jul 2023 21:43:29 +0100 Message-Id: <20230710204339.3554919-29-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230710204339.3554919-1-willy@infradead.org> References: <20230710204339.3554919-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D31B314000F X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fk5s74o59rf86cg538auy64gfkyzw6ip X-HE-Tag: 1689021847-249906 X-HE-Meta: U2FsdGVkX1+B0ROE1gBC+HkPHpJJXwFQspcwhwQI7VpguDjifQfkzkCU56YTz2alFk3vUAQM02/cM5j8GjJMeByH6DDJFhgcKUN1gUWhfQRGSIQ3P9Ry3b8fqqj59Jvz1OcwNpE0qzNpTgplHcLm2v6QJGG3eHQrc2LnEzTJ6Yl606BDYhNEWUEQrLLNJAZ5ku8KvkM035VdaMgJYfw99zAa98Wd45SazAcobLWEZgnNQyuJ8MSJAZEw68mwWWlHqXCCa2VOltwU15AErR3X/aynu7bEX8jXgTtrpQ+MGzoQ6dTGNErM7JqmHYJJxo/q2mjV7XY778UnVaLbOGHOuM0Ue898D4OPPIL/JwmWFXFn6v0ourO77oVvXs7Vek1IwG6M39lSDuRtYKqrWNom59b28S4dOU5JjK6jWBfURQGjmxyhTP8nnOrET84GYfWIY8cRT6IQa1dvfcE6KvOuKnC51M07nHvIjp7aVzhiTQocl7i5Cse+xsbLjYIC6ECj7KmHFwzwB4lRUOynnQnH0jqmbWDyQR6jb1UINepViZIMiSBBr9cmDFyzRJDt8WtYtF+43pKb4yqlihc3EDly1KaVUf+PsTRIwtIx5cgscGZ6W0KlWiY/ZeBNn5L6T844Mr1RGhyKCPgK5WaVEsXNYKPpsYWJBRBqJEMBMaII809cwubsola7Tv37I/4iualLa+2qUi+IgvYWxhBIi6msa2tLowRIl4+7enR6dn9tLntwYS9QDooGrb2vyGgQ5IpF0Nix/2vMDZ1TY3erdSkm7Vhf2Rh2sxxs7cgXaoSouXnjPdjJPvVdM14TCkUhvMD2bVJQLUiBdK10VtK+GsA65vRyFU5GK8CDICUXmclpiQbj44bfFEub6L1YiNtir+bQmYwqcTjP3WNr0WTkZ+3TaCuxQFSrmhl6zH2FdMPE3vs4Slei+JguvY2SnUfDNIjUyAUp1keDV+mpFVeKuoH RNfjf0N5 6sutZ+DkQqeJ1z6IrEf/f0YrpWkKLShewClS+zK2fb5KZy8guSOA8UgNZ3m1KvTf/nlL69I6DuyIBBjN5q0Y0qmO8a5hWsuuW/mN/xU1q5/y4XtcRBZ8p1l7Gr8UmqXhZyZE/FxV04VZgQ887mDbcMu+tMtvEpb0HdfeA+HycbZknHdmv5jctlDvNZZDKMTTZS8sZs+dqaN459H82RDtI363gKIw0GBNRbS12qfrOzLknFNTKhVYrQgfag/SrDo81ZQ/QTlWC3pWnzqlYRAqMaKS3XwzKe49NGBZQ+4YDQuLVdwR8qmX+xSp1yaAkl5P5yhM2V6xExhWza1N4AmHkrMeuqqZ1+eMqXviv 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: Add PFN_PTE_SHIFT and a noop update_mmu_cache_range(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport (IBM) Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" --- arch/x86/include/asm/pgtable.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index c6242bc58a71..9818f13bfa09 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -185,6 +185,8 @@ static inline int pte_special(pte_t pte) static inline u64 protnone_mask(u64 val); +#define PFN_PTE_SHIFT PAGE_SHIFT + static inline unsigned long pte_pfn(pte_t pte) { phys_addr_t pfn = pte_val(pte); @@ -1020,13 +1022,6 @@ static inline pud_t native_local_pudp_get_and_clear(pud_t *pudp) return res; } -static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pte) -{ - page_table_check_ptes_set(mm, addr, ptep, pte, 1); - set_pte(ptep, pte); -} - static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pmd_t pmd) { @@ -1292,6 +1287,11 @@ static inline void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { } +static inline void update_mmu_cache_range(struct vm_fault *vmf, + struct vm_area_struct *vma, unsigned long addr, + pte_t *ptep, unsigned int nr) +{ +} static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd) {