From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Julien Grall <julien.grall@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
"andrii.anisov@gmail.com" <andrii.anisov@gmail.com>
Subject: Re: [Xen-devel] [PATCH RFC for-4.13 03/10] xen/arm: traps: Rework entry/exit from the guest path
Date: Fri, 27 Sep 2019 12:49:26 +0000 [thread overview]
Message-ID: <87o8z59a5m.fsf@epam.com> (raw)
In-Reply-To: <9b9b276e-21a0-78b2-1b42-c80a0d8d6353@arm.com>
Julien Grall writes:
> Hi,
>
> On 27/09/2019 13:27, Volodymyr Babchuk wrote:
>>
>> Julien Grall writes:
>>
>>> On 27/09/2019 12:45, Volodymyr Babchuk wrote:
>>>>
>>>> Julien,
>>>
>>> Hi...
>>>
>>>> Julien Grall writes:
>>>>
>>>>> At the moment, enter_hypervisor_head() and leave_hypervisor_tail() are
>>>>> used to deal with actions to be done before/after any guest request is
>>>>> handled.
>>>>>
>>>>> While they are meant to work in pair, the former is called for most of
>>>>> the traps, including traps from the same exception level (i.e.
>>>>> hypervisor) whilst the latter will only be called when returning to the
>>>>> guest.
>>>>>
>>>>> As pointed out, the enter_hypervisor_head() is not called from all the
>>>>> traps, so this makes potentially difficult to extend it for the dealing
>>>>> with same exception level.
>>>>>
>>>>> Furthermore, some assembly only path will require to call
>>>>> enter_hypervisor_tail(). So the function is now directly call by
>>>>> assembly in for guest vector only. This means that the check whether we
>>>>> are called in a guest trap can now be removed.
>>>>>
>>>>> Take the opportunity to rename enter_hypervisor_tail() and
>>>>> leave_hypervisor_tail() to something more meaningful and document them.
>>>>> This should help everyone to understand the purpose of the two
>>>>> functions.
>>>>>
>>>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>>>>
>>>>> ---
>>>>>
>>>>> I haven't done the 32-bits part yet. I wanted to gather feedback before
>>>>> looking in details how to integrate that with Arm32.
>>>> I'm looking at patches one by one and it is looking okay so far.
>>>>
>>>>
>>>>> ---
>>>>> xen/arch/arm/arm64/entry.S | 4 ++-
>>>>> xen/arch/arm/traps.c | 71 ++++++++++++++++++++++------------------------
>>>>> 2 files changed, 37 insertions(+), 38 deletions(-)
>>>>>
>>>>> diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
>>>>> index 40d9f3ec8c..9eafae516b 100644
>>>>> --- a/xen/arch/arm/arm64/entry.S
>>>>> +++ b/xen/arch/arm/arm64/entry.S
>>>>> @@ -147,7 +147,7 @@
>>>>>
>>>>> .if \hyp == 0 /* Guest mode */
>>>>>
>>>>> - bl leave_hypervisor_tail /* Disables interrupts on return */
>>>>> + bl leave_hypervisor_to_guest /* Disables interrupts on return */
>>>>>
>>>>> exit_guest \compat
>>>>>
>>>>> @@ -175,6 +175,8 @@
>>>>> SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT)
>>>>> msr daifclr, \iflags
>>>>> mov x0, sp
>>>> Looks like this mov can be removed (see commend below).
>>>>
>>>>> + bl enter_hypervisor_from_guest
>>>>> + mov x0, sp
>>>>> bl do_trap_\trap
>>>>> 1:
>>>>> exit hyp=0, compat=\compat
>>>>> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
>>>>> index a3b961bd06..20ba34ec91 100644
>>>>> --- a/xen/arch/arm/traps.c
>>>>> +++ b/xen/arch/arm/traps.c
>>>>> @@ -2006,47 +2006,46 @@ static inline bool needs_ssbd_flip(struct vcpu *v)
>>>>> cpu_require_ssbd_mitigation();
>>>>> }
>>>>>
>>>>> -static void enter_hypervisor_head(struct cpu_user_regs *regs)
>>>>> +/*
>>>>> + * Actions that needs to be done after exiting the guest and before any
>>>>> + * request from it is handled.
>>>> Maybe it is me only, but the phrasing is confusing. I had to read it two
>>>> times before I get it. What about "Actions that needs to be done when
>>>> raising exception level"? Or maybe "Actions that needs to be done when
>>>> switching from guest to hypervisor mode" ?
>>>
>>> Is it a suggestion to replace the full sentence or just the first
>>> before (i.e. before 'and')?
>> This is a suggestion for the first part.
>
> How about:
>
> "Actions that needs to be done after entering the hypervisor from the
> guest and before we handle any request."
Sound perfect.
[...]
--
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-09-27 12:49 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 18:37 [Xen-devel] [PATCH RFC for-4.13 00/10] xen/arm: XSA-201 and XSA-263 fixes Julien Grall
2019-09-26 18:37 ` [Xen-devel] [PATCH RFC for-4.13 01/10] xen/arm64: entry: Introduce a macro to generate guest vector and use it Julien Grall
2019-09-27 11:34 ` Volodymyr Babchuk
2019-10-01 19:53 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 02/10] xen/arm64: head: Check if an SError is pending when receiving a vSError Julien Grall
2019-09-27 11:35 ` Volodymyr Babchuk
2019-10-01 19:58 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 03/10] xen/arm: traps: Rework entry/exit from the guest path Julien Grall
2019-09-27 11:45 ` Volodymyr Babchuk
2019-09-27 12:16 ` Julien Grall
2019-09-27 12:27 ` Volodymyr Babchuk
2019-09-27 12:44 ` Julien Grall
2019-09-27 12:49 ` Volodymyr Babchuk [this message]
2019-10-01 20:12 ` Stefano Stabellini
2019-10-01 21:06 ` Julien Grall
2019-10-02 0:16 ` Stefano Stabellini
2019-10-02 9:12 ` Julien Grall
2019-10-02 12:41 ` Stefano Stabellini
2019-10-02 12:47 ` Julien Grall
2019-10-02 22:26 ` Stefano Stabellini
2019-10-03 10:24 ` Julien Grall
2019-10-03 17:48 ` Stefano Stabellini
2019-10-03 17:53 ` Julien Grall
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 04/10] xen/arm: Ensure the SSBD workaround is re-enabled right after exiting a guest Julien Grall
2019-09-27 11:56 ` Volodymyr Babchuk
2019-09-27 12:22 ` Julien Grall
2019-09-27 12:39 ` Volodymyr Babchuk
2019-09-27 13:16 ` Julien Grall
2019-09-27 13:33 ` Volodymyr Babchuk
2019-09-27 14:11 ` Julien Grall
2019-09-27 14:21 ` Volodymyr Babchuk
2019-09-27 16:24 ` Julien Grall
2019-09-27 17:58 ` Volodymyr Babchuk
2019-09-27 20:31 ` Julien Grall
2019-09-30 12:14 ` Volodymyr Babchuk
2019-09-30 12:15 ` Julien Grall
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 05/10] xen/arm: alternative: Remove unused parameter for alternative_if_not_cap Julien Grall
2019-09-27 11:50 ` Volodymyr Babchuk
2019-10-01 20:55 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 06/10] xen/arm: Move ARCH_PATCH_INSN_SIZE out of the header livepatch.h Julien Grall
2019-09-27 11:51 ` Volodymyr Babchuk
2019-09-27 11:59 ` Ross Lagerwall
2019-10-01 20:57 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 07/10] xen/arm: Allow insn.h to be called from assembly Julien Grall
2019-09-27 11:52 ` Volodymyr Babchuk
2019-10-01 21:00 ` Stefano Stabellini
2019-10-21 16:43 ` Julien Grall
2019-10-21 17:23 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 08/10] xen/arm: alternative: add auto-nop infrastructure Julien Grall
2019-09-27 15:34 ` Volodymyr Babchuk
2019-10-01 22:08 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 09/10] xen/arm: asm: Replace use of ALTERNATIVE with alternative_if Julien Grall
2019-09-27 12:11 ` Volodymyr Babchuk
2019-09-27 12:34 ` Julien Grall
2019-09-27 12:46 ` Volodymyr Babchuk
2019-10-01 22:19 ` Stefano Stabellini
2019-10-01 22:44 ` Julien Grall
2019-10-01 22:52 ` Stefano Stabellini
2019-09-26 18:38 ` [Xen-devel] [PATCH RFC for-4.13 10/10] xen/arm64: entry: Ensure the guest state is synced when receiving a vSError Julien Grall
2019-09-27 15:30 ` Volodymyr Babchuk
2019-10-02 0:50 ` Stefano Stabellini
2019-09-27 4:17 ` [Xen-devel] [PATCH RFC for-4.13 00/10] xen/arm: XSA-201 and XSA-263 fixes Jürgen Groß
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=87o8z59a5m.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=andrii.anisov@gmail.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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.