linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] arm64: KVM: honor cacheability attributes on S2 page fault
Date: Wed, 11 Sep 2013 12:25:05 -0700	[thread overview]
Message-ID: <20130911192505.GM9860@cbox> (raw)
In-Reply-To: <CAFEAcA_xWvZa3fizTNPfaH97V02Ktvrn2EPq-UkA2B-YsMnHzQ@mail.gmail.com>

On Wed, Sep 11, 2013 at 07:06:06PM +0100, Peter Maydell wrote:
> On 10 September 2013 10:51, Marc Zyngier <marc.zyngier@arm.com> wrote:
> > Anup Patel recently brought up the fact that when we run a guest
> > with cache disabled, we don't flush the cache to the Point of
> > Coherency, hence possibly missing bits of data that have been
> > written in the cache, but have not reached memory.
> >
> > There are several approaches to this issue:
> > - Using the DC bit when caches are off: this breaks guests assuming
> >   caches off while doing DMA operations. Bootloaders, for example.
> > - Fetch the memory attributes on translation fault, and flush the
> >   cache while handling the fault. This relies on using the PAR_EL1
> >   register to obtain the Stage-1 memory attributes.
> >
> > While this second solution is clearly not ideal (it duplicates what
> > the HW already does to generate HPFAR_EL2), it is more correct than
> > not doing anything.
> 
> Are you confident that extending the current very limited
> set of circumstances where we re-do the address translation
> operation doesn't introduce any new races if the guest
> page tables change between taking the fault and redoing
> the translation? I remember being this a pain to think through
> last time around :-)
> 
I'm worried about the performance penalty hit for any translation fault
here.  I know that ideally locality should reduce the number of times we
do this, but it seems we are introducing logic on a very general path to
ensure correct behavior for something very specific.

I lost track: would we avoid all of this if we just require user space
to flush the dcache after loading code into memory?

-Christoffer

      reply	other threads:[~2013-09-11 19:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  9:51 [RFC PATCH] arm64: KVM: honor cacheability attributes on S2 page fault Marc Zyngier
2013-09-11 12:21 ` Anup Patel
2013-09-11 12:35   ` Marc Zyngier
2013-09-11 19:38     ` Christoffer Dall
2013-10-10  4:51       ` Anup Patel
2013-10-10  8:39         ` Marc Zyngier
2013-10-10 11:24           ` Catalin Marinas
2013-10-10 16:09             ` Anup Patel
2013-10-11 12:38               ` Catalin Marinas
2013-10-11 14:27                 ` Anup Patel
2013-10-11 14:37                   ` Catalin Marinas
2013-10-11 14:50                     ` Anup Patel
2013-10-11 14:59                       ` Marc Zyngier
2013-10-11 15:32                         ` Anup Patel
2013-10-11 15:44                           ` Catalin Marinas
2013-10-12 18:24                             ` Anup Patel
2013-10-15 14:38                               ` Catalin Marinas
2013-10-17  4:19                                 ` Anup Patel
2013-10-17 11:16                                   ` Catalin Marinas
2013-10-19 14:45                                     ` Christoffer Dall
2013-10-20  9:06                                       ` Catalin Marinas
2013-09-11 18:06 ` Peter Maydell
2013-09-11 19:25   ` Christoffer Dall [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=20130911192505.GM9860@cbox \
    --to=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).