From patchwork Wed Aug 2 15:13:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13338351 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 A7EFAC0729B for ; Wed, 2 Aug 2023 15:14:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 218FE280197; Wed, 2 Aug 2023 11:14:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E6F828019F; Wed, 2 Aug 2023 11:14:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2287280197; Wed, 2 Aug 2023 11:14:17 -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 8DB28280197 for ; Wed, 2 Aug 2023 11:14:17 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2C938140EE1 for ; Wed, 2 Aug 2023 15:14:17 +0000 (UTC) X-FDA: 81079510554.21.6E3F664 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id 1381D40007 for ; Wed, 2 Aug 2023 15:14:13 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tZtdOJth; dmarc=none; spf=none (imf07.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=1690989254; 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=65FxR5dx/xsh1AVUxUI8FQp36yuMGxHGkyHQLalbY28=; b=q25QdEV7pD9Z4aO5jPSkJL4jOFA5/YseYCzaOGckd73Jq8+s/aiVTgUBDsHj7EMulNu/tr Zy0Zu2Sia5qInKB3Uo2rrbL+r8xVCO77ud6ezama6GYSvaa7tYB5LAuGh7Uu+gR1PFpQ7+ QYCWAr0Yx/Jgfg4HRt5Y+l5+bKgilWo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=tZtdOJth; dmarc=none; spf=none (imf07.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=1690989254; a=rsa-sha256; cv=none; b=i7yHzvxC5iChj+28lhfSdTtetT9ydgOXU8lWuN5xzd2lWEoa+BNe86iv/cogMFsA3q2G76 +FUZaBwq8+KALOcP3G9TGIUjV1uie4Rr5lk8lAkTl7E4QMSxSc60W73r9TveMkWpLH1wFL kBMM2crVipJiX1a05lHj58C/lKmq1/g= 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=65FxR5dx/xsh1AVUxUI8FQp36yuMGxHGkyHQLalbY28=; b=tZtdOJthWmLoEATzjw35d9/P1c BBAS+XgTGJndzoeG5ay3Zd09iCt2Ja+Bm71bnu0Vn0PxBY4VMOca0xZB5pVjFtbFMTg0/QukYhXwN RSp6pEtsSGQQ0iRUZF7V0XBf7RIYZsjqph3R1p0Yv5tSIcYM5MUTKtcD2jyMY+h2iXnOL4StTKTIi qLfdfcLbhvu5EM/8gm/vMliZvINnzizo17mZFeNEIaavns6hBklrHpvksa34eDGLwqOLB6KDwYuK8 6YCUu3SqftxvMma7n297vFwCX8aU5zKMfaY39W3Eu2JFKI7T3DsOcW+M3v7kNn8AjvuQtMqtGmlyc 6A2Q4yNA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qRDYB-00Ffl1-4u; Wed, 02 Aug 2023 15:14:11 +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 v6 28/38] x86: Implement the new page table range API Date: Wed, 2 Aug 2023 16:13:56 +0100 Message-Id: <20230802151406.3735276-29-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230802151406.3735276-1-willy@infradead.org> References: <20230802151406.3735276-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 1381D40007 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: bgmbwa8c3dnwsrbqz1bfhu64j45ce8jh X-HE-Tag: 1690989253-19441 X-HE-Meta: U2FsdGVkX19RQBy9zsAsMHqHqU4RPn4C2VkjAKynJVZGOTBCYKCqrMN/kd2RfHgvcAdSo45y/yfC+ETITOQvMga0HVFrOJa+QJGGJCfKdlj4vaNhslpYY8aaFOKDyUFclpAhjizbN6+x933qmCYvLSmGfR1RbNUhPT11wy2N6H2aPsqLJwfFiMOmK2QZjV2RUsulbZTCzO8YMfdxwm4BFco9YBgRvRJnByl2TNTm2b9e87w4hvIk7ERN6NiQwEIqEecq7+ycphqYVz+iOrO30pHkQZBxzKjAThKujdfAXGgCoU3SoHqre0ekBZkGfgsStXB3ennUNpyvmRZtWBH164iogqCStObv8Ns1abg07dSTx7p9qqU/TNpbyw4oK8OiqqIiD1b0gVdF4xODZImVkj+YNoiQ6JomxjcdTeTY+Uk6DCCH7zRirYJ2J9yU5Oatdl5IvoIMW6WJ6l2Dzq3i+8GBl2hOPSaG3zRWn7Ha1h2bjlfoMBr39fpkKHnJMzBz+RnYVaChoEKXFJQj9ugRCBy8F4PQzWxFUOgKKscpKKuZYgwICWGrt/CCd0xlzi/aykMHK5aDW6ymZ/hzA1t/vLVgg0Ds+cUGe4FJSHSpDX+4k3o3PxVYqcgwbRDc5c+RDDzN1o3BRjIGIZcLUnN7qICwcqhCsmwVEPO9jaXkeAJIkodAD5uY8KruguaAXUot2ZYh2MedhmvVp7Jxw1tpY1LybR6J4FK39taAFDAZuUdgqiROWblXp+MhY8YQxlzXGTrTmZ9wgbmd6sqS625PTwfbou2LN0BBWYZGC9ALY641Ip0gFntBU08LtERvyI4z+dcsRPG/QLN1lRZ/QiVA5b+gLK2cMUEuLxKQ8lTScDITPckXya2V4otKjiRwnkAaCuUWTa0QXDe2HP48RJ4l1sjIbWL9N8gU1grS0TE+t5vLLRpcaxED3fjtJXS5z4osSvc3VnRiyK21Q4deDwa XEsYlnnx /k+iNdrre/KOmTkDNR52Ij80Oslh8/qk4+JHUh3PCT+soTk70bhbJ0rfXjKP9iMBR6c8UEgEEQmeDKnqXMKBY1cDO+YDkSXxpB1uF9mDd44+n5CtwrCpHMMvO/0MVmdskbmcjv1tg1rRmR6ymbiEaeSjIqLmjHwBdH3PxntKYN6OhiNJrVeEkldX5nMLUIvlDGl6fuEkgtAFT5wcC0hLDVs3VVTXVotBhm0yFMzf6ui/rQhKJZqwvxRujFzjXmsqozrXnyJbjfGsNxuCikeYi/Wnoq3rzITSF3e3w+4dqds/8USIQTuNJbvXnf/7lsRRTAX7yjLvBtkS9jphj6J/gzxcf8JQk2fgz0Unc 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 cd0b6337d03c..dbf8af70b7c2 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, 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) {