Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75081
b: refs/heads/master
c: a3ebdb6
h: refs/heads/master
i:
  75079: d54c9d5
v: v3
  • Loading branch information
Christoph Lameter authored and Tony Luck committed Dec 19, 2007
1 parent 67a7311 commit 3f2c3f8
Show file tree
Hide file tree
Showing 46 changed files with 339 additions and 339 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: f941b168a4d7281bf49e166f2febc49470c0149f
refs/heads/master: a3ebdb6c423dff420168a3faf25c76e9e5f59258
16 changes: 4 additions & 12 deletions trunk/arch/x86/kernel/io_apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1882,16 +1882,13 @@ __setup("no_timer_check", notimercheck);
static int __init timer_irq_works(void)
{
unsigned long t1 = jiffies;
unsigned long flags;

if (no_timer_check)
return 1;

local_save_flags(flags);
local_irq_enable();
/* Let ten ticks pass... */
mdelay((10 * 1000) / HZ);
local_irq_restore(flags);

/*
* Expect a few ticks at least, to be sure some possible
Expand Down Expand Up @@ -2170,9 +2167,6 @@ static inline void __init check_timer(void)
int apic1, pin1, apic2, pin2;
int vector;
unsigned int ver;
unsigned long flags;

local_irq_save(flags);

ver = apic_read(APIC_LVR);
ver = GET_APIC_VERSION(ver);
Expand Down Expand Up @@ -2225,7 +2219,7 @@ static inline void __init check_timer(void)
}
if (disable_timer_pin_1 > 0)
clear_IO_APIC_pin(0, pin1);
goto out;
return;
}
clear_IO_APIC_pin(apic1, pin1);
printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
Expand All @@ -2248,7 +2242,7 @@ static inline void __init check_timer(void)
if (nmi_watchdog == NMI_IO_APIC) {
setup_nmi();
}
goto out;
return;
}
/*
* Cleanup, just in case ...
Expand All @@ -2272,7 +2266,7 @@ static inline void __init check_timer(void)

if (timer_irq_works()) {
printk(" works.\n");
goto out;
return;
}
apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
printk(" failed.\n");
Expand All @@ -2288,13 +2282,11 @@ static inline void __init check_timer(void)

if (timer_irq_works()) {
printk(" works.\n");
goto out;
return;
}
printk(" failed :(.\n");
panic("IO-APIC + timer doesn't work! Boot with apic=debug and send a "
"report. Then try booting with the 'noapic' option");
out:
local_irq_restore(flags);
}

/*
Expand Down
16 changes: 4 additions & 12 deletions trunk/arch/x86/kernel/io_apic_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,13 +1281,10 @@ void disable_IO_APIC(void)
static int __init timer_irq_works(void)
{
unsigned long t1 = jiffies;
unsigned long flags;

local_save_flags(flags);
local_irq_enable();
/* Let ten ticks pass... */
mdelay((10 * 1000) / HZ);
local_irq_restore(flags);

/*
* Expect a few ticks at least, to be sure some possible
Expand Down Expand Up @@ -1658,9 +1655,6 @@ static inline void check_timer(void)
{
struct irq_cfg *cfg = irq_cfg + 0;
int apic1, pin1, apic2, pin2;
unsigned long flags;

local_irq_save(flags);

/*
* get/set the timer IRQ vector:
Expand Down Expand Up @@ -1702,7 +1696,7 @@ static inline void check_timer(void)
}
if (disable_timer_pin_1 > 0)
clear_IO_APIC_pin(0, pin1);
goto out;
return;
}
clear_IO_APIC_pin(apic1, pin1);
apic_printk(APIC_QUIET,KERN_ERR "..MP-BIOS bug: 8254 timer not "
Expand All @@ -1724,7 +1718,7 @@ static inline void check_timer(void)
if (nmi_watchdog == NMI_IO_APIC) {
setup_nmi();
}
goto out;
return;
}
/*
* Cleanup, just in case ...
Expand All @@ -1747,7 +1741,7 @@ static inline void check_timer(void)

if (timer_irq_works()) {
apic_printk(APIC_VERBOSE," works.\n");
goto out;
return;
}
apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
apic_printk(APIC_VERBOSE," failed.\n");
Expand All @@ -1762,12 +1756,10 @@ static inline void check_timer(void)

if (timer_irq_works()) {
apic_printk(APIC_VERBOSE," works.\n");
goto out;
return;
}
apic_printk(APIC_VERBOSE," failed :(.\n");
panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
out:
local_irq_restore(flags);
}

static int __init notimercheck(char *s)
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kernel/kprobes_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,9 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)

if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
if (&regs->esp != kcb->jprobe_saved_esp) {
struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
struct pt_regs *saved_regs =
container_of(kcb->jprobe_saved_esp,
struct pt_regs, esp);
printk("current esp %p does not match saved esp %p\n",
&regs->esp, kcb->jprobe_saved_esp);
printk("Saved registers for jprobe %p\n", jp);
Expand Down
47 changes: 27 additions & 20 deletions trunk/arch/x86/kernel/kprobes_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ static void __kprobes resume_execution(struct kprobe *p,
struct pt_regs *regs, struct kprobe_ctlblk *kcb)
{
unsigned long *tos = (unsigned long *)regs->rsp;
unsigned long next_rip = 0;
unsigned long copy_rip = (unsigned long)p->ainsn.insn;
unsigned long orig_rip = (unsigned long)p->addr;
kprobe_opcode_t *insn = p->ainsn.insn;
Expand All @@ -493,42 +494,46 @@ static void __kprobes resume_execution(struct kprobe *p,
if (*insn >= 0x40 && *insn <= 0x4f)
insn++;

regs->eflags &= ~TF_MASK;
switch (*insn) {
case 0x9c: /* pushfl */
case 0x9c: /* pushfl */
*tos &= ~(TF_MASK | IF_MASK);
*tos |= kcb->kprobe_old_rflags;
break;
case 0xc2: /* iret/ret/lret */
case 0xc3:
case 0xca:
case 0xc3: /* ret/lret */
case 0xcb:
case 0xcf:
case 0xea: /* jmp absolute -- ip is correct */
/* ip is already adjusted, no more changes required */
goto no_change;
case 0xe8: /* call relative - Fix return addr */
case 0xc2:
case 0xca:
regs->eflags &= ~TF_MASK;
/* rip is already adjusted, no more changes required*/
return;
case 0xe8: /* call relative - Fix return addr */
*tos = orig_rip + (*tos - copy_rip);
break;
case 0xff:
if ((insn[1] & 0x30) == 0x10) {
/* call absolute, indirect */
/* Fix return addr; ip is correct. */
/* Fix return addr; rip is correct. */
next_rip = regs->rip;
*tos = orig_rip + (*tos - copy_rip);
goto no_change;
} else if (((insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */
((insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */
/* ip is correct. */
goto no_change;
/* rip is correct. */
next_rip = regs->rip;
}
break;
case 0xea: /* jmp absolute -- rip is correct */
next_rip = regs->rip;
break;
default:
break;
}

regs->rip = orig_rip + (regs->rip - copy_rip);
no_change:

return;
regs->eflags &= ~TF_MASK;
if (next_rip) {
regs->rip = next_rip;
} else {
regs->rip = orig_rip + (regs->rip - copy_rip);
}
}

int __kprobes post_kprobe_handler(struct pt_regs *regs)
Expand Down Expand Up @@ -711,8 +716,10 @@ int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
struct jprobe *jp = container_of(p, struct jprobe, kp);

if ((addr > (u8 *) jprobe_return) && (addr < (u8 *) jprobe_return_end)) {
if ((unsigned long *)regs->rsp != kcb->jprobe_saved_rsp) {
struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
if ((long *)regs->rsp != kcb->jprobe_saved_rsp) {
struct pt_regs *saved_regs =
container_of(kcb->jprobe_saved_rsp,
struct pt_regs, rsp);
printk("current rsp %p does not match saved rsp %p\n",
(long *)regs->rsp, kcb->jprobe_saved_rsp);
printk("Saved registers for jprobe %p\n", jp);
Expand Down
22 changes: 6 additions & 16 deletions trunk/arch/x86/oprofile/op_model_athlon.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file op_model_athlon.h
* athlon / K7 / K8 / Family 10h model-specific MSR operations
* athlon / K7 model-specific MSR operations
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
Expand Down Expand Up @@ -31,16 +31,12 @@
#define CTRL_WRITE(l,h,msrs,c) do {wrmsr(msrs->controls[(c)].addr, (l), (h));} while (0)
#define CTRL_SET_ACTIVE(n) (n |= (1<<22))
#define CTRL_SET_INACTIVE(n) (n &= ~(1<<22))
#define CTRL_CLEAR_LO(x) (x &= (1<<21))
#define CTRL_CLEAR_HI(x) (x &= 0xfffffcf0)
#define CTRL_CLEAR(x) (x &= (1<<21))
#define CTRL_SET_ENABLE(val) (val |= 1<<20)
#define CTRL_SET_USR(val,u) (val |= ((u & 1) << 16))
#define CTRL_SET_KERN(val,k) (val |= ((k & 1) << 17))
#define CTRL_SET_UM(val, m) (val |= (m << 8))
#define CTRL_SET_EVENT_LOW(val, e) (val |= (e & 0xff))
#define CTRL_SET_EVENT_HIGH(val, e) (val |= ((e >> 8) & 0xf))
#define CTRL_SET_HOST_ONLY(val, h) (val |= ((h & 1) << 9))
#define CTRL_SET_GUEST_ONLY(val, h) (val |= ((h & 1) << 8))
#define CTRL_SET_EVENT(val, e) (val |= e)

static unsigned long reset_value[NUM_COUNTERS];

Expand Down Expand Up @@ -74,8 +70,7 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
if (unlikely(!CTRL_IS_RESERVED(msrs,i)))
continue;
CTRL_READ(low, high, msrs, i);
CTRL_CLEAR_LO(low);
CTRL_CLEAR_HI(high);
CTRL_CLEAR(low);
CTRL_WRITE(low, high, msrs, i);
}

Expand All @@ -94,17 +89,12 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
CTR_WRITE(counter_config[i].count, msrs, i);

CTRL_READ(low, high, msrs, i);
CTRL_CLEAR_LO(low);
CTRL_CLEAR_HI(high);
CTRL_CLEAR(low);
CTRL_SET_ENABLE(low);
CTRL_SET_USR(low, counter_config[i].user);
CTRL_SET_KERN(low, counter_config[i].kernel);
CTRL_SET_UM(low, counter_config[i].unit_mask);
CTRL_SET_EVENT_LOW(low, counter_config[i].event);
CTRL_SET_EVENT_HIGH(high, counter_config[i].event);
CTRL_SET_HOST_ONLY(high, 0);
CTRL_SET_GUEST_ONLY(high, 0);

CTRL_SET_EVENT(low, counter_config[i].event);
CTRL_WRITE(low, high, msrs, i);
} else {
reset_value[i] = 0;
Expand Down
11 changes: 4 additions & 7 deletions trunk/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ static void as_remove_queued_request(struct request_queue *q,
}

/*
* as_fifo_expired returns 0 if there are no expired requests on the fifo,
* as_fifo_expired returns 0 if there are no expired reads on the fifo,
* 1 otherwise. It is ratelimited so that we only perform the check once per
* `fifo_expire' interval. Otherwise a large number of expired requests
* would create a hopeless seekstorm.
Expand Down Expand Up @@ -1097,8 +1097,7 @@ static int as_dispatch_request(struct request_queue *q, int force)
ad->batch_data_dir = REQ_ASYNC;
ad->current_write_count = ad->write_batch_count;
ad->write_batch_idled = 0;
rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
ad->last_check_fifo[REQ_ASYNC] = jiffies;
rq = ad->next_rq[ad->batch_data_dir];
goto dispatch_request;
}

Expand Down Expand Up @@ -1160,7 +1159,7 @@ static void as_add_request(struct request_queue *q, struct request *rq)
as_add_rq_rb(ad, rq);

/*
* set expire time and add to fifo list
* set expire time (only used for reads) and add to fifo list
*/
rq_set_fifo_time(rq, jiffies + ad->fifo_expire[data_dir]);
list_add_tail(&rq->queuelist, &ad->fifo_list[data_dir]);
Expand Down Expand Up @@ -1464,9 +1463,7 @@ static struct elevator_type iosched_as = {

static int __init as_init(void)
{
elv_register(&iosched_as);

return 0;
return elv_register(&iosched_as);
}

static void __exit as_exit(void)
Expand Down
8 changes: 6 additions & 2 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,8 @@ static struct elevator_type iosched_cfq = {

static int __init cfq_init(void)
{
int ret;

/*
* could be 0 on HZ < 1000 setups
*/
Expand All @@ -2290,9 +2292,11 @@ static int __init cfq_init(void)
if (cfq_slab_setup())
return -ENOMEM;

elv_register(&iosched_cfq);
ret = elv_register(&iosched_cfq);
if (ret)
cfq_slab_kill();

return 0;
return ret;
}

static void __exit cfq_exit(void)
Expand Down
4 changes: 1 addition & 3 deletions trunk/block/deadline-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ static struct elevator_type iosched_deadline = {

static int __init deadline_init(void)
{
elv_register(&iosched_deadline);

return 0;
return elv_register(&iosched_deadline);
}

static void __exit deadline_exit(void)
Expand Down
3 changes: 2 additions & 1 deletion trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ void elv_unregister_queue(struct request_queue *q)
__elv_unregister_queue(q->elevator);
}

void elv_register(struct elevator_type *e)
int elv_register(struct elevator_type *e)
{
char *def = "";

Expand All @@ -975,6 +975,7 @@ void elv_register(struct elevator_type *e)
def = " (default)";

printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def);
return 0;
}
EXPORT_SYMBOL_GPL(elv_register);

Expand Down
4 changes: 1 addition & 3 deletions trunk/block/noop-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ static struct elevator_type elevator_noop = {

static int __init noop_init(void)
{
elv_register(&elevator_noop);

return 0;
return elv_register(&elevator_noop);
}

static void __exit noop_exit(void)
Expand Down
Loading

0 comments on commit 3f2c3f8

Please sign in to comment.