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: "wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Julien Grall <julien.grall@linaro.org>, Tim Deegan <tim@xen.org>,
	Xen-devel <xen-devel@lists.xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling
Date: Mon, 30 Mar 2015 10:41:22 +0100	[thread overview]
Message-ID: <1427708482.13935.252.camel@citrix.com> (raw)
In-Reply-To: <CABfawhmLSz-sC4-dUFgsaVvJewPrw-Rt-e-8uDsmhZLb-qhjiw@mail.gmail.com>

On Fri, 2015-03-27 at 22:18 +0000, Tamas K Lengyel wrote:

>         
>         >                                        union hsr hsr)
>         >  {
>         > -    register_t addr = READ_SYSREG(FAR_EL2);
>         > -    inject_iabt_exception(regs, addr, hsr.len);
>         > +    struct hsr_iabt iabt = hsr.iabt;
>         > +    int rc;
>         > +    paddr_t gpa;
>         > +    register_t gva = READ_SYSREG(FAR_EL2);
>         > +
>         > +    if ( iabt.s1ptw )
>         > +        gpa = READ_SYSREG(HPFAR_EL2);
>         > +    else
>         
>         
>         Can you not avoid the else case entirely by extending the if to cover
>         the other cases where HPFAR is explicitly valid? I can't be bothered to
>         go look right now but IIRC it included at least stage 2 access
>         permissions related failures, which would cover more xenaccess
>         scenarios, no?
> 
> 
> Depending on the fault cause, we might. For permission faults, HPFAR
> is only valid during s1ptw.. Given that the only check we do is for
> permission faults and that's the only thing that cares about the API
> anyway, we can put this entire block into the switch itself once the
> fault check is already determined to be a permission fault.

According to ARMv8 ARM HPFAR is valid for any of these:
      * A Translation or Access Flag fault on a stage 2 translation.
      * A stage 2 Address Size fault.
      * A fault on the stage 2 translation of an address accessed in a
        stage 1 translation table walk.

I think what you are (correctly) saying is that it omits "a permission
fault on a stage 2 translation", which is one of the cases which can
occur under xenaccess. Which is shame :-(

Ian.

  reply	other threads:[~2015-03-30  9:41 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 22:05 [PATCH V14 0/7] Mem_access for ARM Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 1/7] xen/arm: groundwork for mem_access support on ARM Tamas K Lengyel
2015-04-15 13:39   ` Ian Campbell
2015-03-26 22:05 ` [PATCH V14 2/7] xen/arm: Implement domain_get_maximum_gpfn Tamas K Lengyel
2015-04-08 13:23   ` Julien Grall
2015-04-08 13:38     ` Tamas K Lengyel
2015-04-08 13:42       ` Julien Grall
2015-04-08 13:47         ` Tamas K Lengyel
2015-04-08 13:49           ` Julien Grall
2015-03-26 22:05 ` [PATCH V14 3/7] xen/arm: Allow hypervisor access to mem_access protected pages Tamas K Lengyel
2015-04-08 14:33   ` Julien Grall
2015-04-08 15:57     ` Tamas K Lengyel
2015-04-08 16:07       ` Julien Grall
2015-04-15 13:48   ` Ian Campbell
2015-04-15 15:36     ` Tamas K Lengyel
2015-04-15 15:45       ` Ian Campbell
2015-04-16  9:04         ` Tim Deegan
2015-03-26 22:05 ` [PATCH V14 4/7] xen/arm: Data abort exception (R/W) mem_access events Tamas K Lengyel
2015-04-08 15:26   ` Julien Grall
2015-04-08 15:45     ` Tamas K Lengyel
2015-04-15 13:53   ` Ian Campbell
2015-03-26 22:05 ` [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling Tamas K Lengyel
2015-03-26 23:21   ` Julien Grall
2015-03-27  8:32     ` Tamas K Lengyel
2015-03-27 12:21       ` Julien Grall
2015-03-27 15:52   ` Ian Campbell
2015-03-27 22:18     ` Tamas K Lengyel
2015-03-30  9:41       ` Ian Campbell [this message]
2015-03-30 15:14         ` Tamas K Lengyel
2015-03-30 15:24           ` Ian Campbell
2015-03-30 15:28             ` Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 6/7] xen/arm: Enable mem_access on ARM Tamas K Lengyel
2015-03-26 22:05 ` [PATCH V14 7/7] tools/libxc: Allocate magic page for mem access " Tamas K Lengyel
2015-04-15 13:36 ` [PATCH V14 0/7] Mem_access for ARM Ian Campbell
2015-04-15 14:47   ` Tamas K Lengyel
2015-04-15 15:04     ` 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=1427708482.13935.252.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@linaro.org \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=tklengyel@sec.in.tum.de \
    --cc=wei.liu2@citrix.com \
    --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.