x86/pv: Fix Clang build with !CONFIG_PV32
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 May 2020 13:03:35 +0000 (14:03 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 May 2020 15:12:54 +0000 (16:12 +0100)
commitcdc3b1f26f80b57b28fb94cb4bf26f79a3cc2765
tree887027a7fa7ce8f104aaedd5a5db611541dc0628
parentf7aa6c36c5a8173236a68cb1f1b09c8bef9d6d3a
x86/pv: Fix Clang build with !CONFIG_PV32

Clang 3.5 doesn't do enough dead-code-elimination to drop the compat_gdt
reference, resulting in a linker failure:

  hidden symbol `per_cpu__compat_gdt' isn't defined

Drop the local variable, and move the evaluation of this_cpu(compat_gdt) to
within the guarded region.

Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/cpu/common.c