qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Brad Smith <brad@comstyle.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD
Date: Mon, 29 Jul 2024 11:37:32 +0200	[thread overview]
Message-ID: <61229356-940e-41f2-9b7c-0d1642c6415c@linaro.org> (raw)
In-Reply-To: <ZqXB_zz0fR1CpA7k@humpty.home.comstyle.com>

Hi Brad,

On 28/7/24 05:58, Brad Smith wrote:
> util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD
> 
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
>   meson.build            | 8 ++++++++
>   util/cpuinfo-aarch64.c | 9 ++++++---
>   util/cpuinfo-ppc.c     | 5 +++--
>   util/getauxval.c       | 2 +-
>   4 files changed, 18 insertions(+), 6 deletions(-)


> diff --git a/util/cpuinfo-ppc.c b/util/cpuinfo-ppc.c
> index 1304f9aa80..ccfcaa0754 100644
> --- a/util/cpuinfo-ppc.c
> +++ b/util/cpuinfo-ppc.c
> @@ -14,7 +14,8 @@
>   #  include "elf.h"
>   # endif
>   #endif
> -#ifdef __FreeBSD__
> +#if defined(CONFIG_ELF_AUX_INFO)
> +# include <sys/auxv.h>
>   # include <machine/cpu.h>
>   # ifndef PPC_FEATURE2_ARCH_3_1
>   #  define PPC_FEATURE2_ARCH_3_1   0
> @@ -35,7 +36,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(void)
>   
>       info = CPUINFO_ALWAYS;
>   
> -#if defined(CONFIG_LINUX) || defined(__FreeBSD__)
> +#if defined(CONFIG_LINUX) || deinfed(CONFIG_ELF_AUX_INFO)

Typo!

>       unsigned long hwcap = qemu_getauxval(AT_HWCAP);
>       unsigned long hwcap2 = qemu_getauxval(AT_HWCAP2);
>   
> diff --git a/util/getauxval.c b/util/getauxval.c
> index b124107d61..5bdbb04f8f 100644
> --- a/util/getauxval.c
> +++ b/util/getauxval.c
> @@ -98,7 +98,7 @@ unsigned long qemu_getauxval(unsigned long type)
>       return 0;
>   }
>   
> -#elif defined(__FreeBSD__)
> +#elif deinfed(CONFIG_ELF_AUX_INFO)

Same typo, has this patch been tested?

>   #include <sys/auxv.h>
>   
>   unsigned long qemu_getauxval(unsigned long type)

Except typos, code LGTM, so:

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



      parent reply	other threads:[~2024-07-29  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28  3:58 [PATCH] util/cpuinfo: Make use of elf_aux_info(3) on OpenBSD Brad Smith
2024-07-28  4:46 ` Richard Henderson
2024-07-29  0:28 ` Richard Henderson
2024-07-29  9:37 ` Philippe Mathieu-Daudé [this message]

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=61229356-940e-41f2-9b7c-0d1642c6415c@linaro.org \
    --to=philmd@linaro.org \
    --cc=brad@comstyle.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).