Logan Gunthorpe
bfeb022f8f
mm/memory_hotplug: add pgprot_t to mhp_params
...
devm_memremap_pages() is currently used by the PCI P2PDMA code to create
struct page mappings for IO memory. At present, these mappings are
created with PAGE_KERNEL which implies setting the PAT bits to be WB.
However, on x86, an mtrr register will typically override this and force
the cache type to be UC-. In the case firmware doesn't set this
register it is effectively WB and will typically result in a machine
check exception when it's accessed.
Other arches are not currently likely to function correctly seeing they
don't have any MTRR registers to fall back on.
To solve this, provide a way to specify the pgprot value explicitly to
arch_add_memory().
Of the arches that support MEMORY_HOTPLUG: x86_64, and arm64 need a
simple change to pass the pgprot_t down to their respective functions
which set up the page tables. For x86_32, set the page tables
explicitly using _set_memory_prot() (seeing they are already mapped).
For ia64, s390 and sh, reject anything but PAGE_KERNEL settings -- this
should be fine, for now, seeing these architectures don't support
ZONE_DEVICE.
A check in __add_pages() is also added to ensure the pgprot parameter
was set for all arches.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Acked-by: David Hildenbrand <david@redhat.com >
Acked-by: Michal Hocko <mhocko@suse.com >
Acked-by: Dan Williams <dan.j.williams@intel.com >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christoph Hellwig <hch@lst.de >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: Eric Badger <ebadger@gigaio.com >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jason Gunthorpe <jgg@ziepe.ca >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Will Deacon <will@kernel.org >
Link: http://lkml.kernel.org/r/20200306170846.9333-7-logang@deltatee.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-04-10 15:36:21 -07:00
..
2020-04-01 08:03:28 +02:00
2020-03-30 12:42:42 +02:00
2020-02-18 21:47:54 +01:00
2020-03-04 18:11:44 +01:00
2020-03-24 16:19:01 -07:00
2020-04-03 15:05:35 -07:00
2020-04-01 14:47:40 -07:00
2020-03-31 21:29:04 +02:00
2020-04-08 21:25:49 -07:00
2020-03-24 12:43:47 +00:00
2020-04-08 21:29:10 -07:00
2020-01-31 14:40:36 -08:00
2020-04-01 18:18:18 -07:00
2020-03-26 14:45:31 +01:00
2020-03-30 10:14:19 +02:00
2020-03-15 15:20:16 +01:00
2020-03-15 15:20:16 +01:00
2020-03-15 15:20:16 +01:00
2020-03-15 15:20:16 +01:00
2020-03-15 15:20:16 +01:00
2020-03-17 22:50:30 +00:00
2020-03-19 13:59:46 +01:00
2020-03-31 22:08:54 +02:00
2020-04-08 21:25:49 -07:00
2020-03-06 21:31:23 +01:00
2020-03-30 11:45:18 -07:00
2020-03-24 07:57:08 -06:00
2020-03-18 21:57:20 +00:00
2020-03-08 22:07:09 -07:00
2020-04-03 11:30:20 -07:00
2020-04-03 15:05:35 -07:00
2020-03-20 19:25:14 +05:30
2020-04-07 19:44:52 -07:00
2020-04-07 13:51:39 -07:00
2020-03-16 22:08:34 -04:00
2020-04-02 15:50:04 -07:00
2020-04-08 21:03:40 -07:00
2020-03-28 13:19:05 -05:00
2020-01-24 21:03:53 +01:00
2020-03-31 10:05:01 -07:00
2020-02-24 16:12:28 +01:00
2020-01-31 10:30:36 -08:00
2020-03-25 10:03:36 -05:00
2020-03-27 12:04:34 -06:00
2020-03-12 15:48:37 -07:00
2020-03-05 13:23:25 -08:00
2020-04-07 10:43:42 -07:00
2020-04-07 10:43:43 -07:00
2020-03-27 10:23:43 -06:00
2020-03-30 11:43:51 -07:00
2020-02-25 08:40:07 -07:00
2020-03-03 17:38:42 -05:00
2020-03-30 01:34:00 +02:00
2020-03-30 01:34:00 +02:00
2020-03-30 14:59:53 -07:00
2020-03-30 17:36:33 -07:00
2020-03-30 19:52:37 -07:00
2020-03-27 16:07:24 -07:00
2020-03-28 13:21:08 +01:00
2020-04-03 11:30:20 -07:00
2020-02-12 17:57:51 -05:00
2020-03-25 17:38:23 -07:00
2020-01-27 10:24:32 +01:00
2020-03-21 15:23:56 +01:00
2020-04-10 15:36:21 -07:00
2020-03-31 11:04:05 -07:00
2020-04-07 10:43:42 -07:00
2020-04-07 10:43:42 -07:00
2020-03-21 16:00:24 +01:00
2020-03-17 15:26:43 +01:00
2020-03-21 15:23:53 +01:00
2020-01-27 19:59:55 +01:00
2020-03-21 11:32:20 +01:00
2020-01-27 10:24:32 +01:00
2020-03-28 11:42:55 +01:00
2020-03-06 16:02:50 +00:00
2020-03-16 15:48:54 +00:00
2020-03-20 13:06:18 +01:00
2020-04-03 11:32:13 -04:00
2020-04-02 19:15:03 -07:00
2020-02-28 12:08:37 -08:00
2020-04-01 14:47:40 -07:00
2020-04-07 10:45:15 +02:00
2020-03-25 08:35:03 +09:00
2020-04-02 19:15:03 -07:00
2020-04-08 11:00:00 -07:00
2020-03-09 11:12:19 +01:00
2020-02-27 14:58:01 +01:00
2020-03-16 10:48:12 +01:00
2020-03-11 14:56:14 +05:30
2020-03-10 10:30:52 +01:00
2020-02-27 12:15:24 +01:00
2020-02-17 13:37:00 +01:00
2020-03-20 14:57:54 +01:00
2020-03-31 11:04:05 -07:00
2020-03-21 15:24:00 +01:00
2020-03-22 23:06:34 +01:00
2020-01-27 11:09:31 +01:00
2020-03-17 20:56:58 -07:00
2020-02-03 17:27:38 -07:00
2020-01-29 15:45:47 -07:00
2020-03-19 07:41:01 +01:00
2020-03-25 08:16:13 +09:00
2020-03-22 21:16:28 -07:00
2020-03-25 23:17:16 +01:00
2020-03-20 08:47:27 -06:00
2020-03-13 12:49:51 -07:00
2020-03-20 14:54:04 +01:00
2020-02-07 14:48:39 -05:00
2020-02-07 14:48:38 -05:00
2020-04-04 11:58:55 -07:00
2020-03-19 21:56:54 -07:00
2020-03-25 10:27:16 +01:00
2020-03-25 10:27:16 +01:00
2020-03-06 11:06:15 +01:00
2020-03-04 17:58:48 +01:00
2020-03-30 11:20:13 -07:00
2020-04-07 10:43:38 -07:00
2020-02-10 12:58:36 +01:00
2020-03-21 16:03:53 +01:00
2020-03-17 17:25:06 +01:00
2020-02-26 13:31:18 +02:00
2020-02-12 14:18:33 +01:00
2020-03-27 20:19:24 -03:00
2020-04-07 10:43:39 -07:00
2020-04-02 09:35:32 -07:00
2020-04-10 15:36:21 -07:00
2020-01-26 22:10:17 -05:00
2020-03-10 12:20:04 +01:00
2020-04-02 15:54:13 -07:00
2020-02-25 11:01:39 -08:00
2020-01-30 07:39:10 -08:00
2020-03-29 21:25:29 -07:00
2020-03-12 07:43:57 -04:00
2020-03-12 22:34:48 -07:00
2020-03-13 14:25:46 +01:00
2020-02-10 10:41:20 +01:00
2020-03-08 11:06:42 +01:00
2020-03-11 14:15:20 -06:00
2020-02-19 11:21:41 -08:00
2020-03-12 07:07:38 -06:00
2020-03-27 11:14:52 +01:00
2020-03-23 22:00:02 -07:00
2020-03-29 22:30:57 -07:00
2020-03-21 16:00:24 +01:00
2020-03-08 11:06:40 +01:00
2020-03-17 19:13:32 +01:00
2020-02-21 11:29:15 +01:00
2020-04-01 13:20:14 +02:00
2020-01-25 03:01:56 -05:00
2020-03-21 15:23:58 +01:00
2020-04-02 09:35:30 -07:00
2020-01-31 17:33:54 +00:00
2020-02-20 21:17:24 +01:00
2020-03-16 15:53:47 -04:00
2020-03-29 12:40:41 +01:00
2020-02-12 12:05:46 +01:00
2020-04-02 09:35:25 -07:00
2020-03-30 18:51:47 -07:00
2020-03-31 10:48:03 -04:00
2020-01-30 18:45:55 +01:00
2020-04-06 22:55:27 +02:00
2020-03-26 10:28:20 -06:00
2020-03-17 12:23:21 -07:00
2020-03-31 17:29:33 -07:00
2020-02-16 19:39:44 -08:00
2020-03-17 17:25:06 +01:00
2020-03-23 18:40:25 +01:00
2020-03-30 01:34:00 +02:00
2020-03-31 17:29:33 -07:00
2020-03-21 15:23:56 +01:00
2020-03-09 20:13:16 -07:00
2020-03-17 22:51:16 -07:00
2020-04-10 15:36:21 -07:00
2020-04-02 09:35:28 -07:00
2020-04-10 15:36:21 -07:00
2020-04-07 10:43:40 -07:00
2020-04-02 09:35:31 -07:00
2020-04-08 21:03:40 -07:00
2020-03-26 15:51:07 +01:00
2020-03-26 14:33:38 -03:00
2020-03-15 17:10:14 -07:00
2020-03-06 11:56:59 +01:00
2020-03-19 07:41:02 +01:00
2020-04-07 10:43:38 -07:00
2020-04-07 10:43:41 -07:00
2020-04-10 15:36:21 -07:00
2020-04-08 21:03:40 -07:00
2020-04-03 13:22:40 -07:00
2020-02-01 10:01:52 -08:00
2020-03-24 13:42:44 +01:00
2020-03-24 07:57:08 -06:00
2020-03-21 16:00:24 +01:00
2020-03-13 21:08:19 -04:00
2020-03-26 20:17:36 -07:00
2020-03-30 19:52:37 -07:00
2020-03-18 16:35:48 -07:00
2020-03-25 18:58:11 -07:00
2020-04-06 13:56:33 -04:00
2020-04-01 13:37:57 -04:00
2020-04-07 13:51:39 -07:00
2020-02-18 10:28:05 -08:00
2020-03-19 07:41:02 +01:00
2020-02-14 14:25:26 -06:00
2020-02-12 12:57:59 -08:00
2020-02-10 12:58:36 +01:00
2020-04-02 09:35:27 -07:00
2020-04-07 10:43:39 -07:00
2020-04-07 10:43:38 -07:00
2020-01-31 10:30:39 -08:00
2020-04-07 10:43:38 -07:00
2020-02-04 03:05:25 +00:00
2020-03-25 09:50:09 -06:00
2020-04-03 14:25:02 -07:00
2020-03-28 13:19:04 -05:00
2020-04-02 17:57:10 +01:00
2020-04-02 17:57:10 +01:00
2020-04-03 14:25:02 -07:00
2020-02-23 21:59:42 +01:00
2020-04-07 10:43:43 -07:00
2020-01-31 11:15:59 -08:00
2020-02-11 13:10:58 +01:00
2020-03-27 10:41:44 -03:00
2020-03-23 22:00:02 -07:00
2020-03-30 11:52:27 -07:00
2020-02-28 12:06:14 -06:00
2020-02-24 10:14:44 -06:00
2020-02-12 11:54:08 -08:00
2020-04-01 08:06:54 +02:00
2020-02-14 10:37:27 +01:00
2020-03-04 11:01:18 +01:00
2020-03-17 18:31:05 +01:00
2020-03-04 09:54:55 +01:00
2020-02-20 21:17:24 +01:00
2020-04-07 10:43:42 -07:00
2020-04-02 11:22:17 -07:00
2020-03-20 13:06:18 +01:00
2020-03-20 13:06:19 +01:00
2020-02-04 03:05:25 +00:00
2020-03-30 11:16:38 -07:00
2020-03-18 15:05:57 +00:00
2020-02-07 14:48:37 -05:00
2020-02-27 23:21:52 -05:00
2020-01-24 10:24:31 -08:00
2020-02-17 10:55:14 +01:00
2020-02-20 15:58:23 -08:00
2020-01-24 10:37:27 -08:00
2020-02-20 16:03:30 -08:00
2020-02-20 16:03:30 -08:00
2020-03-21 16:00:22 +01:00
2020-02-19 18:12:31 +00:00
2020-03-25 22:29:45 -07:00
2020-03-06 22:33:38 -08:00
2020-03-27 16:39:01 -04:00
2020-04-02 18:47:30 +02:00
2020-03-21 16:00:24 +01:00
2020-03-21 16:00:24 +01:00
2020-04-02 11:22:17 -07:00
2020-03-04 14:48:54 -08:00
2020-03-31 15:49:51 -07:00
2020-02-21 10:31:18 +01:00
2020-04-07 10:43:42 -07:00
2020-03-17 15:58:00 +01:00
2020-03-12 17:16:42 +01:00
2020-04-07 10:43:38 -07:00
2020-03-26 14:41:22 -04:00
2020-04-06 10:25:15 -07:00
2020-03-09 22:34:58 +01:00
2020-04-10 15:36:20 -07:00
2020-01-24 20:40:09 +01:00
2020-03-30 12:18:49 -07:00
2020-03-21 16:00:24 +01:00
2020-03-21 16:00:24 +01:00
2020-03-02 14:04:31 -07:00
2020-04-07 10:43:43 -07:00
2020-03-18 09:50:20 +00:00
2020-03-09 20:13:16 -07:00
2020-02-04 03:05:26 +00:00
2020-03-23 13:41:55 +01:00
2020-01-31 10:30:40 -08:00
2020-04-02 09:35:27 -07:00
2020-04-07 10:43:41 -07:00
2020-02-05 18:53:05 +01:00
2020-01-29 19:38:34 -08:00
2020-04-05 11:34:35 -07:00
2020-03-07 09:52:02 +01:00
2020-03-29 22:14:48 -07:00
2020-02-28 13:37:42 +01:00
2020-03-12 11:56:53 +01:00
2020-03-21 17:48:13 +01:00
2020-03-30 18:51:47 -07:00
2020-03-21 15:23:58 +01:00
2020-03-21 15:23:57 +01:00
2020-02-21 11:22:15 -08:00
2020-02-20 15:58:22 -08:00
2020-03-30 14:59:53 -07:00
2020-04-02 09:35:26 -07:00
2020-03-19 17:48:36 -04:00
2020-02-10 12:26:44 -08:00
2020-02-21 11:22:15 -08:00
2020-03-06 12:28:24 +11:00
2020-03-18 12:34:10 +01:00
2020-01-31 10:30:39 -08:00
2020-02-19 11:08:52 +01:00
2020-02-23 19:24:51 +01:00
2020-02-23 19:24:51 +01:00
2020-04-07 10:43:39 -07:00
2020-03-23 17:01:47 +01:00
2020-04-01 12:06:26 -04:00
2020-03-24 09:32:41 -06:00
2020-04-01 12:06:26 -04:00
2020-04-07 10:43:38 -07:00
2020-03-21 18:56:06 -07:00
2020-04-01 12:06:26 -04:00
2020-03-06 08:35:39 +01:00
2020-02-11 13:10:56 +01:00
2020-04-03 12:27:36 -07:00
2020-03-12 17:42:08 -04:00
2020-03-16 15:53:47 -04:00
2020-01-31 10:30:40 -08:00
2020-03-09 11:12:19 +01:00