All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@nildram.co.uk>
To: peter fuerst <post@pfrst.de>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Kumba <kumba@gentoo.org>,
	linux-mips@linux-mips.org
Subject: Re: [UPDATED PATCH] IP28 support
Date: Sun, 23 Dec 2007 09:39:28 +0000	[thread overview]
Message-ID: <871w9d7nsf.fsf@firetop.home> (raw)
In-Reply-To: <Pine.LNX.4.58.0712230242590.215@Indigo2.Peter> (peter fuerst's message of "Sun\, 23 Dec 2007 02\:44\:01 +0100 \(CET\)")

peter fuerst <post@pfrst.de> writes:
>> compile-time base+offset addresses.  And as I said, the compiler is
>> free to make up accesses that aren't in fact valid for cases where
>> the access isn't made.  E.g. if you had a loop with a stride of 128,
>> the compiler could unroll the loop as many times as it likes.  Some
>> of the unrolled iterations might access areas outside the stack frame.
>
> You mean, the compiler would generate $sp+const_int accesses here, whose
> validity is not known at compile-time - similar to foo() above ?

Right.

>> I think you're missing my point.  If you access an I/O-mapped device
>> through KSEG2 or an uncached XKPHYS address, is it not also physically
>> possible (though clearly unwise) to access it through KSEG0 or a cached
>> XKPHYS address too?  So can you guarantee that every const_int cached
>> address in a multi-platform kernel is not I/O-mapped on any of the r10k
>> platforms?  Or can you guarantee that the compiler will not manufacture
>> such an address from an otherwise harmless address?
> Hmm, it's not quite clear, how it could be manufactured.

Similar to the above really, for combinations of suitably bizarre input
code and compiler behaviour.  Again, the problem isn't that such a thing
is _likely_ to happen, just that it wouldn't be wrong for it to happen in
non-r10k situations (and thus not likely to be treated as a "wrong-code"
bug by gcc developers).

>>                                                     Again, the key thing
>> is to think about what the compiler can validly do on non-r10k platforms,
>> however silly it might seem, and then make sure the workarounds cope
>> with it.
>
> Do you think of accesses that essentially look like this ?
>
>   if (machine_x)
>      *uncached(const_addr) = val;
>   else
>      *cached(const_addr) = val;

Well, more generally, I was thinking of something like:


    if (machine_x)
      *cached(const_addr1) = ...;
    else
      ...blah...

where const_addr1 might be harmful if !machine_x.

> Fortunately (at least? even?) on IP28 cached access (hence a block read
> request) to an I/O-device address is a non-issue. In this respect the
> hardware design seems to follow the recommendations from the R10000 manual
> (NACK from external agent?):
> - if such an access graduates (i.e. a "real" access), a bus-error will occur.
> - if not (i.e. mis-speculated), nothing happens.

Ah, OK.  That's what I was missing, thanks.  (I suspect you and Ralf
have explained that to me before, but it hadn't sunk in.  Sorry!)

> However, i don't yet know, how O2 behaves, or, if there exists any other
> R10k-machine, which would need the software-workaround.

OK.

In that case, for the IP28 at least, I think the only issue with excluding
cachable const_int addresses is that the compiler might somehow conspire to
create an address that turns out to be, for some runs at least, an address
in a DMA buffer.

> Well, the option spec could be as listed above. With "store" as default
> for an empty option-string ("none" as default if the option isn't given
> at all).

Sounds good.

Thanks, it seems we have a plan ;)

Richard

  reply	other threads:[~2007-12-23  9:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-23  1:44 [UPDATED PATCH] IP28 support peter fuerst
2007-12-23  9:39 ` Richard Sandiford [this message]
2007-12-24  0:39   ` post
2008-01-16 19:32   ` peter fuerst
2008-01-19 14:14     ` Richard Sandiford
2008-01-19 23:56       ` post
  -- strict thread matches above, loose matches on Subject: below --
2007-12-02 12:00 Thomas Bogendoerfer
2007-11-29  9:54 Thomas Bogendoerfer
2007-11-29 13:01 ` Ralf Baechle
2007-12-05  6:16   ` Kumba
2007-12-05  9:39     ` Thomas Bogendoerfer
2007-12-05 19:49       ` peter fuerst
2007-12-05 20:37         ` David Daney
2007-12-06 11:44           ` Ralf Baechle
2007-12-06 11:41         ` Ralf Baechle
2007-12-08 17:52       ` Richard Sandiford
2007-12-08 17:52         ` Richard Sandiford
2007-12-08 19:24         ` Ralf Baechle
2007-12-08 20:09           ` Richard Sandiford
2007-12-08 21:25             ` peter fuerst
2007-12-08 23:24               ` Richard Sandiford
2007-12-09  4:38             ` Ralf Baechle
2007-12-10 11:00               ` Richard Sandiford
2007-12-12 15:26                 ` peter fuerst
2007-12-12 18:09                   ` Richard Sandiford
2007-12-12 18:22                     ` Richard Sandiford

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=871w9d7nsf.fsf@firetop.home \
    --to=rsandifo@nildram.co.uk \
    --cc=kumba@gentoo.org \
    --cc=linux-mips@linux-mips.org \
    --cc=post@pfrst.de \
    --cc=ralf@linux-mips.org \
    --cc=tsbogend@alpha.franken.de \
    /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.