qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Justin Hibbits <chmeeedalf@gmail.com>
To: Laurent Vivier <laurent@vivier.eu>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>,
	Michael Tokarev <mjt@tls.msk.ru>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PULL 0/3] Trivial branch patches
Date: Wed, 3 Jul 2019 12:09:06 -0500	[thread overview]
Message-ID: <20190703120906.00a6976e@titan.knownspace> (raw)
In-Reply-To: <EBA933C4-69B4-43BF-9049-FF1E6A327429@vivier.eu>

On Wed, 3 Jul 2019 18:12:51 +0200
Laurent Vivier <laurent@vivier.eu> wrote:

> > Le 3 juil. 2019 à 17:22, Laurent Vivier <laurent@vivier.eu> a
> > écrit :
> > 
> > Le 03/07/2019 à 16:45, Peter Maydell a écrit :  
> >> On Tue, 2 Jul 2019 at 13:39, Laurent Vivier <laurent@vivier.eu>
> >> wrote:  
> >>> 
> >>> The following changes since commit
> >>> 7d0e02405fc02a181319b1ab8681d2f72246b7c6:
> >>> 
> >>>  Merge remote-tracking branch
> >>> 'remotes/vivier2/tags/trivial-patches-pull-request' into staging
> >>> (2019-07-01 17:40:32 +0100)
> >>> 
> >>> are available in the Git repository at:
> >>> 
> >>>  git://github.com/vivier/qemu.git tags/trivial-branch-pull-request
> >>> 
> >>> for you to fetch changes up to
> >>> 7c955080d40ccc7952a0479bc160f2b048c0af53:
> >>> 
> >>>  docs/devel/testing: Fix typo in dockerfile path (2019-07-02
> >>> 10:12:32 +0200)
> >>> 
> >>> ----------------------------------------------------------------
> >>> Fix typo, fix sys_cache_info() on FreeBSD/powerpc,
> >>> change virtio-rng default to urandom
> >>> 
> >>> ----------------------------------------------------------------  
> >> 
> >> Hi; this makes 'make check' fail on OSX:
> >> 
> >> MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}
> >> tests/test-char -m=quick -k --tap < /dev/null |
> >> ./scripts/tap-driver.pl --test-name="test-char"
> >> Assertion failed: ((isize & (isize - 1)) == 0), function
> >> init_cache_info, file
> >> /Users/pm215/src/qemu-for-merges/util/cacheinfo.c, line 179.
> >> 
> >> I guess this is the sys_cache_info change.  
> > 
> > OK, I will try to reproduce the problem.
> > 
> > I think before this patch (regarding the kind of change we have
> > introduced) isize and dsize were always set to 0 and then changed
> > to 16 in fallback_cache_info()... or perhaps MacOS X sysctlbyname()
> > needs a long.  
> 
> It seems MacOS X (x86_64) needs a long:
> 
> #include <stdio.h>
> #include <sys/types.h>
> #include <sys/sysctl.h>
> 
> int main(void)
> {
>         long size;
>         int ret;
>         size_t len = sizeof(size);
>         ret = sysctlbyname("hw.cachelinesize", &size, &len, NULL, 0);
>         printf("ret %d size 0x%lx\n", ret, size);
>         return 0;
> }
> $ cc -o cachesize cachesize.c
> $ ./cachesize 
> ret 0 size 0x40
> 
> #include <stdio.h>
> #include <sys/types.h>
> #include <sys/sysctl.h>
> 
> int main(void)
> {
>         int size;
>         int ret;
>         size_t len = sizeof(size);
>         ret = sysctlbyname("hw.cachelinesize", &size, &len, NULL, 0);
>         printf("ret %d size 0x%x\n", ret, size);
>         return 0;
> }
> $ cc -o cachesize cachesize.c
> $ ./cachesize 
> ret 0 size 0x1737b1d2
> $ sysctl hw.cachelinesize
> hw.cachelinesize: 64
> 
> But man page is not up-to-date:
> 
> $ uname -r
> 17.7.0
> $ man sysctl
> SYSCTL(8)                 BSD System Manager's Manual
> SYSCTL(8) …
>      The string and integer information is summarized below.  For a
> detailed description of these variable see sysctl(3).
> 
>      The changeable column indicates whether a process with
> appropriate privi- lege can change the value.  String and integer
> values can be set using sysctl.
> 
>      Name                                        Type
> Changeable …
>      hw.cachelinesize                            integer       no
> …
> 
> In fact, it is in sysctl(3):
> 
> SYSCTL(3)                BSD Library Functions Manual
> SYSCTL(3) …
>    CTL_HW
>      The string and integer information available for the CTL_HW
> level is detailed below.  The changeable column shows whether a
> process with appropriate privilege may change the value.
> 
>            Name                         Type          Changeable
> ...
>            hw.cachelinesize             int64_t       no
> 
> I will try to check on MacOS/X ppc and ppc64.
> 
> Thanks,
> Laurent
> 

It's not listed in the man page for ppc(64), but examining the XNU
source for the version that matches 10.5.8 (last ppc-supporting kernel)
it's a CTLTYPE_INT.  So, it may be different depending on arch and/or
OS X version.  Does QEmu even support 10.5.x or Mac OS/ppc* anymore?  I
had read somewhere that it was unsupported now (2.4.x is the latest one
in Tigerbrew).

- Justin


  reply	other threads:[~2019-07-03 17:11 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 ` [Qemu-devel] [PULL 1/3] Fix cacheline detection on FreeBSD/powerpc Laurent Vivier
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 [this message]
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=20190703120906.00a6976e@titan.knownspace \
    --to=chmeeedalf@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=peter.maydell@linaro.org \
    --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).