From patchwork Tue Dec 17 05:13:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13911020 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F368918A6DB; Tue, 17 Dec 2024 05:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734412552; cv=fail; b=fqT2ZfoHisUCNJl9xFjGPhq+o4K9r+nFYX4RhIf8+0DX8xOLBh5a/hFEWlIReq2ECxVQSylOs7/BtXpNY+TyILikV63jlivUNyQOWZy8/enQQyE9oo8MD0c4w0Pgpi5pJRI+KcNUmGlYr7ZBox1oOwYwqtyuvQToxhQmZl9T2rc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734412552; c=relaxed/simple; bh=/Csrylkm2NidU986QPWqaDZpz+jU+FcWBDetRvEORiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=WRgRi6RNG/6rBxucwACEgfbbm9Lc4K2tv5jjVBUILX9rj3BZBzNj64FXjVGja6LJFpd34G76snhA9lEAulrGTQFIKnaTgVACKGXbLSKcVQjoi1Y/p1NCesKyRqq/3lgXII1shJdrL26iL5Bv/sQ/dLnZYoBrGrVB+28n4hsej/g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=f/x2m0i2; arc=fail smtp.client-ip=40.107.94.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="f/x2m0i2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rvBUTQWwTKir3Mmhh2kRCoUdrEAwlY4T3vWCkbMYvfX94iMwNS+GWSuhewrYepNCTrHzXge9KX8ppPIPqR1WPr8H5fdsMcuFm+PT38hMTeBYUB5V5grmngKwunEU0UXOM4ku3n7pEmN+T1sHTUzzjLvJ1J0oQJ1Gs4TWdyan5GclJGpRtPSdIWGBKdEYQI+PakjZB01zgtXyZPcY57Br6oKWzEwuMc5ssVM3Bud3YO7LWpSikeo/aB1gcEl1kYCfOrXJAyqJshRyaODGfHirhgZNBMEvvRR7VdfB8wC/aGDxSlL/gVhMaXlyUp9phgAQt27sDxijSgBgZTEQ+fFubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ANnS9ugPhWXEhOP/c+FzNHxXqu35Gn0O+fqlriZg1uw=; b=tHsHJF4D8w73O3tOFYzxBhTdIQuPYr9FmElXFnJR3gfUvw0TAwCdLXWdZasjK+0NkaQ2Z7pZXW/3I3+C3ENs7ooh1zqWWy8fK09yOsp9vYsR0KH92Elgjst2YP07vOSpmzF/rfQCzusa0BKeGawY0w6XGXZDm8meDYmQoqdMvD4pQ5dznfVQGJJmo5PQm/wcrT3VaPj5vf4yUDdQENL/qphtUi8OMOFL5qQYl6wsB94XGAh3mxnK04ICI99jh0cesQYQzkJeY5IF3MtCTrRYXUIcEEPyMAhNnH4Qq68KwPJ2Gsohg7T7IDcZPmkR6MnaLcwwtdEW97vGWgkIaAZFrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ANnS9ugPhWXEhOP/c+FzNHxXqu35Gn0O+fqlriZg1uw=; b=f/x2m0i20+SIkEJeGdmYa7Czv9/lOVCWPcqimzb/pQI1cT7nUQMHUF/3XgDmQcbIZ6eacCuBYPSswSXZ/qR3XCCMe3+duqI9HboHKU4NerGCTzhJGNkfhushCumt9cZecLr9wzz5RWC+kdGnKrcfOgwNZGkZlJbkJ/R9ZBtxXSwa8CGzfWvKXIGT57WuvVsfOWbS+esD1sL7Av9QmHL5kqCCAme3zz/qArFky4ggr4lleRpNnFCbmwlMZEpp/QPEfBVUE5nQX+yt5M9mRWC41zkft7ge23lnmA0a5k6B6yYXfDkguNmkHK5ab0R5DU/a5hj4chYqIM6XJZkhTpwyYQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by DM6PR12MB4388.namprd12.prod.outlook.com (2603:10b6:5:2a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Tue, 17 Dec 2024 05:15:48 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%4]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 05:15:48 +0000 From: Alistair Popple To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: Alistair Popple , lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com, =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= Subject: [PATCH v4 25/25] Revert "riscv: mm: Add support for ZONE_DEVICE" Date: Tue, 17 Dec 2024 16:13:08 +1100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: X-ClientProxiedBy: SYBPR01CA0070.ausprd01.prod.outlook.com (2603:10c6:10:2::34) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|DM6PR12MB4388:EE_ X-MS-Office365-Filtering-Correlation-Id: 69f1d358-a91c-40a8-27f5-08dd1e59de38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?t6EceDQzKaeAdKy+DORUh49eA0EwobT?= =?utf-8?q?7MXbTLrwRxHKTWqsOoBc10LsjIv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ii8dGXIvKtp4nlSRt22Syvaagv?= =?utf-8?q?Ao8MwGJiUFHiJR9N1ugvAh1tAtGtoX+1ifHag2q/7bHUZkgj3+sZCBpyXFCZiFH+t?= =?utf-8?q?g6Q6L76SRXnvmZTFO6awf+LhaS/obekje8Ws7EMbrtflJFCHKMCBXMD75mSIxYyQm?= =?utf-8?q?VfkwN+gF7gmCZwCaU6iO33os0YOQOagYmGKoIaIpUr8u4RFe8wItfduFPxB7B3J5n?= =?utf-8?q?uUaHOzCEZQ9KQkrDZ1NTzDJymsYOXdBuzb+RPxASwGfxQ6tzOlgNIWgn3+X1NYBpA?= =?utf-8?q?pHUhOXUv+ipy6wNksulKWZrqoEw3aUE3FEwgdgsrnrOKgh4WxyzzHZgzTWUYsu0h3?= =?utf-8?q?k8MB/aBhIAGhpUk6cEkrKjlox72ZMBprlE37KeV8Zqf3PFYILQGfZxWg1qbTGrdsK?= =?utf-8?q?fpUJPTsBPLxM?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HoWwSSHUsVxrpXiEyjH8tCRq3PSe?= =?utf-8?q?W5MPIOKHIxVSOUO1cYYdgu30nyDFdWeU3MXaWC+TrbX+hAu0bytQ2k8UAeRmw/cCA?= =?utf-8?q?1Cg/WzZ3+fsA0EHej1RlnMinOzcYDx1tk23kdWHwl+3wiF6Y9DGkVUKj/dpmatVKG?= =?utf-8?q?PiORu+eZy1cR2+D6IBlsSCTEFhN12wfJNXFgWkYLbUkB/4a1BBxgacEYzVNrbdwIi?= =?utf-8?q?xSEhG1bZ0MnxlhCGl1FK9v0guobscqX9PRs+FpcVeftdkyaxJWcY7FusAnvD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Cn91?= =?utf-8?q?gn5wCs0Dc8s/Cws0gG1FQaksNeJUU8Qr+TazE6AN0/J9t9unPihSKUmbBInUsV/SA?= =?utf-8?q?cmCTJElwUF2q1gmBsSMfChgGjGTy1gG87CRbFRGX4+VOfl7Rp/KAd24C+Q1v9hlAi?= =?utf-8?q?1G3NHEAZCGFRYY7LndhqtcO13yWQNzIQapBdMIh0somCyJXBrtrdvxD2LrKQdTawh?= =?utf-8?q?Rim5wnu538x5KvwVEZbVkM7ZiLpLnZkhWrGK6D1ZU6eINtH7585vdtCMqXJvXRI0s?= =?utf-8?q?xmj1213NRJB/0JPhJHigeBAZb3DpJgHJKGDMOZBr0PjeXEsYlLhOM+SRShI6dvKcx?= =?utf-8?q?tGO10KOQYbBmNxQf41koKy0acLt0DKk8FfM8OoDX8xzB+Xyj7iq4o70eIojJdGc8L?= =?utf-8?q?qUapNoIbK6yj?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69f1d358-a91c-40a8-27f5-08dd1e59de38 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 05:15:48.8439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7bmnmlltikPBk+zZkAjZXgIdfqrni/a275gORI57E5PuOhe9lQuodMq0DUHl6G4v1hQGBaQrsGgn4m9WZ29YeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4388 DEVMAP PTEs are no longer required to support ZONE_DEVICE so remove them. Signed-off-by: Alistair Popple Suggested-by: Chunyan Zhang Reviewed-by: Björn Töpel --- arch/riscv/Kconfig | 1 - arch/riscv/include/asm/pgtable-64.h | 20 -------------------- arch/riscv/include/asm/pgtable-bits.h | 1 - arch/riscv/include/asm/pgtable.h | 17 ----------------- 4 files changed, 39 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 7d57186..c285250 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -43,7 +43,6 @@ config RISCV select ARCH_HAS_PMEM_API select ARCH_HAS_PREEMPT_LAZY select ARCH_HAS_PREPARE_SYNC_CORE_CMD - select ARCH_HAS_PTE_DEVMAP if 64BIT && MMU select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SET_DIRECT_MAP if MMU select ARCH_HAS_SET_MEMORY if MMU diff --git a/arch/riscv/include/asm/pgtable-64.h b/arch/riscv/include/asm/pgtable-64.h index 0897dd9..8c36a88 100644 --- a/arch/riscv/include/asm/pgtable-64.h +++ b/arch/riscv/include/asm/pgtable-64.h @@ -398,24 +398,4 @@ static inline struct page *pgd_page(pgd_t pgd) #define p4d_offset p4d_offset p4d_t *p4d_offset(pgd_t *pgd, unsigned long address); -#ifdef CONFIG_TRANSPARENT_HUGEPAGE -static inline int pte_devmap(pte_t pte); -static inline pte_t pmd_pte(pmd_t pmd); - -static inline int pmd_devmap(pmd_t pmd) -{ - return pte_devmap(pmd_pte(pmd)); -} - -static inline int pud_devmap(pud_t pud) -{ - return 0; -} - -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} -#endif - #endif /* _ASM_RISCV_PGTABLE_64_H */ diff --git a/arch/riscv/include/asm/pgtable-bits.h b/arch/riscv/include/asm/pgtable-bits.h index a8f5205..179bd4a 100644 --- a/arch/riscv/include/asm/pgtable-bits.h +++ b/arch/riscv/include/asm/pgtable-bits.h @@ -19,7 +19,6 @@ #define _PAGE_SOFT (3 << 8) /* Reserved for software */ #define _PAGE_SPECIAL (1 << 8) /* RSW: 0x1 */ -#define _PAGE_DEVMAP (1 << 9) /* RSW, devmap */ #define _PAGE_TABLE _PAGE_PRESENT /* diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index d4e99ee..9fa9d13 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -399,13 +399,6 @@ static inline int pte_special(pte_t pte) return pte_val(pte) & _PAGE_SPECIAL; } -#ifdef CONFIG_ARCH_HAS_PTE_DEVMAP -static inline int pte_devmap(pte_t pte) -{ - return pte_val(pte) & _PAGE_DEVMAP; -} -#endif - /* static inline pte_t pte_rdprotect(pte_t pte) */ static inline pte_t pte_wrprotect(pte_t pte) @@ -447,11 +440,6 @@ static inline pte_t pte_mkspecial(pte_t pte) return __pte(pte_val(pte) | _PAGE_SPECIAL); } -static inline pte_t pte_mkdevmap(pte_t pte) -{ - return __pte(pte_val(pte) | _PAGE_DEVMAP); -} - static inline pte_t pte_mkhuge(pte_t pte) { return pte; @@ -763,11 +751,6 @@ static inline pmd_t pmd_mkdirty(pmd_t pmd) return pte_pmd(pte_mkdirty(pmd_pte(pmd))); } -static inline pmd_t pmd_mkdevmap(pmd_t pmd) -{ - return pte_pmd(pte_mkdevmap(pmd_pte(pmd))); -} - static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp, pmd_t pmd) {