All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Tamas K Lengyel <tklengyel@sec.in.tum.de>
Cc: stefano.stabellini@citrix.com, xen-devel@lists.xen.org,
	Julien Grall <julien.grall@linaro.org>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH V13 5/7] xen/arm: Instruction prefetch abort (X) mem_event handling
Date: Mon, 23 Mar 2015 16:22:47 +0000	[thread overview]
Message-ID: <1427127767.21742.290.camel@citrix.com> (raw)
In-Reply-To: <CABfawh=-W0qMDS87+_P=O5w2rUGG9x8xNWYKva83yVrxKJ8=fw@mail.gmail.com>

On Mon, 2015-03-23 at 16:47 +0100, Tamas K Lengyel wrote:
> 
> 
> On Mon, Mar 23, 2015 at 4:18 PM, Ian Campbell
> <ian.campbell@citrix.com> wrote:
>         On Mon, 2015-03-23 at 15:15 +0000, Ian Campbell wrote:
>         > _But_ I suppose you are not really worried about the guest
>         doing a PT
>         > update, but rather xenaccess playing games with the stage 2
>         behind the
>         > guest's back, which might require us to do some TLB
>         shootdowns, and we'd
>         > have to assume both I-TLB and D-TLB since we don't know what
>         the guest
>         > has in those pages.
>         
>         When we change the p2m we do a tlbi vmalle1is, so regardless
>         of whether
>         split tlb is a thing we are flushing everything, so we should
>         be good
>         from a stage 2 PoV.
> 
> 
> When we apply p2m changes we do indeed flush the TLB. I do actually
> worry about a potential malicious in-guest kernel playing tricks with
> its pagetables which may have happened after the p2m changes were
> applied. The xen-access permissions are applied based on IPAs. Say I
> want to be notified when a specific API is being called, so I walk the
> guest-pagestables and set a trap at the page the IPA is one. If the
> malicious guest kernel wants to avoid triggering the xen-access
> notifications, it could theoretically prime its tables and perform the
> right accesses so that the iTLB still has the mapping I wanted to trap
> with xen-access, but the dTLB has a different mapping. The instruction
> abort trap will happen but in Xen I will see the mapping according to
> the dTLB, thus the radix-tree lookup fails and the trap is injected
> back into the guest.

But in that case the guest will take a trap, so what has it gained other
than a spurious trap?

I can't see anything in the TLB chapter of the ARMv8 ARM which suggests
split TLBs are possible in AArch64 mode, and the AArch32 refs look like
backwards compat stuff to me.

The ARMv7 ARM does mention the split, but only to say that the
distinction between the ITLB and DTLB maintenance operations is
deprecated and that modern TLB ops do not support the distinction. It's
not 100% unambiguous about whether split TLBs themselves are allowed in
ARMv7 though, and in particular I'm not sure what impact the addition of
the LPAE and virtualisation extensions will have had on these
requirements. I also can't quite tell if split TLB is allowed on VMSA
systems, or if it is PMSA only.

As you might imagine I'm not keen on adding TLB flushes "just in case",
so I would really like to see some good references to the architecture
specs before adding a flush on this path.

Ian.

  reply	other threads:[~2015-03-23 16:22 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-06 21:24 [PATCH V13 0/7] Mem_access for ARM Tamas K Lengyel
2015-03-06 21:24 ` [PATCH V13 1/7] xen/arm: p2m changes for mem_access support Tamas K Lengyel
2015-03-11 16:07   ` Stefano Stabellini
2015-03-11 17:05     ` Tamas K Lengyel
2015-03-12 11:27   ` Ian Campbell
2015-03-12 12:22     ` Tamas K Lengyel
2015-03-12 13:53       ` Ian Campbell
2015-03-12 12:57   ` Julien Grall
2015-03-12 13:18     ` Tamas K Lengyel
2015-03-12 13:25       ` Julien Grall
2015-03-12 13:55         ` Ian Campbell
2015-03-12 13:56     ` Ian Campbell
2015-03-12 14:10       ` Andrew Cooper
2015-03-12 16:56         ` Julien Grall
2015-03-12 17:11           ` Ian Campbell
2015-03-06 21:24 ` [PATCH V13 2/7] xen/arm: Implement domain_get_maximum_gpfn Tamas K Lengyel
2015-03-11 15:43   ` Stefano Stabellini
2015-03-06 21:24 ` [PATCH V13 3/7] xen/arm: Allow hypervisor access to mem_access protected pages Tamas K Lengyel
2015-03-12 12:08   ` Ian Campbell
2015-03-12 12:31     ` Tamas K Lengyel
2015-03-12 13:24   ` Julien Grall
2015-03-12 13:38     ` Tamas K Lengyel
2015-03-12 13:43       ` Julien Grall
2015-03-12 14:33         ` Tamas K Lengyel
2015-03-12 13:50   ` Julien Grall
2015-03-12 14:13     ` Tamas K Lengyel
2015-03-12 14:52       ` Julien Grall
2015-03-12 15:27         ` Ian Campbell
2015-03-12 15:40           ` Julien Grall
2015-03-12 15:44             ` Tamas K Lengyel
2015-03-12 15:56               ` Ian Campbell
2015-03-12 16:02                 ` Tamas K Lengyel
2015-03-12 16:48                   ` Ian Campbell
2015-03-12 16:55                     ` Tamas K Lengyel
2015-03-12 15:54             ` Ian Campbell
2015-03-12 15:41           ` Tamas K Lengyel
2015-03-12 15:55             ` Ian Campbell
2015-03-12 16:10               ` Tamas K Lengyel
2015-03-06 21:24 ` [PATCH V13 4/7] xen/arm: Data abort exception (R/W) mem_events Tamas K Lengyel
2015-03-12 13:35   ` Ian Campbell
2015-03-12 15:13     ` Tamas K Lengyel
2015-03-12 15:19       ` Tamas K Lengyel
2015-03-12 15:24         ` Julien Grall
2015-03-12 15:35         ` Ian Campbell
2015-03-12 16:35           ` Julien Grall
2015-03-12 15:30       ` Ian Campbell
2015-03-12 15:13   ` Julien Grall
2015-03-12 15:26     ` Tamas K Lengyel
2015-03-12 15:37       ` Julien Grall
2015-03-12 15:46         ` Ian Campbell
2015-03-12 16:54           ` Julien Grall
2015-03-06 21:24 ` [PATCH V13 5/7] xen/arm: Instruction prefetch abort (X) mem_event handling Tamas K Lengyel
2015-03-23 14:32   ` Tamas K Lengyel
2015-03-23 15:15     ` Ian Campbell
2015-03-23 15:18       ` Ian Campbell
2015-03-23 15:47         ` Tamas K Lengyel
2015-03-23 16:22           ` Ian Campbell [this message]
2015-03-23 16:47             ` Tamas K Lengyel
2015-03-24 13:06               ` Tamas K Lengyel
2015-03-26 10:50                 ` Ian Campbell
2015-03-26 11:24                   ` Tamas K Lengyel
2015-03-26 11:53                     ` Ian Campbell
2015-03-06 21:24 ` [PATCH V13 6/7] xen/arm: Enable mem_access on ARM Tamas K Lengyel
2015-03-12 13:36   ` Ian Campbell
2015-03-12 15:19   ` Julien Grall
2015-03-12 15:43     ` Tamas K Lengyel
2015-03-06 21:24 ` [PATCH V13 7/7] tools/libxc: Allocate magic page for mem access " Tamas K Lengyel
2015-03-12 13:36   ` Ian Campbell
2015-03-12 11:30 ` [PATCH V13 0/7] Mem_access for ARM Ian Campbell
2015-03-12 12:24   ` Tamas K Lengyel
2015-03-12 13:53     ` Ian Campbell

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=1427127767.21742.290.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@linaro.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tklengyel@sec.in.tum.de \
    --cc=xen-devel@lists.xen.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 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.