diff options
| author | Ingo Molnar <mingo@kernel.org> | 2025-05-13 11:39:22 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2025-05-13 11:39:22 +0300 |
| commit | 34be751998c1407a460efe3a20f9c4ddb8c82b9f (patch) | |
| tree | e6b55b0ee269828b0cb63c67039c094ef0f407dc /include/linux | |
| parent | 69cb33e2f81a3265383f0c8bbd27c32b4a5a6bf3 (diff) | |
| parent | 1b3f2bd04d90f61e1f291b5e365b9bc4ce0ea7c7 (diff) | |
| download | linux-34be751998c1407a460efe3a20f9c4ddb8c82b9f.tar.xz | |
Merge branch 'x86/mm' into x86/core, to resolve conflicts
Conflicts:
arch/x86/mm/numa.c
arch/x86/mm/pgtable.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/io.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/io.h b/include/linux/io.h index 6a6bc4d46d0a..0642c7ee41db 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -183,4 +183,25 @@ static inline void arch_io_free_memtype_wc(resource_size_t base, int devm_arch_io_reserve_memtype_wc(struct device *dev, resource_size_t start, resource_size_t size); +#ifdef CONFIG_STRICT_DEVMEM +static inline int range_is_allowed(unsigned long pfn, unsigned long size) +{ + u64 from = ((u64)pfn) << PAGE_SHIFT; + u64 to = from + size; + u64 cursor = from; + + while (cursor < to) { + if (!devmem_is_allowed(pfn)) + return 0; + cursor += PAGE_SIZE; + pfn++; + } + return 1; +} +#else +static inline int range_is_allowed(unsigned long pfn, unsigned long size) +{ + return 1; +} +#endif #endif /* _LINUX_IO_H */ |
