All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Cowgill <james.cowgill@mips.com>
To: Laurent Vivier <laurent@vivier.eu>
Cc: Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, Riku Voipio <riku.voipio@iki.fi>
Subject: Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS
Date: Thu, 15 Mar 2018 14:19:18 +0000	[thread overview]
Message-ID: <74331770-2eac-4af7-dc4b-b4dc20fbba46@mips.com> (raw)
In-Reply-To: <fbbc625b-1bcc-ab60-8998-b2b1653105fd@vivier.eu>

Hi,

On 15/03/18 13:00, Laurent Vivier wrote:
> Le 15/03/2018 à 11:52, James Cowgill a écrit :
>> Hi,
>>
>> On 14/03/18 16:13, Laurent Vivier wrote:
>>> Le 14/03/2018 à 16:31, James Cowgill a écrit :
>>>> +enum {
>>>> +    HWCAP_MIPS_R6           = (1 << 0),
>>>> +    HWCAP_MIPS_MSA          = (1 << 1),
>>>> +};
>>>
>>> We have this for ARM only in elfload.c since:
>>>
>>>     afce2927aa Arm AT_HWCAP AUXV entry (Paul Brook) [2005]
>>>
>>> but they have been added in include/elf.h since:
>>>
>>>     41d9ea80ac tcg-arm: Use qemu_getauxval [Richard Henderson, 2013]
>>>
>>> and I think we should remove them (they are prefixed by ARM_)
>>>
>>> So the MIPS ones should be in include/elf.h (with the #define form).
>>
>> I can do that, although I think it's a bit unusual. The HWCAP bits are
>> specific to the Linux kernel and not to "the MIPS ELF format" so it
>> doesn't make sense to me to put them in elf.h.
> 
> In fact, in a system, they come with the glibc <sys/auxv.h>. auxv.h
> includes <elf.h> and <bits/hwcap.h>. They are both part of glibc.

None of the headers you mention contain hwcap bits. They are usually
provided in an arch specific kernel header - on MIPS they are in
<asm/hwcap.h> which must be included separately.

> They can be used with qemu_getauxval() so it's better to have them in a
> header file. elfoad.c or elf.h, it's in both cases an ELF file.

I agree with that.

I tried to move them to elf.h but hit a slight problem. In elfload.c,
elf.h is included after all the target specific stuff so the
get_elf_hwcap function cannot use anything from elf.h. I think this has
lead to all architectures replicating the list of hwcap bits in both
elf.h and elfload.c. You mentioned arm before, but I can also see
aarch64, powerpc and sh4 do this. Some of these architectures also have
their bits (with different constant names) in elf.h and some do not.

James

  reply	other threads:[~2018-03-15 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 15:31 [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS James Cowgill
2018-03-14 15:38 ` no-reply
2018-03-14 16:13 ` Laurent Vivier
2018-03-15 10:52   ` James Cowgill
2018-03-15 13:00     ` Laurent Vivier
2018-03-15 14:19       ` James Cowgill [this message]
2018-03-15 14:35         ` Laurent Vivier
2018-03-15 15:13 ` [Qemu-devel] [PATCH v2] " James Cowgill
2018-03-15 15:19   ` no-reply
2018-03-15 15:25   ` Laurent Vivier
2018-04-10 13:53     ` Peter Maydell
2018-04-10 15:34       ` Laurent Vivier
  -- strict thread matches above, loose matches on Subject: below --
2018-03-14 14:20 [Qemu-devel] [PATCH] " James Cowgill
2018-03-14 15:32 ` no-reply

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=74331770-2eac-4af7-dc4b-b4dc20fbba46@mips.com \
    --to=james.cowgill@mips.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.