From: Julien Grall <julien.grall@arm.com>
To: Andre Przywara <andre.przywara@arm.com>, xen-devel@lists.xen.org
Cc: andrew.cooper3@citrix.com, sstabellini@kernel.org
Subject: Re: [PATCH v3 1/4] xen/arm: traps: Merge try_handle_mmio() and handle_mmio()
Date: Fri, 2 Feb 2018 14:47:05 +0000 [thread overview]
Message-ID: <23e7c00b-ad33-2f6a-b39c-343da9b46df4@arm.com> (raw)
In-Reply-To: <1841ec57-54a4-42e8-a755-b5be02999310@arm.com>
On 02/02/18 14:34, Andre Przywara wrote:
> Hi,
Hi,
> On 02/02/18 10:14, Julien Grall wrote:
>> At the moment, try_handle_mmio() will do check on the HSR and bail out
>> if one check fail. This means that another method will be tried to
>> handle the fault even for bad access on emulated region. While this
>> should not be an issue, this is not future proof.
>>
>> Move the checks of try_handle_mmio() in handle_mmio() after we identified
>> the fault to target an emulated MMIO. While this does not fix the potential
>> fall-through, a follow-up patch will do by distinguish the potential error.
>>
>> Note that the handle_mmio() was renamed to try_handle_mmio() and the
>> prototype adapted.
>
> Why is that? I think the prefix "try_" only makes sense if you have a
> non-try version as well. To some degree most functions "try" something,
> when they check for and return errors.
> I think the return type makes it clear what the semantics are.
> So personally I would prefer just "handle_mmio" as the function name.
Because we have another function called try_map_mmio() just below, so I
wanted to keep similar.
Also, I think "try_" makes sense here because if you don't succeed, you
will fallback to another method. Most of the times, this is not the case
of other functions.
>
> But this only a nit, definitely not worth a respin on its own.
>
>> While merging the 2 functions, remove the check whether the fault is
>> stage-2 abort on stage-1 translation walk because the instruction
>> syndrome will always be invalid (see B3-1433 in DDI 0406C.c and
>> D10-2460 in DDI 0487C.a).
>
> Yes, that looks correct to me.
>
>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Thanks!
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-02 14:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 10:14 [PATCH v3 0/4] xen/arm: Inject an exception to the guest rather than crashing it Julien Grall
2018-02-02 10:14 ` [PATCH v3 1/4] xen/arm: traps: Merge try_handle_mmio() and handle_mmio() Julien Grall
2018-02-02 14:34 ` Andre Przywara
2018-02-02 14:47 ` Julien Grall [this message]
2018-02-02 15:15 ` Andre Przywara
2018-02-02 10:14 ` [PATCH v3 2/4] xen/arm: io: Distinguish unhandled IO from aborted one Julien Grall
2018-02-02 14:34 ` Andre Przywara
2018-02-02 14:48 ` Julien Grall
2018-02-02 10:14 ` [PATCH v3 3/4] xen/arm: Don't crash domain on bad MMIO emulation Julien Grall
2018-02-02 14:35 ` Andre Przywara
2018-02-02 10:14 ` [PATCH v3 4/4] xen/arm: Don't crash the domain on invalid HVC immediate Julien Grall
2018-02-02 14:37 ` Andre Przywara
2018-02-02 14:59 ` Julien Grall
2018-02-02 22:48 ` [PATCH v3 0/4] xen/arm: Inject an exception to the guest rather than crashing it Stefano Stabellini
2018-02-02 23:10 ` Julien Grall
2018-02-05 9:54 ` Andre Przywara
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=23e7c00b-ad33-2f6a-b39c-343da9b46df4@arm.com \
--to=julien.grall@arm.com \
--cc=andre.przywara@arm.com \
--cc=andrew.cooper3@citrix.com \
--cc=sstabellini@kernel.org \
--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 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).