x86/apic: Only disable CPU x2apic mode when necessary
x86/apic: Only disable CPU x2apic mode when necessary

When interrupt remapping hardware is not in X2APIC, CPU X2APIC mode
will be disabled if:
1) Maximum CPU APIC ID is bigger than 255
2) hypervisior doesn't support x2apic mode.

But we should only check whether hypervisor supports X2APIC mode when
hypervisor(CONFIG_HYPERVISOR_GUEST) is enabled, otherwise X2APIC will
always be disabled when CONFIG_HYPERVISOR_GUEST is disabled and IR
doesn't work in X2APIC mode.

Signed-off-by: Jiang Liu <68ee766e574f18b34b683085865827393efe88bd@linux.intel.com>
Tested-by: Joerg Roedel <4688a6871ff025801033b3c4b039d55a29f8f937@8bytes.org>
Cc: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>
Cc: d4d3187dbcba3fb2e2e25a4ce499c8e441b6817d@lists.linux-foundation.org
Cc: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@linux.intel.com>
Cc: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>
Cc: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Cc: Borislav Petkov <0691a664b24b6f15b20cd5aee64b72271db08be1@alien8.de>
Cc: David Rientjes <d8cd2994e15bc61ddb2b113030bda55eebc3a0fe@google.com>
Cc: HATAYAMA Daisuke <e293c7e13ecc029aa287dca4b8ecfdf8a10ea3b9@jp.fujitsu.com>
Cc: Jan Beulich <051346888327db48cce19d2cfd0e1c700bb7cf16@suse.com>
Cc: Richard Weinberger <320bca71fc381a4a025636043ca86e734e31cf8b@nod.at>
Cc: Oren Twaig <86e82526d0ff2908f3d9c305629c4fafaa5fe794@scalemp.com>
Link: http://lkml.kernel.org/r/1420615903-28253-12-git-send-email-68ee766e574f18b34b683085865827393efe88bd@linux.intel.com
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs