From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
Laurent Vivier <laurent@vivier.eu>,
Justin Hibbits <chmeeedalf@gmail.com>,
Amit Shah <amit@kernel.org>
Subject: [Qemu-devel] [PULL 1/3] Fix cacheline detection on FreeBSD/powerpc.
Date: Tue, 2 Jul 2019 14:37:11 +0200 [thread overview]
Message-ID: <20190702123713.14396-2-laurent@vivier.eu> (raw)
In-Reply-To: <20190702123713.14396-1-laurent@vivier.eu>
From: Justin Hibbits <chmeeedalf@gmail.com>
machdep.cacheline_size is an integer, not a long. Since PowerPC is
big-endian this causes sysctlbyname() to fill in the upper bits of the
argument, rather than the correct 'lower bits' of the word. Specify the
correct type to fix this.
Fixes: b255b2c8a548 ("util: add cacheinfo")
Signed-off-by: Justin Hibbits <chmeeedalf@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190607135653.6ece685d@titan.knownspace>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
util/cacheinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/cacheinfo.c b/util/cacheinfo.c
index eebe1ce9c5d2..516f837748a3 100644
--- a/util/cacheinfo.c
+++ b/util/cacheinfo.c
@@ -77,7 +77,7 @@ static void sys_cache_info(int *isize, int *dsize)
static void sys_cache_info(int *isize, int *dsize)
{
/* There's only a single sysctl for both I/D cache line sizes. */
- long size;
+ int size;
size_t len = sizeof(size);
if (!sysctlbyname(SYSCTL_CACHELINE_NAME, &size, &len, NULL, 0)) {
*isize = *dsize = size;
--
2.21.0
next prev parent reply other threads:[~2019-07-02 12:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 12:37 [Qemu-devel] [PULL 0/3] Trivial branch patches Laurent Vivier
2019-07-02 12:37 ` Laurent Vivier [this message]
2019-07-02 12:37 ` [Qemu-devel] [PULL 2/3] VirtIO-RNG: Update default entropy source to `/dev/urandom` Laurent Vivier
2019-07-02 12:37 ` [Qemu-devel] [PULL 3/3] docs/devel/testing: Fix typo in dockerfile path Laurent Vivier
2019-07-02 17:05 ` [Qemu-devel] [PULL 0/3] Trivial branch patches no-reply
2019-07-02 18:05 ` Laurent Vivier
2019-07-03 9:01 ` Philippe Mathieu-Daudé
2019-07-03 14:45 ` Peter Maydell
2019-07-03 15:22 ` Laurent Vivier
2019-07-03 15:26 ` Peter Maydell
2019-07-03 16:12 ` Laurent Vivier
2019-07-03 17:09 ` Justin Hibbits
2019-07-03 18:11 ` Laurent Vivier
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=20190702123713.14396-2-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=amit@kernel.org \
--cc=chmeeedalf@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).