public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Fredrik Noring <noring@nocrew.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	linux-mips@vger.kernel.org, "Andreas Jaeger" <aj@suse.de>,
	"Nick Clifton" <nickc@redhat.com>,
	"Jürgen Urban" <JuergenUrban@gmx.de>,
	libc-help@sourceware.org
Subject: Re: [PATCH 002/120] MIPS: R5900: Trap the RDHWR instruction as an SQ address exception
Date: Sat, 12 Dec 2020 13:14:11 +0100	[thread overview]
Message-ID: <X9S0EzYeHmaP0zQl@sx9> (raw)
In-Reply-To: <alpine.LFD.2.21.2012121105280.2104409@eddie.linux-mips.org>

On Sat, Dec 12, 2020 at 11:36:35AM +0000, Maciej W. Rozycki wrote:
>  Unlike TLS pointer access, specifically using $3 as rt, which has been 
> made a part of the Linux ABI, they're not supposed to be referred with 
> pre-R2 code.  After all RDHWR was only introduced with R2.
> 
>  Indeed there's emulation code in the kernel for those encodings even with 
> pre-R2 hardware, but it is not guaranteed to give sensible results, and 
> given the circumstances I'm not sure what it really is for, e.g. what is 
> SYNCI_Step for with processors that do not implement SYNCI?  The cycle 
> counter register may be absent too, so even emulated accesses will return 
> rubbish; gettimeofday(2) is the standard interface.
> 
>  So I think we can safely ignore them, just as we can any ULR access with 
> rt != $3.  Unlike standardised TLS pointer accesses such instructions 
> won't appear in compiler-generated code and whoever uses them in handcoded 
> assembly or otherwise generated machine code will have to make sure they 
> make sense for their application (yes, there's rubbish code out there, 
> e.g. Firefox has a JIT that unconditionally produces MIPS R2 code even if 
> the piece of software has been compiled for an older ISA revision, and 
> having not verified that the CPU it runs on actually supports the R2 ISA, 
> but that's just the usual imperfection of the world; you just can't fix it 
> all).

Many thanks, that resolves it! I'll write it up in the commit message.

Fredrik

  reply	other threads:[~2020-12-12 12:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1567326213.git.noring@nocrew.org>
     [not found] ` <4f856a5ea2c039c6639df875d11b5bff1bf7ecd2.1567326213.git.noring@nocrew.org>
2020-11-19  7:15   ` Philippe Mathieu-Daudé
2020-11-19 13:28     ` Maciej W. Rozycki
2020-11-19 13:42       ` Maciej W. Rozycki
2020-12-12 10:58       ` Fredrik Noring
2020-12-12 11:36         ` Maciej W. Rozycki
2020-12-12 12:14           ` Fredrik Noring [this message]
2020-12-13 11:43           ` Fredrik Noring

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=X9S0EzYeHmaP0zQl@sx9 \
    --to=noring@nocrew.org \
    --cc=JuergenUrban@gmx.de \
    --cc=aj@suse.de \
    --cc=f4bug@amsat.org \
    --cc=libc-help@sourceware.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=nickc@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 read-only IMAP folder(s) and NNTP newsgroup(s).