Re: [PATCH 19/23] x86/oprofile: use 64 bit wrmsr functions

From: Andi Kleen
Date: Mon Jun 22 2009 - 03:49:36 EST


Robert Richter <robert.richter@xxxxxxx> writes:
> val |= op_x86_get_ctrl(model, &counter_config[i]);
> @@ -251,7 +252,7 @@ static int op_amd_check_ctrs(struct pt_regs * const regs,
> if (val & OP_CTR_OVERFLOW)
> continue;
> oprofile_add_sample(regs, i);
> - wrmsr(msrs->counters[i].addr, -(unsigned int)reset_value[i], -1);
> + wrmsrl(msrs->counters[i].addr, -(s64)reset_value[i]);

These are not equivalent on 64bit because reset_value is a long,
so the new code doesn't 32->64 extend anymore. You would
need a (s32) cast, not a (s64)

I don't think if it causes real problems, but it looks suspicious.

That's all over in multiple files.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/