Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312413
b: refs/heads/master
c: 332afa6
h: refs/heads/master
i:
  312411: 17c0004
v: v3
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Jun 6, 2012
1 parent 18d5e77 commit c8e2d85
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 56 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: d48daf37a3d2e2b28a61e615c0fc538301edb0dd
refs/heads/master: 332afa656e76458ee9cf0f0d123016a0658539e4
2 changes: 0 additions & 2 deletions trunk/arch/x86/include/asm/x86_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ 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 @@ -178,7 +177,6 @@ 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
15 changes: 6 additions & 9 deletions trunk/arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,7 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
old_vector = cfg->vector;
if (old_vector) {
cpumask_and(tmp_mask, mask, cpu_online_mask);
cpumask_and(tmp_mask, cfg->domain, tmp_mask);
if (!cpumask_empty(tmp_mask)) {
if (cpumask_subset(tmp_mask, cfg->domain)) {
free_cpumask_var(tmp_mask);
return 0;
}
Expand All @@ -1141,6 +1140,11 @@ __assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)

apic->vector_allocation_domain(cpu, tmp_mask);

if (cpumask_subset(tmp_mask, cfg->domain)) {
free_cpumask_var(tmp_mask);
return 0;
}

vector = current_vector;
offset = current_offset;
next:
Expand Down Expand Up @@ -1346,13 +1350,6 @@ static void setup_ioapic_irq(unsigned int irq, struct irq_cfg *cfg,

if (!IO_APIC_IRQ(irq))
return;
/*
* For legacy irqs, cfg->domain starts with cpu 0 for legacy
* controllers like 8259. Now that IO-APIC can handle this irq, update
* the cfg->domain.
*/
if (irq < legacy_pic->nr_legacy_irqs && cpumask_test_cpu(0, cfg->domain))
apic->vector_allocation_domain(0, cfg->domain);

if (assign_irq_vector(irq, cfg, apic->target_cpus()))
return;
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/x86/kernel/apic/probe_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,6 @@ 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: 9 additions & 2 deletions trunk/arch/x86/kernel/apic/probe_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
#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 @@ -43,8 +48,10 @@ void __init default_setup_apic_routing(void)
}
}

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

/* Same for both flat and physical. */
Expand Down
43 changes: 4 additions & 39 deletions trunk/arch/x86/kernel/vsmp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#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 @@ -96,30 +95,19 @@ 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 @@ -199,35 +187,12 @@ 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 c8e2d85

Please sign in to comment.