Skip to content

Commit 43535b0

Browse files
Christoph Hellwigjgunthorpe
authored andcommitted
mm: remove the HMM config option
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau depend on it instead of the mix of a dummy dependency symbol plus the actually selected one. Drop various odd dependencies, as the code is pretty portable. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Dan Williams <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 7328d9c commit 43535b0

File tree

6 files changed

+8
-33
lines changed

6 files changed

+8
-33
lines changed

drivers/gpu/drm/nouveau/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ config DRM_NOUVEAU_BACKLIGHT
8484

8585
config DRM_NOUVEAU_SVM
8686
bool "(EXPERIMENTAL) Enable SVM (Shared Virtual Memory) support"
87-
depends on ARCH_HAS_HMM
8887
depends on DEVICE_PRIVATE
8988
depends on DRM_NOUVEAU
89+
depends on HMM_MIRROR
9090
depends on STAGING
91-
select HMM_MIRROR
9291
default n
9392
help
9493
Say Y here if you want to enable experimental support for

include/linux/hmm.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#include <linux/kconfig.h>
6363
#include <asm/pgtable.h>
6464

65-
#if IS_ENABLED(CONFIG_HMM)
65+
#ifdef CONFIG_HMM_MIRROR
6666

6767
#include <linux/device.h>
6868
#include <linux/migrate.h>
@@ -332,9 +332,6 @@ static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range,
332332
return hmm_device_entry_from_pfn(range, pfn);
333333
}
334334

335-
336-
337-
#if IS_ENABLED(CONFIG_HMM_MIRROR)
338335
/*
339336
* Mirroring: how to synchronize device page table with CPU page table.
340337
*

include/linux/mm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ struct mm_struct {
501501
#endif
502502
struct work_struct async_put_work;
503503

504-
#if IS_ENABLED(CONFIG_HMM)
504+
#ifdef CONFIG_HMM_MIRROR
505505
/* HMM needs to track a few things per mm */
506506
struct hmm *hmm;
507507
#endif

mm/Kconfig

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -669,37 +669,18 @@ config ZONE_DEVICE
669669

670670
If FS_DAX is enabled, then say Y.
671671

672-
config ARCH_HAS_HMM_MIRROR
673-
bool
674-
default y
675-
depends on (X86_64 || PPC64)
676-
depends on MMU && 64BIT
677-
678-
config ARCH_HAS_HMM
679-
bool
680-
depends on (X86_64 || PPC64)
681-
depends on ZONE_DEVICE
682-
depends on MMU && 64BIT
683-
depends on MEMORY_HOTPLUG
684-
depends on MEMORY_HOTREMOVE
685-
depends on SPARSEMEM_VMEMMAP
686-
default y
687-
688672
config MIGRATE_VMA_HELPER
689673
bool
690674

691675
config DEV_PAGEMAP_OPS
692676
bool
693677

694-
config HMM
695-
bool
696-
select MMU_NOTIFIER
697-
select MIGRATE_VMA_HELPER
698-
699678
config HMM_MIRROR
700679
bool "HMM mirror CPU page table into a device page table"
701-
depends on ARCH_HAS_HMM
702-
select HMM
680+
depends on (X86_64 || PPC64)
681+
depends on MMU && 64BIT
682+
select MMU_NOTIFIER
683+
select MIGRATE_VMA_HELPER
703684
help
704685
Select HMM_MIRROR if you want to mirror range of the CPU page table of a
705686
process into a device page table. Here, mirror means "keep synchronized".

mm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ obj-$(CONFIG_FRAME_VECTOR) += frame_vector.o
102102
obj-$(CONFIG_DEBUG_PAGE_REF) += debug_page_ref.o
103103
obj-$(CONFIG_HARDENED_USERCOPY) += usercopy.o
104104
obj-$(CONFIG_PERCPU_STATS) += percpu-stats.o
105-
obj-$(CONFIG_HMM) += hmm.o
105+
obj-$(CONFIG_HMM_MIRROR) += hmm.o
106106
obj-$(CONFIG_MEMFD_CREATE) += memfd.o

mm/hmm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/mmu_notifier.h>
2626
#include <linux/memory_hotplug.h>
2727

28-
#if IS_ENABLED(CONFIG_HMM_MIRROR)
2928
static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
3029

3130
static inline struct hmm *mm_get_hmm(struct mm_struct *mm)
@@ -1326,4 +1325,3 @@ long hmm_range_dma_unmap(struct hmm_range *range,
13261325
return cpages;
13271326
}
13281327
EXPORT_SYMBOL(hmm_range_dma_unmap);
1329-
#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */

0 commit comments

Comments
 (0)