x86/kexec: fix kexec on systems which boot in x2apic mode
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Jul 2014 16:08:47 +0000 (18:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 23 Jul 2014 16:08:47 +0000 (18:08 +0200)
commit77ffa26374370c1c9805f9596f37a44d412a7fdb
treed32198d89a0968768ae709f688b87ba40ec145df
parent868d9b99b39c53dc1f6ae9bfd7b148c206fd7240
x86/kexec: fix kexec on systems which boot in x2apic mode

Moving straight from fully disabled to x2apic mode is an illegal state
transition, and causes an unconditional #GP fault.  Bounce through xapic mode
to avoid the fault.

In addition, avoid bouncing through the various apic modes if the mode is
already correct.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/apic.c