#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/hardirq.h>
+#include <linux/dmar.h>
#include <asm/smp.h>
#include <asm/ipi.h>
struct genapic __read_mostly *genapic = &apic_flat;
+static int x2apic_phys = 0;
+
+static int set_x2apic_phys_mode(char *arg)
+{
+ x2apic_phys = 1;
+ return 0;
+}
+early_param("x2apic_phys", set_x2apic_phys_mode);
+
static enum uv_system_type uv_system_type;
/*
{
if (uv_system_type == UV_NON_UNIQUE_APIC)
genapic = &apic_x2apic_uv_x;
- else
+ else if (cpu_has_x2apic && intr_remapping_enabled) {
+ if (x2apic_phys)
+ genapic = &apic_x2apic_phys;
+ else
+ genapic = &apic_x2apic_cluster;
+ } else
#ifdef CONFIG_ACPI
/*
* Quirk: some x86_64 machines can only use physical APIC mode
else
#endif
- if (cpus_weight(cpu_possible_map) <= 8)
+ if (max_physical_apicid < 8)
genapic = &apic_flat;
else
genapic = &apic_physflat;
/* Same for both flat and physical. */
-void send_IPI_self(int vector)
+void apic_send_IPI_self(int vector)
{
__send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
}
return 0;
}
-unsigned int read_apic_id(void)
-{
- unsigned int id;
-
- WARN_ON(preemptible());
- id = apic_read(APIC_ID);
- if (uv_system_type >= UV_X2APIC)
- id |= __get_cpu_var(x2apic_extra_bits);
- return id;
-}
-
enum uv_system_type get_uv_system_type(void)
{
return uv_system_type;