From: Thomas Renninger <trenn@suse.de>
To: Frank Arnold <frank.arnold@amd.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
Borislav Petkov <borislav.petkov@amd.com>,
cpufreq@vger.kernel.org
Subject: Re: [PATCH] cpufrequtils aperf: Fix MSR read on 32-bit
Date: Wed, 8 Dec 2010 21:53:45 +0100 [thread overview]
Message-ID: <201012082153.46328.trenn@suse.de> (raw)
In-Reply-To: <1291826354.30060.34.camel@mendozza.osrc.amd.com>
On Wednesday 08 December 2010 17:39:14 Frank Arnold wrote:
> The cpufreq-aperf command does not work on 32-bit systems. The reason
> for that is a wrong count argument passed to the read() call. Instead
> of the buffer size, the size of the pointer to the buffer is used. On
> 64-bit systems this just happened to work, because we need to read an
> 8 byte value and a pointer has a size of 8 bytes on 64-bit. On 32-bit
> systems only 4 bytes are read, which then triggers the error path.
>
> Signed-off-by: Frank Arnold <frank.arnold@amd.com>
> ---
> utils/aperf.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/utils/aperf.c b/utils/aperf.c
> index 1c64501..6302f5a 100644
> --- a/utils/aperf.c
> +++ b/utils/aperf.c
> @@ -100,7 +100,7 @@ static int read_msr(int cpu, unsigned int idx,
unsigned long long *val)
> return -1;
> if (lseek(fd, idx, SEEK_CUR) == -1)
> goto err;
> - if (read(fd, val, sizeof val) != sizeof *val)
> + if (read(fd, val, sizeof *val) != sizeof *val)
Reviewed-by: trenn@suse.de
Thanks,
Thomas
next prev parent reply other threads:[~2010-12-08 20:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 16:39 [PATCH] cpufrequtils aperf: Fix MSR read on 32-bit Frank Arnold
2010-12-08 20:53 ` Thomas Renninger [this message]
2010-12-12 9:07 ` Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012082153.46328.trenn@suse.de \
--to=trenn@suse.de \
--cc=borislav.petkov@amd.com \
--cc=cpufreq@vger.kernel.org \
--cc=frank.arnold@amd.com \
--cc=linux@dominikbrodowski.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox