login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
December
»
21
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic to hypervisor.h
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jeremy Fitzhardinge
Subject:
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic to hypervisor.h
Date: Tuesday, December 21, 2010 - 10:15 am
On 12/20/2010 10:18 PM, Sheng Yang wrote:
quoted text
> Then we can reuse it for Xen later.
You should probably get someone kvm-ish to ack this too. J
quoted text
> Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> > Signed-off-by: Sheng Yang <sheng@linux.intel.com> > --- > arch/x86/include/asm/hypervisor.h | 9 +++++++++ > arch/x86/kernel/apic/apic.c | 5 +++-- > 2 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h > index ff2546c..0c6f7af 100644 > --- a/arch/x86/include/asm/hypervisor.h > +++ b/arch/x86/include/asm/hypervisor.h > @@ -20,6 +20,8 @@ > #ifndef _ASM_X86_HYPERVISOR_H > #define _ASM_X86_HYPERVISOR_H > > +#include <asm/kvm_para.h> > + > extern void init_hypervisor(struct cpuinfo_x86 *c); > extern void init_hypervisor_platform(void); > > @@ -47,4 +49,11 @@ extern const struct hypervisor_x86 x86_hyper_vmware; > extern const struct hypervisor_x86 x86_hyper_ms_hyperv; > extern const struct hypervisor_x86 x86_hyper_xen_hvm; > > +static inline bool hypervisor_x2apic_available(void) > +{ > + if (kvm_para_available()) > + return true; > + return false; > +} > + > #endif > diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c > index 3f838d5..8408f2d 100644 > --- a/arch/x86/kernel/apic/apic.c > +++ b/arch/x86/kernel/apic/apic.c > @@ -50,8 +50,8 @@ > #include <asm/mtrr.h> > #include <asm/smp.h> > #include <asm/mce.h> > -#include <asm/kvm_para.h> > #include <asm/tsc.h> > +#include <asm/hypervisor.h> > > unsigned int num_processors; > > @@ -1476,7 +1476,8 @@ void __init enable_IR_x2apic(void) > /* IR is required if there is APIC ID > 255 even when running > * under KVM > */ > - if (max_physical_apicid > 255 || !kvm_para_available()) > + if (max_physical_apicid > 255 || > + !hypervisor_x2apic_available()) > goto nox2apic; > /* > * without IR all CPUs can be addressed by IOAPIC/MSI
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 1/2] apic: Move hypervisor detection of x2apic to h ...
, Sheng Yang
, (Mon Dec 20, 11:18 pm)
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic ...
, Jeremy Fitzhardinge
, (Tue Dec 21, 10:15 am)
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic ...
, Avi Kivity
, (Tue Dec 21, 11:15 am)
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic ...
, Sheng Yang
, (Thu Dec 30, 7:05 pm)
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic ...
, Sheng Yang
, (Tue Jan 4, 1:57 am)
Re: [PATCH 1/2] apic: Move hypervisor detection of x2apic ...
, Ingo Molnar
, (Tue Jan 4, 2:24 am)
Navigation
Mailing list archives
Recent posts