Muralidhara M K
a9b9ea0e63
x86/MCE/AMD: Use an u64 for bank_map
...
[ Upstream commit 4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156 ]
Thee maximum number of MCA banks is 64 (MAX_NR_BANKS), see
a0bc32b3ca
("x86/mce: Increase maximum number of banks to 64").
However, the bank_map which contains a bitfield of which banks to
initialize is of type unsigned int and that overflows when those bit
numbers are >= 32, leading to UBSAN complaining correctly:
UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/mce/amd.c:1365:38
shift exponent 32 is too large for 32-bit type 'int'
Change the bank_map to a u64 and use the proper BIT_ULL() macro when
modifying bits in there.
[ bp: Rewrite commit message. ]
Fixes: a0bc32b3ca
("x86/mce: Increase maximum number of banks to 64")
Signed-off-by: Muralidhara M K <muralimk@amd.com >
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de >
Link: https://lore.kernel.org/r/20230127151601.1068324-1-muralimk@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-17 11:47:41 +02:00
..
2023-02-01 08:23:18 +01:00
2022-06-09 10:21:05 +02:00
2023-05-17 11:47:41 +02:00
2023-05-17 11:47:30 +02:00
2023-03-11 16:39:59 +01:00
2020-03-25 11:50:48 +01:00
2022-10-05 10:38:43 +02:00
2020-10-06 07:07:03 +02:00
2020-05-22 18:24:40 +02:00
2020-05-27 13:05:59 +02:00
2020-03-30 19:14:28 -07:00
2021-12-08 09:03:27 +01:00
2020-09-08 22:21:36 -04:00
2020-05-19 18:03:07 +02:00
2021-11-18 14:04:32 +01:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2023-03-11 16:39:58 +01:00
2020-09-16 16:52:32 +02:00
2020-06-11 15:15:03 +02:00
2020-04-14 14:24:05 +02:00
2020-09-09 11:33:19 +02:00
2023-02-01 08:23:19 +01:00
2022-03-16 14:16:02 +01:00
2020-06-09 09:39:13 -07:00
2022-01-27 10:53:41 +01:00
2020-06-09 09:39:13 -07:00
2022-07-25 11:26:28 +02:00
2022-09-20 12:38:33 +02:00
2023-01-14 10:16:33 +01:00
2022-07-21 21:20:17 +02:00
2022-07-25 11:26:53 +02:00
2022-07-25 11:26:45 +02:00
2022-12-14 11:31:55 +01:00
2021-02-10 09:29:22 +01:00
2023-02-01 08:23:27 +01:00
2020-10-14 10:21:34 -07:00
2022-07-21 21:20:11 +02:00
2020-05-28 21:36:20 +02:00
2020-06-11 15:15:12 +02:00
2020-09-22 22:13:34 +02:00
2020-06-11 15:15:14 +02:00
2021-11-18 14:03:41 +01:00
2022-07-25 11:26:28 +02:00
2023-02-01 08:23:27 +01:00
2020-04-27 02:07:40 -04:00
2020-08-06 16:13:13 +02:00
2020-03-27 11:05:41 +01:00
2022-03-16 14:16:02 +01:00
2020-10-14 17:05:03 +02:00
2020-09-04 15:12:58 +02:00
2022-03-16 14:16:02 +01:00
2022-07-25 11:26:52 +02:00
2021-10-06 15:55:48 +02:00
2020-07-05 12:50:20 -07:00
2020-06-09 09:39:13 -07:00
2020-06-09 09:39:13 -07:00
2021-11-18 14:04:32 +01:00
2022-07-25 11:26:36 +02:00
2020-10-12 11:40:41 -07:00
2021-03-04 11:37:26 +01:00
2021-05-19 10:12:51 +02:00
2021-12-08 09:03:27 +01:00
2022-07-25 11:26:29 +02:00
2020-10-06 07:07:05 +02:00
2020-11-09 18:12:34 +01:00
2022-08-21 15:15:33 +02:00
2020-06-18 12:10:37 -07:00
2023-03-11 16:40:19 +01:00
2023-03-11 16:40:19 +01:00
2023-03-11 16:39:23 +01:00
2020-09-04 15:12:58 +02:00
2020-02-17 14:40:23 +01:00
2020-10-06 11:18:04 +02:00
2023-03-11 16:39:58 +01:00
2022-07-25 11:26:51 +02:00
2022-07-25 11:26:51 +02:00
2020-06-02 10:59:12 -07:00
2022-03-16 14:16:02 +01:00
2022-07-25 11:26:28 +02:00
2021-10-13 10:04:30 +02:00
2022-07-25 11:26:10 +02:00
2020-09-04 12:46:06 +01:00
2023-01-04 11:39:18 +01:00
2023-03-11 16:39:58 +01:00
2023-03-11 16:39:23 +01:00
2020-09-18 14:24:16 +01:00
2022-07-25 11:26:51 +02:00
2022-06-09 10:20:49 +02:00
2020-08-20 13:12:58 +02:00
2022-06-09 10:21:06 +02:00
2023-04-20 12:10:27 +02:00
2020-01-20 10:57:53 +01:00
2020-12-30 11:53:54 +01:00
2020-06-11 15:54:31 -07:00
2020-07-27 14:31:07 -04:00
2020-07-27 14:31:07 -04:00
2020-08-06 16:13:09 +02:00
2020-06-11 15:15:16 +02:00
2023-03-11 16:39:23 +01:00
2020-08-15 10:38:03 -07:00
2021-12-08 09:03:28 +01:00
2022-01-27 10:54:05 +01:00
2022-07-25 11:26:10 +02:00
2020-08-04 14:47:45 -07:00
2022-11-03 23:57:51 +09:00
2023-01-14 10:15:21 +01:00
2022-07-25 11:26:28 +02:00
2020-06-09 09:39:14 -07:00
2022-07-25 11:26:40 +02:00
2023-04-20 12:10:28 +02:00