Re: [PATCH 3/3] cpufrequtils aperf: Make data collection cpu hotplug proof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thomas Renninger <trenn@xxxxxxx>
Date: Thu, Apr 29, 2010 at 05:54:16PM +0200

> On Thursday 29 April 2010 17:36:47 Dominik Brodowski wrote:
> > Hey,
> > 
> > On Thu, Apr 29, 2010 at 05:13:13PM +0200, Borislav Petkov wrote:
> > > > brodo@comet$ sudo ./cpufreq-aperf 
> > > > brodo@comet$ ./cpufreq-aperf 
> > > > 
> > > > We should abort if we can't read the MSR, not loop with reporting "all cores
> > > > are offline".
> > > 
> > > This shouldn't be happening actually, since you can't take cpu 0
> > > offline, IOW, it should be still showing CPU0 online.
> > 
> > No, it now reports a CPU to be offline even if the call to MSR fails for
> > other reasons.
> > 
> > > Right.
> > > If we cannot read MSR on CPU 0, something is wrong...
> > 
> > Well, the reason for this is only root can read this MSR, it seems.
> This is one letter:
> +       ret = access(msr_path, F_OK);
> must be:
> +       ret = access(msr_path, R_OK);

Right, this should do it. You can only run aperf as root since accessing
the MSRs is done over /dev/cpu/0/msr which is (root:root) here. Making
it more permissive could open the floodgates on normal users crashing
the system by simply fumbling with hardware settings controlled over
MSRs.

-- 
Regards/Gruss,
Boris.

--
Advanced Micro Devices, Inc.
Operating Systems Research Center
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux