Bin Meng 9a7c6fde07 x86: mtrr: Abort if requested size is not power of 2
The size parameter of mtrr_add_request() and mtrr_set_next_var()
shall be power of 2, otherwise the logic creates a mask that does
not meet the requirement of IA32_MTRR_PHYSMASK register.

Programming such a mask value to IA32_MTRR_PHYSMASK generates #GP.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested on chromebook_coral, chromebook_samus, chromebook_link, minnowmax
Tested-by: Simon Glass <sjg@chromium.org>
2021-08-02 15:11:41 +08:00
..
2020-12-31 14:41:31 +01:00
2011-04-13 19:43:28 +10:00
2020-09-01 17:00:28 +08:00
2020-09-25 11:27:18 +08:00
2020-09-25 11:27:06 +08:00
2017-02-06 11:38:46 +08:00
2021-04-22 14:09:45 -04:00
2019-10-08 13:53:54 +08:00
2011-04-13 19:43:28 +10:00
2020-08-03 10:46:56 +08:00
2021-01-05 12:24:41 -07:00
2011-04-13 19:43:28 +10:00
2020-05-18 21:19:23 -04:00
2020-09-25 11:27:16 +08:00
2020-11-05 14:58:45 +08:00
2011-04-13 19:43:28 +10:00