From patchwork Wed Aug 2 15:13:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13338335 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 986D8C04A6A for ; Wed, 2 Aug 2023 15:14:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AB76280191; Wed, 2 Aug 2023 11:14:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 65B8E280190; Wed, 2 Aug 2023 11:14:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46215280191; Wed, 2 Aug 2023 11:14:14 -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 0EAAB28018E for ; Wed, 2 Aug 2023 11:14:14 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CD9CD1C922D for ; Wed, 2 Aug 2023 15:14:13 +0000 (UTC) X-FDA: 81079510386.02.0E0A44A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 173822002E for ; Wed, 2 Aug 2023 15:14:11 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ErsQAAfP; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690989252; 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=Xj8uW5ewiXzjiHwdaA5q0RZjd8bQYNa27tcGV7uaG9M=; b=yUNxkJ9ttk2UTcdKtoYH1srvL5yI7at9Q2R9TkSi/94b0P04yLfU+uu4m0M7zA883o7lX0 +DZsioDN1MXA2ycgRcjCsqUuRqYkduSPMntD46HAYyegqyGVMB3DNqoFG3PZUL1HCa6xIC 4knbsdkqJ3x4V3AZC4G6+IeHTid7/DY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ErsQAAfP; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690989252; a=rsa-sha256; cv=none; b=oNSES/iNTcT7rCt3SV/a23ztViKcoGKpQoW25g6PNyjz60HFyLepZF1x1Q9KUdkN6RrIVN F7tD/Gos6eCEaVPzoHFhm+U0lYd+PUCiJ4d8efNCZ+fNhGF/2gAUszQjbrIN/gCUlN+tMV 34xUwA+m/Bib7Ad1jhlXLKK4RE/g9VQ= 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=Xj8uW5ewiXzjiHwdaA5q0RZjd8bQYNa27tcGV7uaG9M=; b=ErsQAAfPNLzKZrrz27+l/e+wy6 BRlxiIe+zLXT5mXV5cFWIEboUJ6BnrB5yv0oFf8XLudTqBOQ8vuMFArRVlPg6CMy6xdLTGXZj25GB cA+4YTQNdvthbIM7znqC7ZK4OipL+Bhu83okxFpzmt/IbpD4YwaVfondLpy5ACNgdaOeN+VypLvsW A8go5wSw1ynI53DpGOEi4nb4rjHEr7vedF81ySfd1CEs5A0eetrr5JeSt3h40UfQgmfHPKM4gzd3/ uDijD6XRj94ktjriYbUZ1KLUISWJZY582sTiQYZAvCJQH2ybUz/P9U2r8i0guxS4Sm49pUExzaYYs 7fapMlrQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qRDY8-00Ffio-Id; Wed, 02 Aug 2023 15:14:08 +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 , Richard Henderson , Ivan Kokshaysky , Matt Turner , linux-alpha@vger.kernel.org Subject: [PATCH v6 07/38] alpha: Implement the new page table range API Date: Wed, 2 Aug 2023 16:13:35 +0100 Message-Id: <20230802151406.3735276-8-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: 173822002E X-Rspam-User: X-Stat-Signature: 56415dh7kirpfkamt8kdwmf3ohksir61 X-Rspamd-Server: rspam01 X-HE-Tag: 1690989251-855678 X-HE-Meta: U2FsdGVkX1/IGstVEFP0QOdAd+bHpvtVU4/gOZ+VrK3aDiCerWOY2eNM++asL+PKTVHZNpPu2MOS+ZXSgnvghrESqFaxvs5i4P44DIiHWd7iiGExjEzmKvtQgHGQWPS3/zgEeXkfQBxzJ/v0uOk7YpSTTe83aJkWUE3nyNsZxmukYysqrzdJI/x/1seMh7cDZNzgFceSstSnG5Z96+8s9bo6wqo0HpFi6OE2qUkXSp4jiDe75RUD0gjKrC78uv25oEsfGrYLyMBJhLWNBQpbZk0rH9TX9ibqSB/4sVCm6t0EUTxvWb915cY2nVFOzhcSiE2mUD3IMXmNwXDvtc0xIH+Nyfln61irzfmyCQKVgPfj2UrlLOkCgMDPf8nOhelpH00ANB0Gt3yywEWMEaY20MuofcU6zzl1sPKaRhXgvXbairNwcdAWGafcXhtmibZo70tXo/X+NrRyTEkR0w4wnkbLxSZrxDjU8lrvPrmQyb8f8VTDaJf0EMrKh+E1ps4YjRadMmEK3c0MSArTvX1E8OL3+cgF4ESJU6egQ1Gjcme1FAQlsmvACyzn9byBgur14bJ11ncXLsStvpFj23EX+dxda3eP5ksEcWpxY2WU0uG44QEkGdZXE6OwSPQPFBD1CYy4GlhMPaNd/EWh1/xNl+blyjaVjUgEvRJDnutHFBjiK8GlyOYWsQb7ae2U8OH5qxAYRRPG2Q87OcCPDMCpzVuAK6UftDgQflqFRi6/QXTT602DOGDlZ+KLXpeBCxdV8UJhq0SWpWtHdko9+mr0XGUvKoZSbsym+Je+0bpWGINfqIXKWz6yx1qf3j4jc8Rn/Bo3nmmblx/4V6IZkjRO/eFZS13j5JsfPVqFY3O/hDW35O/lPYCeciOpu0VgtRyjCXD8hs9l6nlXSPABQEYgZZTMdnSZk+7SWiPffKjx6CVn9vd3aIJjJc2xSiaBRF9u45pVpN3sMz5349SvSLZ vrvpWrY6 8pW3l71AAutwC3Ase0w3ae/XRHJLPAnM7H4xGQloufgqBwXF50NNS4WOHbH8KCxMUhvv8RD0sbxDRu18zn5OU/r7XK7yW5ub6m77BsFoeOISMemnBPtnQxtJpmWCYf4F/7J3mWzl3HibwXeGMynETovL+7aKPwQ2PdMdBg44ajuXuZeuJf3AyQCixH+mdHF5uGUSIh94N8ssA40VUXDHDQfWJeujcM0YjpamupamHH7w5oAwaMrgxooF8nZnvtaE95tjG1/qEzCCRv70wdq8PuRbke3VmqHQJyxvMHXlPsgqQsNJ6ceTw/xvgwboEoNo33uos1aCe6K3VqSkGLY3PfS2nFbQxIldTjLUxj6iD48eapBD2pwtgoOQqX3by3SfQeXUY 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, update_mmu_cache_range() and flush_icache_pages(). Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport (IBM) Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org --- arch/alpha/include/asm/cacheflush.h | 10 ++++++++++ arch/alpha/include/asm/pgtable.h | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h index 9945ff483eaf..3956460e69e2 100644 --- a/arch/alpha/include/asm/cacheflush.h +++ b/arch/alpha/include/asm/cacheflush.h @@ -57,6 +57,16 @@ extern void flush_icache_user_page(struct vm_area_struct *vma, #define flush_icache_page(vma, page) \ flush_icache_user_page((vma), (page), 0, 0) +/* + * Both implementations of flush_icache_user_page flush the entire + * address space, so one call, no matter how many pages. + */ +static inline void flush_icache_pages(struct vm_area_struct *vma, + struct page *page, unsigned int nr) +{ + flush_icache_user_page(vma, page, 0, 0); +} + #include #endif /* _ALPHA_CACHEFLUSH_H */ diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h index ba43cb841d19..747b5f706c47 100644 --- a/arch/alpha/include/asm/pgtable.h +++ b/arch/alpha/include/asm/pgtable.h @@ -26,7 +26,6 @@ struct vm_area_struct; * hook is made available. */ #define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval)) -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) /* PMD_SHIFT determines the size of the area a second-level page table can map */ #define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) @@ -189,7 +188,8 @@ extern unsigned long __zero_page(void); * and a page entry and page directory to the page they refer to. */ #define page_to_pa(page) (page_to_pfn(page) << PAGE_SHIFT) -#define pte_pfn(pte) (pte_val(pte) >> 32) +#define PFN_PTE_SHIFT 32 +#define pte_pfn(pte) (pte_val(pte) >> PFN_PTE_SHIFT) #define pte_page(pte) pfn_to_page(pte_pfn(pte)) #define mk_pte(page, pgprot) \ @@ -303,6 +303,12 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, { } +static inline void update_mmu_cache_range(struct vm_fault *vmf, + struct vm_area_struct *vma, unsigned long address, + pte_t *ptep, unsigned int nr) +{ +} + /* * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that * are !pte_none() && !pte_present().