public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Brian Cain <bcain@quicinc.com>
To: Mark Wielaard <mark@klomp.org>,
	"Matheus Bernardino (QUIC)" <quic_mathbern@quicinc.com>,
	"elfutils-devel@sourceware.org" <elfutils-devel@sourceware.org>
Cc: Sid Manning <sidneym@quicinc.com>,
	"Andrew Pinski (QUIC)" <quic_apinski@quicinc.com>
Subject: RE: [PATCH v2 2/2] Hexagon: implement machine flag check
Date: Thu, 4 Apr 2024 16:31:53 +0000	[thread overview]
Message-ID: <CH3PR02MB102473FBCF43CEB7C5717E74CB83C2@CH3PR02MB10247.namprd02.prod.outlook.com> (raw)
In-Reply-To: <4921c496c2f4deee89ccc3527142f046c312efd1.camel@klomp.org>



> -----Original Message-----
> From: Mark Wielaard <mark@klomp.org>
> Sent: Thursday, April 4, 2024 11:29 AM
> To: Brian Cain <bcain@quicinc.com>; Matheus Bernardino (QUIC)
> <quic_mathbern@quicinc.com>; elfutils-devel@sourceware.org
> Cc: Sid Manning <sidneym@quicinc.com>; Andrew Pinski (QUIC)
> <quic_apinski@quicinc.com>
> Subject: Re: [PATCH v2 2/2] Hexagon: implement machine flag check
> 
> WARNING: This email originated from outside of Qualcomm. Please be wary
> of any links or attachments, and do not enable macros.
> 
> Hi,
> 
> On Tue, 2024-04-02 at 21:38 +0000, Brian Cain wrote:
> > > diff --git a/backends/hexagon_symbol.c b/backends/hexagon_symbol.c
> > > index b341243e..1e681e9f 100644
> > > --- a/backends/hexagon_symbol.c
> > > +++ b/backends/hexagon_symbol.c
> > > @@ -56,3 +56,11 @@ hexagon_reloc_simple_type (Ebl *ebl __attribute__
> > > ((unused)), int type,
> > >        return ELF_T_NUM;
> > >      }
> > >  }
> > > +
> > > +bool
> > > +hexagon_machine_flag_check (GElf_Word flags)
> > > +{
> > > +  GElf_Word arch_variant = flags &~ EF_HEXAGON_MACH;
> > > +  /* 0x8000 covers the "tiny core" arch variants. */
> > > +  return arch_variant == 0 || arch_variant == 0x8000;
> > > +}
> > > --
> > > 2.37.2
> >
> > What about this instead?
> >
> > bool hexagon_machine_flag_check(GElf_Word flags) {
> >       GElf_Word reserved_flags = ~(EF_HEXAGON_TINY |
> EF_HEXAGON_MACH);
> >
> >       return (flags & reserved_flags) == 0;
> > }
> >
> > ... implies a new EF_HEXAGON_TINY 0x8000 definition BTW.
> 
> You obviously know this architecture better than me. But is the TINY
> flag (bit 15) appropriate for all machines? It looks like it can only
> be set on V67 and V71. If so maybe just check those two explicitly?

So far, V67T and V71T are the only ones with this variation.  It could also be specified on yet-to-be-created future devices (some theoretical V99T might exist).  What should the behavior be in those cases?

-Brian

  reply	other threads:[~2024-04-04 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 19:55 [PATCH v2 0/2] Add initial support for Hexagon Matheus Tavares Bernardino
2024-04-02 19:55 ` [PATCH v2 1/2] Add " Matheus Tavares Bernardino
2024-04-04 16:51   ` Mark Wielaard
2024-04-02 19:55 ` [PATCH v2 2/2] Hexagon: implement machine flag check Matheus Tavares Bernardino
2024-04-02 21:38   ` Brian Cain
2024-04-04 16:29     ` Mark Wielaard
2024-04-04 16:31       ` Brian Cain [this message]
2024-04-04 16:54         ` Mark Wielaard

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=CH3PR02MB102473FBCF43CEB7C5717E74CB83C2@CH3PR02MB10247.namprd02.prod.outlook.com \
    --to=bcain@quicinc.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    --cc=quic_apinski@quicinc.com \
    --cc=quic_mathbern@quicinc.com \
    --cc=sidneym@quicinc.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 read-only IMAP folder(s) and NNTP newsgroup(s).