Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312435
b: refs/heads/master
c: 8461689
h: refs/heads/master
i:
  312433: e45aaa0
  312431: 979393c
v: v3
  • Loading branch information
Ingo Molnar committed Jun 18, 2012
1 parent 947e763 commit ea419ce
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7eb9ae0799b1e9f0b77733b432bc5f6f055b020b
refs/heads/master: 8461689c67fc2ad3040bc019cccb541bccb5648f
2 changes: 2 additions & 0 deletions trunk/arch/x86/include/asm/x86_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ struct x86_cpuinit_ops {
* @i8042_detect pre-detect if i8042 controller exists
* @save_sched_clock_state: save state for sched_clock() on suspend
* @restore_sched_clock_state: restore state for sched_clock() on resume
* @apic_post_init: adjust apic if neeeded
*/
struct x86_platform_ops {
unsigned long (*calibrate_tsc)(void);
Expand All @@ -175,6 +176,7 @@ struct x86_platform_ops {
int (*i8042_detect)(void);
void (*save_sched_clock_state)(void);
void (*restore_sched_clock_state)(void);
void (*apic_post_init)(void);
};

struct pci_dev;
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/x86/kernel/apic/probe_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ void __init default_setup_apic_routing(void)

if (apic->setup_apic_routing)
apic->setup_apic_routing();

if (x86_platform.apic_post_init)
x86_platform.apic_post_init();
}

void __init generic_apic_probe(void)
Expand Down
11 changes: 2 additions & 9 deletions trunk/arch/x86/kernel/apic/probe_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
#include <asm/ipi.h>
#include <asm/setup.h>

static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
{
return hard_smp_processor_id() >> index_msb;
}

/*
* Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
*/
Expand All @@ -48,10 +43,8 @@ void __init default_setup_apic_routing(void)
}
}

if (is_vsmp_box()) {
/* need to update phys_pkg_id */
apic->phys_pkg_id = apicid_phys_pkg_id;
}
if (x86_platform.apic_post_init)
x86_platform.apic_post_init();
}

/* Same for both flat and physical. */
Expand Down
43 changes: 39 additions & 4 deletions trunk/arch/x86/kernel/vsmp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/pci_ids.h>
#include <linux/pci_regs.h>
#include <linux/smp.h>
#include <linux/irq.h>

#include <asm/apic.h>
#include <asm/pci-direct.h>
Expand Down Expand Up @@ -95,19 +96,30 @@ static void __init set_vsmp_pv_ops(void)
ctl = readl(address + 4);
printk(KERN_INFO "vSMP CTL: capabilities:0x%08x control:0x%08x\n",
cap, ctl);

/* If possible, let the vSMP foundation route the interrupt optimally */
#ifdef CONFIG_SMP
if (cap & ctl & BIT(8)) {
ctl &= ~BIT(8);
#ifdef CONFIG_PROC_FS
/* Don't let users change irq affinity via procfs */
no_irq_affinity = 1;
#endif
}
#endif

if (cap & ctl & (1 << 4)) {
/* Setup irq ops and turn on vSMP IRQ fastpath handling */
pv_irq_ops.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable);
pv_irq_ops.irq_enable = PV_CALLEE_SAVE(vsmp_irq_enable);
pv_irq_ops.save_fl = PV_CALLEE_SAVE(vsmp_save_fl);
pv_irq_ops.restore_fl = PV_CALLEE_SAVE(vsmp_restore_fl);
pv_init_ops.patch = vsmp_patch;

ctl &= ~(1 << 4);
writel(ctl, address + 4);
ctl = readl(address + 4);
printk(KERN_INFO "vSMP CTL: control set to:0x%08x\n", ctl);
}
writel(ctl, address + 4);
ctl = readl(address + 4);
pr_info("vSMP CTL: control set to:0x%08x\n", ctl);

early_iounmap(address, 8);
}
Expand Down Expand Up @@ -187,12 +199,35 @@ static void __init vsmp_cap_cpus(void)
#endif
}

static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
{
return hard_smp_processor_id() >> index_msb;
}

/*
* In vSMP, all cpus should be capable of handling interrupts, regardless of
* the APIC used.
*/
static void fill_vector_allocation_domain(int cpu, struct cpumask *retmask)
{
cpumask_setall(retmask);
}

static void vsmp_apic_post_init(void)
{
/* need to update phys_pkg_id */
apic->phys_pkg_id = apicid_phys_pkg_id;
apic->vector_allocation_domain = fill_vector_allocation_domain;
}

void __init vsmp_init(void)
{
detect_vsmp_box();
if (!is_vsmp_box())
return;

x86_platform.apic_post_init = vsmp_apic_post_init;

vsmp_cap_cpus();

set_vsmp_pv_ops();
Expand Down

0 comments on commit ea419ce

Please sign in to comment.