x86: deal with gcc12 release build issues
authorJan Beulich <jbeulich@suse.com>
Wed, 27 Jul 2022 07:21:20 +0000 (09:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 Jul 2022 07:21:20 +0000 (09:21 +0200)
commitd09c4272de5640c5a7ccb7a42fb643ad6fd1032e
tree435ecccfcd37e8edbb7456fe696759e50dc702fb
parent9ab8e95d8f53005bfe28c558c183cbd67335cf49
x86: deal with gcc12 release build issues

While a number of issues we previously had with pre-release gcc12 were
fixed in the final release, we continue to have one issue (with multiple
instances) when doing release builds (i.e. at higher optimization
levels): The compiler takes issue with subtracting (always 1 in our
case) from artifical labels (expressed as array) marking the end of
certain regions. This isn't an unreasonable position to take. Simply
hide the "array-ness" by casting to an integer type. To keep things
looking consistently, apply the same cast also on the respective
expressions dealing with the starting addresses. (Note how
efi_arch_memory_setup()'s l2_table_offset() invocations avoid a similar
issue by already having the necessary casts.) In is_xen_fixed_mfn()
further switch from __pa() to virt_to_maddr() to better match the left
sides of the <= operators.

Reported-by: Charles Arnold <carnold@suse.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 9723507daf2120131410c91980d4e4d9b0d0aa90
master date: 2022-07-19 08:37:29 +0200
xen/arch/x86/efi/efi-boot.h
xen/include/asm-x86/mm.h