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.
Showing the changes to include/linux (2 of 6 files). Show all
Unified · Split
| @@ -62,7 +62,7 @@ · 61 unmodified lines | |||
| 62 | #include <linux/kconfig.h> | 62 | #include <linux/kconfig.h> |
| 63 | #include <asm/pgtable.h> | 63 | #include <asm/pgtable.h> |
| 64 | 64 | ||
| 65 | #if IS_ENABLED(CONFIG_HMM) | 65 | #ifdef CONFIG_HMM_MIRROR |
| 66 | 66 | ||
| 67 | #include <linux/device.h> | 67 | #include <linux/device.h> |
| 68 | #include <linux/migrate.h> | 68 | #include <linux/migrate.h> |
| @@ -332,9 +332,6 @@ static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range, · 263 unmodified lines | |||
| 332 | return hmm_device_entry_from_pfn(range, pfn); | 332 | return hmm_device_entry_from_pfn(range, pfn); |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | |||
| 336 | |||
| 337 | #if IS_ENABLED(CONFIG_HMM_MIRROR) | ||
| 338 | /* | 335 | /* |
| 339 | * Mirroring: how to synchronize device page table with CPU page table. | 336 | * Mirroring: how to synchronize device page table with CPU page table. |
| 340 | * | 337 | * |
| @@ -501,7 +501,7 @@ struct mm_struct { · 500 unmodified lines | |||
| 501 | #endif | 501 | #endif |
| 502 | struct work_struct async_put_work; | 502 | struct work_struct async_put_work; |
| 503 | 503 | ||
| 504 | #if IS_ENABLED(CONFIG_HMM) | 504 | #ifdef CONFIG_HMM_MIRROR |
| 505 | /* HMM needs to track a few things per mm */ | 505 | /* HMM needs to track a few things per mm */ |
| 506 | struct hmm *hmm; | 506 | struct hmm *hmm; |
| 507 | #endif | 507 | #endif |