[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V14 5/7] xen/arm: Instruction prefetch abort (X) mem_access event handling





On Mon, Mar 30, 2015 at 11:41 AM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:
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.

Hm, what I recall is that it is valid for permission faults as well, but only and exclusively during s1ptw.

Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.