Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 1/1] x86: Use x2apic physical mode based on FADT setting

53 views
Skip to first unread message

Greg Pearson

unread,
Apr 24, 2012, 6:50:04 PM4/24/12
to
Provide systems that do not support x2apic cluster mode
a mechanism to select x2apic physical mode using the
FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.

Signed-off-by: Greg Pearson <greg.p...@hp.com>
---
arch/x86/kernel/apic/x2apic_phys.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 8a778db..c372926 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -6,6 +6,10 @@
#include <linux/init.h>
#include <linux/dmar.h>

+#ifdef CONFIG_ACPI
+#include <linux/acpi.h>
+#endif
+
#include <asm/smp.h>
#include <asm/x2apic.h>

@@ -24,6 +28,14 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (x2apic_phys)
return x2apic_enabled();
+#ifdef CONFIG_ACPI
+ else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+ (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
+ x2apic_enabled()) {
+ printk(KERN_DEBUG "System requires x2apic physical mode\n");
+ return 1;
+ }
+#endif
else
return 0;
}
--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Suresh Siddha

unread,
Apr 24, 2012, 7:00:02 PM4/24/12
to
On Tue, 2012-04-24 at 16:38 -0600, Greg Pearson wrote:
> Provide systems that do not support x2apic cluster mode
> a mechanism to select x2apic physical mode using the
> FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.
>
> Signed-off-by: Greg Pearson <greg.p...@hp.com>
> ---
> arch/x86/kernel/apic/x2apic_phys.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
> index 8a778db..c372926 100644
> --- a/arch/x86/kernel/apic/x2apic_phys.c
> +++ b/arch/x86/kernel/apic/x2apic_phys.c
> @@ -6,6 +6,10 @@
> #include <linux/init.h>
> #include <linux/dmar.h>
>
> +#ifdef CONFIG_ACPI
> +#include <linux/acpi.h>
> +#endif

dmar.h already includes acpi.h

> +
> #include <asm/smp.h>
> #include <asm/x2apic.h>
>
> @@ -24,6 +28,14 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
> {
> if (x2apic_phys)
> return x2apic_enabled();
> +#ifdef CONFIG_ACPI
> + else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
> + (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
> + x2apic_enabled()) {
> + printk(KERN_DEBUG "System requires x2apic physical mode\n");
> + return 1;
> + }
> +#endif

x2apic is already dependent on irq-remapping which depends on ACPI. So I
think you can do away with those ifdef CONFIG_ACPI.

Also, which system requires this? If you can include the information in
the changelog that will be great.

thanks,
suresh

Greg Pearson

unread,
Apr 24, 2012, 8:30:02 PM4/24/12
to
Provide systems that do not support x2apic cluster mode
a mechanism to select x2apic physical mode using the
FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.

Changes from v1: (based on Suresh's comments)
- removed #ifdef CONFIG_ACPI
- removed #include <linux/acpi.h>

Signed-off-by: Greg Pearson <greg.p...@hp.com>
---
arch/x86/kernel/apic/x2apic_phys.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 8a778db..991e315 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -24,6 +24,12 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (x2apic_phys)
return x2apic_enabled();
+ else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+ (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
+ x2apic_enabled()) {
+ printk(KERN_DEBUG "System requires x2apic physical mode\n");
+ return 1;
+ }
else
return 0;
}
--
1.7.5.4

Suresh Siddha

unread,
Apr 24, 2012, 9:50:02 PM4/24/12
to
Acked-by: Suresh Siddha <suresh....@intel.com>

tip-bot for Greg Pearson

unread,
Apr 25, 2012, 10:00:03 AM4/25/12
to
Commit-ID: ea0dcf903e7d76aa5d483d876215fedcfdfe140f
Gitweb: http://git.kernel.org/tip/ea0dcf903e7d76aa5d483d876215fedcfdfe140f
Author: Greg Pearson <greg.p...@hp.com>
AuthorDate: Tue, 24 Apr 2012 18:23:56 -0600
Committer: Ingo Molnar <mi...@kernel.org>
CommitDate: Wed, 25 Apr 2012 12:47:08 +0200

x86/apic: Use x2apic physical mode based on FADT setting

Provide systems that do not support x2apic cluster mode
a mechanism to select x2apic physical mode using the
FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.

Changes from v1: (based on Suresh's comments)
- removed #ifdef CONFIG_ACPI
- removed #include <linux/acpi.h>

Signed-off-by: Greg Pearson <greg.p...@hp.com>
Acked-by: Suresh Siddha <suresh....@intel.com>
Link: http://lkml.kernel.org/r/1335313436-32020-1-git-...@hp.com
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
arch/x86/kernel/apic/x2apic_phys.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 8a778db..991e315 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -24,6 +24,12 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
if (x2apic_phys)
return x2apic_enabled();
+ else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
+ (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
+ x2apic_enabled()) {
+ printk(KERN_DEBUG "System requires x2apic physical mode\n");
+ return 1;
+ }
else
return 0;
}
--
0 new messages