From patchwork Wed Mar 15 05:14:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 69968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2149914wrd; Tue, 14 Mar 2023 22:35:29 -0700 (PDT) X-Google-Smtp-Source: AK7set9ZhCiKhpyhTg9NQp5ZeBFDDRMRStuG444PKPms9g1Kzuk8V9/WR/zRtvvZIrpOSynMBJDA X-Received: by 2002:a05:6a20:7f98:b0:d4:e38b:b2ab with SMTP id d24-20020a056a207f9800b000d4e38bb2abmr8746560pzj.22.1678858529587; Tue, 14 Mar 2023 22:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678858529; cv=none; d=google.com; s=arc-20160816; b=RlzmOg8yUQUM/SuMUCp+NxfqVbc1Vxypd/yEaAtAsfdkSL2Nnc9fayHduav1BfbKFm oiMKnJv9+Dm0F96yonrcj/Nh7SercY7LddjPNglLSaUkpJfE/7mBgEaz796IzOqbpzMl IRjJzfe4oHSDI7CaNUZDG5PmieLbryuHZGFqdl+IIXugJYohIfwygfaTsY/h6WZTepTI c2hvWmvqjUSeO9VbutwFIS7PpG75aBM4CAhqOjx7GBErWpZ9zvevqcgzIjEQJpNw0Vmz IsrwWXmSMrn+xmv/CqgpwHd64dMTHJSzIPq2xIGEh5hIAznVNRnDECMfiy9e9GKLnVQv 9fQQ== 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=BuY0++zuEEGNdRYvMzcc0MIGd74y5or4vnxSMjxSxAU=; b=jASboi5co2zyYC0xFKiq7/3i12WPV1IB9lSNM3pF++M/PW0QkWGkriu6wPtygdIdxH XqQCt6x0eoKHowKz3fbPDH6dWNLj/y4+OgiitJzK+6+tBRifHdVH7aglnmIwLWRDejdc u0wtFXXSiPCh0MBWLR9CfMfP7Y6TzGghEIwLn7lratkPArEOQKM51VRgmlgmsXh1m5ol L9UOZEx1QynWuHfjQiM807oFDoplEMmO6+TC7ybd1Riv4X7Lxv7TjyambSEE/NOTv96C iT3FiCKUPzvU5TFb/GmV8uoJ+pS3IAkz3PYX6ydoLyTpixm1Pw4ArJweRrXTVjzlR8bC qPDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=KO1zVLlG; 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 q205-20020a632ad6000000b00502e521cf81si4253617pgq.356.2023.03.14.22.35.15; Tue, 14 Mar 2023 22:35:29 -0700 (PDT) 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=KO1zVLlG; 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 S231343AbjCOFPq (ORCPT + 99 others); Wed, 15 Mar 2023 01:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231288AbjCOFPI (ORCPT ); Wed, 15 Mar 2023 01:15:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A98229415; Tue, 14 Mar 2023 22:14:52 -0700 (PDT) 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=BuY0++zuEEGNdRYvMzcc0MIGd74y5or4vnxSMjxSxAU=; b=KO1zVLlGb/MzuwQDc6H5JGyaiM Rcd8vcHf9egA+FO/fneFm2txL7VYi7RGvKiYak65nKIhpMQYh5LYZ23GREoZnDyWUhfJJlzR6cz5E z8KN/MPG9T2jlYkxKrF4K33ud3w2oV4+pqBCVlhSddpm1HAiF2CpmpsGIOdC/zLyrNYNIlfh0c3aZ d8oO9am1dBH9CzW4W+jf64/ZJe6NYzB9er70DxS58dqSMTGNPqh16kMVXBx4aPUrzrc9zzT2eJ3eF zPkCTWdMjtaMHnvzt85vbQXvo/OnTpecryfD+3uwDbqVIpn8hor2cZSjxd3xuyKg5td/+gj7MpPeF RY1ek+SQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pcJTO-00DYDX-87; Wed, 15 Mar 2023 05:14:50 +0000 From: "Matthew Wilcox (Oracle)" To: linux-arch@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 31/36] mm: Tidy up set_ptes definition Date: Wed, 15 Mar 2023 05:14:39 +0000 Message-Id: <20230315051444.3229621-32-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230315051444.3229621-1-willy@infradead.org> References: <20230315051444.3229621-1-willy@infradead.org> MIME-Version: 1.0 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,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760410761537824282?= X-GMAIL-MSGID: =?utf-8?q?1760410761537824282?= Now that all architectures are converted, we can remove the PFN_PTE_SHIFT ifdef and we can define set_pte_at() unconditionally. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Anshuman Khandual --- include/linux/pgtable.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index a755fe94b4b4..a54b9197f2f2 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -173,7 +173,6 @@ static inline int pmd_young(pmd_t pmd) #endif #ifndef set_ptes -#ifdef PFN_PTE_SHIFT /** * set_ptes - Map consecutive pages to a contiguous range of addresses. * @mm: Address space to map the pages into. @@ -201,13 +200,8 @@ static inline void set_ptes(struct mm_struct *mm, unsigned long addr, pte = __pte(pte_val(pte) + (1UL << PFN_PTE_SHIFT)); } } -#ifndef set_pte_at -#define set_pte_at(mm, addr, ptep, pte) set_ptes(mm, addr, ptep, pte, 1) -#endif #endif -#else #define set_pte_at(mm, addr, ptep, pte) set_ptes(mm, addr, ptep, pte, 1) -#endif #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS extern int ptep_set_access_flags(struct vm_area_struct *vma,