From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewTkO-0007IA-MW for qemu-devel@nongnu.org; Thu, 15 Mar 2018 10:20:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewTkJ-0004oE-PC for qemu-devel@nongnu.org; Thu, 15 Mar 2018 10:20:48 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:54939) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewTkJ-0004Hb-EJ for qemu-devel@nongnu.org; Thu, 15 Mar 2018 10:20:43 -0400 References: <20180314153121.23838-1-james.cowgill@mips.com> <46dbae6e-4ff6-5003-e8e6-175bf0fbd51f@vivier.eu> <20e6165d-70b2-d1ec-1c46-7ede39a8d816@mips.com> From: James Cowgill Message-ID: <74331770-2eac-4af7-dc4b-b4dc20fbba46@mips.com> Date: Thu, 15 Mar 2018 14:19:18 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] linux-user: implement HWCAP bits on MIPS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Richard Henderson , qemu-devel@nongnu.org, Riku Voipio Hi, On 15/03/18 13:00, Laurent Vivier wrote: > Le 15/03/2018 =C3=A0 11:52, James Cowgill a =C3=A9crit=C2=A0: >> Hi, >> >> On 14/03/18 16:13, Laurent Vivier wrote: >>> Le 14/03/2018 =C3=A0 16:31, James Cowgill a =C3=A9crit=C2=A0: >>>> +enum { >>>> + HWCAP_MIPS_R6 =3D (1 << 0), >>>> + HWCAP_MIPS_MSA =3D (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. >=20 > In fact, in a system, they come with the glibc . auxv.h > includes and . 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 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