x86/setup: Avoid OoB E820 lookup when calculating the L1TF safe address
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Aug 2018 15:26:22 +0000 (16:26 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Aug 2018 17:10:07 +0000 (18:10 +0100)
commit3e4ec07e14bce81f6ae22c31ff1302d1f297a226
tree12eeca910236cb02c6cba72b20787266cd268416
parentafc3f910d3434b540e4e4f51d9fd2723aea22fa2
x86/setup: Avoid OoB E820 lookup when calculating the L1TF safe address

A number of corner cases (most obviously, no-real-mode and no Multiboot memory
map) can end up with e820_raw.nr_map being 0, at which point the L1TF
calculation will underflow.

Spotted by Coverity.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/setup.c