qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, Riku Voipio <riku.voipio@iki.fi>,
	Cornelia Huck <cohuck@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Laurent Vivier <laurent@vivier.eu>,
	qemu-s390x@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1] linux-user: elf: ELF_HWCAP for s390x
Date: Tue, 4 Jun 2019 15:27:55 +0200	[thread overview]
Message-ID: <57d0f110-07b4-76d2-9c71-eb40e7754c88@redhat.com> (raw)
In-Reply-To: <a48caa15-dafa-2f03-9fd2-769adf613ed2@twiddle.net>

On 04.06.19 15:00, Richard Henderson wrote:
> On 6/4/19 4:36 AM, David Hildenbrand wrote:
>> +    if (s390_has_feat(S390_FEAT_ESAN3)) {
>> +        hwcap |= HWCAP_S390_ESAN3;
>> +    }
>> +    if (s390_has_feat(S390_FEAT_ZARCH)) {
>> +        hwcap |= HWCAP_S390_ZARCH;
>> +    }
> 
> While it's nice and symetrical testing these two features, I don't think they
> can ever be false.
> 
>> +    if (s390_has_feat(S390_FEAT_STFLE)) {
>> +        hwcap |= HWCAP_S390_STFLE;
>> +    }
>> +    if (s390_has_feat(S390_FEAT_MSA)) {
>> +        hwcap |= HWCAP_S390_MSA;
>> +    }
>> +    if (s390_has_feat(S390_FEAT_LONG_DISPLACEMENT)) {
>> +        hwcap |= HWCAP_S390_LDISP;
>> +    }
>> +    if (s390_has_feat(S390_FEAT_EXTENDED_IMMEDIATE)) {
>> +        hwcap |= HWCAP_S390_EIMM;
>> +    }
>> +    if (s390_has_feat(S390_FEAT_EXTENDED_TRANSLATION_3) &&
>> +        s390_has_feat(S390_FEAT_ETF3_ENH)) {
>> +        hwcap |= HWCAP_S390_ETF3EH;
>> +    }
>> +    /* 31-bit processes can use 64-bit registers */
>> +    hwcap |= HWCAP_S390_HIGH_GPRS;
> 
> And certainly this could never be set unless ZARCH, otherwise you have no
> 64-bit registers.  ;-)
> 
> So maybe clearer to just start with
> 
>   hwcap = HWCAP_S390_ESAN3 | HWCAP_S390_ZARCH | HWCAP_S390_HIGH_GPRS;

Makes sense, and fits into a single line ;)

Thanks!

> 
> and continue from there.
> 
> Otherwise,
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> 
> r~
> 


-- 

Thanks,

David / dhildenb


      reply	other threads:[~2019-06-04 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04  9:36 [Qemu-devel] [PATCH v1] linux-user: elf: ELF_HWCAP for s390x David Hildenbrand
2019-06-04 12:54 ` Laurent Vivier
2019-06-04 13:28   ` David Hildenbrand
2019-06-04 13:00 ` Richard Henderson
2019-06-04 13:27   ` David Hildenbrand [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=57d0f110-07b4-76d2-9c71-eb40e7754c88@redhat.com \
    --to=david@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).