24 #include <asm/paravirt.h>
25 #include <asm/setup.h>
27 #define TOPOLOGY_REGISTER_OFFSET 0x10
29 #if defined CONFIG_PCI && defined CONFIG_PARAVIRT
36 static unsigned long vsmp_save_fl(
void)
38 unsigned long flags = native_save_fl();
41 flags &= ~X86_EFLAGS_IF;
46 static void vsmp_restore_fl(
unsigned long flags)
52 native_restore_fl(flags);
56 static void vsmp_irq_disable(
void)
58 unsigned long flags = native_save_fl();
64 static void vsmp_irq_enable(
void)
66 unsigned long flags = native_save_fl();
73 unsigned long addr,
unsigned len)
87 static void __init set_vsmp_pv_ops(
void)
96 ctl =
readl(address + 4);
102 if (cap & ctl &
BIT(8)) {
104 #ifdef CONFIG_PROC_FS
111 if (cap & ctl & (1 << 4)) {
121 ctl =
readl(address + 4);
122 pr_info(
"vSMP CTL: control set to:0x%08x\n", ctl);
127 static void __init set_vsmp_pv_ops(
void)
133 static int is_vsmp = -1;
135 static void __init detect_vsmp_box(
void)
159 static void __init detect_vsmp_box(
void)
168 static void __init vsmp_cap_cpus(
void)
170 #if !defined(CONFIG_X86_VSMP) && defined(CONFIG_SMP)
172 unsigned int cfg, topology, node_shift, maxcpus;
188 topology =
readl(address);
189 node_shift = (topology >> 16) & 0x7;
193 maxcpus = (topology & ((1 << node_shift) - 1)) + 1;
195 pr_info(
"vSMP CTL: Capping CPUs to %d (CONFIG_X86_VSMP is unset)\n",
202 static int apicid_phys_pkg_id(
int initial_apic_id,
int index_msb)
211 static void fill_vector_allocation_domain(
int cpu,
struct cpumask *retmask,
214 cpumask_setall(retmask);
217 static void vsmp_apic_post_init(
void)