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

Andi Kleen
2009-06-22T07:49:31Z

Robert Richter <robert.richter@amd.com> 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@linux.intel.com -- Speaking for myself only.