Naman Jain
404cd6bffe
mshv_vtl: Fix vmemmap_shift exceeding MAX_FOLIO_ORDER
...
When registering VTL0 memory via MSHV_ADD_VTL0_MEMORY, the kernel
computes pgmap->vmemmap_shift as the number of trailing zeros in the
OR of start_pfn and last_pfn, intending to use the largest compound
page order both endpoints are aligned to.
However, this value is not clamped to MAX_FOLIO_ORDER, so a
sufficiently aligned range (e.g. physical range
[0x800000000000, 0x800080000000), corresponding to start_pfn=0x800000000
with 35 trailing zeros) can produce a shift larger than what
memremap_pages() accepts, triggering a WARN and returning -EINVAL:
WARNING: ... memremap_pages+0x512/0x650
requested folio size unsupported
The MAX_FOLIO_ORDER check was added by
commit 646b67d575 ("mm/memremap: reject unreasonable folio/compound
page sizes in memremap_pages()").
Fix this by clamping vmemmap_shift to MAX_FOLIO_ORDER so we always
request the largest order the kernel supports, in those cases, rather
than an out-of-range value.
Also fix the error path to propagate the actual error code from
devm_memremap_pages() instead of hard-coding -EFAULT, which was
masking the real -EINVAL return.
Fixes: 7bfe3b8ea6 ("Drivers: hv: Introduce mshv_vtl driver")
Cc: stable@vger.kernel.org
Signed-off-by: Naman Jain <namjain@linux.microsoft.com >
Reviewed-by: Michael Kelley <mhklinux@outlook.com >
Signed-off-by: Wei Liu <wei.liu@kernel.org >
2026-04-14 04:44:31 +00:00
..
2026-04-02 15:18:14 -05:00
2026-02-21 17:09:51 -08:00
2026-04-05 14:43:47 -07:00
2026-02-21 17:09:51 -08:00
2026-03-31 14:58:56 +02:00
2026-04-07 09:36:46 +02:00
2026-02-22 08:26:33 -08:00
2026-03-27 09:54:31 +01:00
2026-04-09 14:36:52 +02:00
2026-02-21 17:09:51 -08:00
2026-03-21 17:36:33 -07:00
2026-04-01 16:45:47 -04:00
2026-03-17 20:30:57 +01:00
2026-02-06 19:54:40 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-26 14:34:21 -08:00
2026-03-17 20:30:57 +01:00
2026-02-22 08:26:33 -08:00
2026-04-02 14:40:27 +02:00
2026-02-21 20:03:00 -08:00
2026-03-22 15:59:22 +09:00
2026-04-01 16:08:15 +02:00
2026-03-10 16:03:02 +01:00
2026-04-02 17:29:48 -07:00
2026-03-19 15:12:40 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-17 16:33:32 +05:30
2026-02-21 20:03:00 -08:00
2026-02-26 08:00:13 -08:00
2026-04-05 17:49:19 +02:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-03-16 19:29:45 -07:00
2026-04-09 11:21:21 -07:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-02 14:30:40 +02:00
2026-04-10 09:01:24 +02:00
2026-04-11 07:35:22 +10:00
2026-02-21 20:03:00 -08:00
2026-04-08 13:38:30 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-14 04:44:31 +00:00
2026-04-01 07:45:57 -07:00
2026-02-10 20:45:30 -08:00
2026-02-21 20:03:00 -08:00
2026-04-02 01:22:46 +02:00
2026-03-11 22:50:29 +01:00
2026-01-07 21:17:43 +01:00
2026-03-29 15:27:12 +02:00
2026-04-09 14:36:52 +02:00
2026-04-11 11:12:38 -07:00
2026-03-14 12:53:13 +02:00
2026-04-09 08:36:31 -07:00
2026-02-21 20:03:00 -08:00
2026-03-31 10:11:29 +02:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-03-26 13:14:07 +01:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-04-02 14:42:19 +02:00
2026-03-31 13:11:20 +02:00
2026-02-21 17:09:51 -08:00
2026-03-18 18:08:25 +01:00
2026-02-21 17:09:51 -08:00
2026-04-10 08:40:49 -07:00
2026-04-09 13:54:37 +02:00
2026-02-21 11:02:58 -08:00
2026-02-21 17:09:51 -08:00
2026-03-09 09:38:22 -05:00
2026-03-13 10:13:06 -07:00
2026-04-02 16:44:40 +02:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-04-14 04:42:44 +00:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-27 20:46:57 +05:30
2026-04-07 11:29:57 +02:00
2026-03-31 17:22:28 +03:00
2026-04-01 13:03:07 +02:00
2026-02-21 17:09:51 -08:00
2026-03-04 09:16:41 +01:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-04-07 15:24:11 +01:00
2026-03-05 10:18:23 -07:00
2026-03-13 14:17:30 +00:00
2026-03-23 12:25:47 +01:00
2026-02-21 17:09:51 -08:00
2026-02-22 09:43:11 -08:00
2026-04-03 17:50:24 -07:00
2026-02-21 17:09:51 -08:00
2026-03-27 19:58:22 -07:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-17 20:30:57 +01:00
2026-04-01 13:47:03 +02:00
2026-02-22 08:26:33 -08:00
2026-04-07 12:52:36 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-24 10:01:20 -08:00
2026-03-19 22:07:39 -04:00
2026-02-21 17:09:51 -08:00
2026-03-03 09:03:04 +01:00
2026-04-02 11:37:35 +02:00
2026-03-09 12:36:54 +01:00
2026-03-30 17:39:44 +02:00
2026-03-07 11:08:39 -05:00
2026-02-21 17:09:51 -08:00
2026-04-07 13:35:44 +02:00
2026-02-22 08:26:33 -08:00
2026-03-26 06:38:27 -06:00
2026-02-22 08:26:33 -08:00
2026-03-05 17:35:12 +01:00
2026-03-20 21:05:50 -07:00
2026-03-20 11:33:24 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-03-26 08:57:51 +01:00
2026-02-21 17:09:51 -08:00
2026-02-04 20:45:26 +05:30