public inbox for kernelnewbies@kernelnewbies.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Wonhyuk Yang <vvghjk1234@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: arm64: Question about barriers with the mmu off
Date: Mon, 16 Nov 2020 22:45:21 -0500	[thread overview]
Message-ID: <218162.1605584721@turing-police> (raw)
In-Reply-To: <CAEcHRTqfaKHy1rky2N1U6idogTWnYEC33-HUV4Uk=bNBQDp1Bg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 655 bytes --]

On Tue, 17 Nov 2020 12:00:32 +0900, Wonhyuk Yang said:
> > If you swap them, you get...
> >
> > dc ivac,x1   // invalidate a cache line that's probably OK
> > str w0,[x1   // and now we do a store that leaves a possibly stale cache line
> >
> > In other words, if you swap them you may leave an un-invalidated
> > stale cache line.
>
> You mean, even if STCLR_EL1.{C, M} is cleared, store doesn't bypass the
> cache?

That's the problem.  The store bypasses the cache line, and the next reference
that uses the cache can get stale data. So you have to flush the cache line
so the next reference has to refresh the cache on the memory read.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2020-11-17  3:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 11:58 arm64: Question about barriers with the mmu off Wonhyuk Yang
2020-11-17  2:14 ` Valdis Klētnieks
2020-11-17  3:00   ` Wonhyuk Yang
2020-11-17  3:45     ` Valdis Klētnieks [this message]
2020-11-17  5:08       ` Wonhyuk Yang
2020-11-17  6:25         ` Valdis Klētnieks
2020-11-18  0:53           ` Wonhyuk Yang

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=218162.1605584721@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=vvghjk1234@gmail.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