From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Dongjiu Geng <gengdongjiu@huawei.com>,
christoffer.dall@linaro.org, marc.zyngier@arm.com,
james.morse@arm.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE
Date: Mon, 11 Sep 2017 12:20:50 +0100 [thread overview]
Message-ID: <652c020f-172f-f022-d23e-3b53375c6aae@arm.com> (raw)
In-Reply-To: <1505128612-13819-1-git-send-email-gengdongjiu@huawei.com>
On 11/09/17 12:16, Dongjiu Geng wrote:
> PSTATE.PAN disables reading and/or writing to a userspace virtual
> address from EL1 in non-VHE or from EL2 in VHE. In non-VHE, there is
> no any userspace mapping at EL2, so no need to reest the PSTATE.PAN.
^^^^^
reset
>
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> Signed-off-by: Haibin Zhang <zhanghaibin7@huawei.com>
> ---
> arch/arm64/kvm/hyp/entry.S | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
> index 12ee62d6d410..86a7549b1b4c 100644
> --- a/arch/arm64/kvm/hyp/entry.S
> +++ b/arch/arm64/kvm/hyp/entry.S
> @@ -96,8 +96,12 @@ ENTRY(__guest_exit)
>
> add x1, x1, #VCPU_CONTEXT
>
> - ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN)
> +alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
> + b 2f // skip PAN at EL2 in non-VHE
> +alternative_else_nop_endif
>
> + ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN)
> +2:
> // Store the guest regs x2 and x3
> stp x2, x3, [x1, #CPU_XREG_OFFSET(2)]
>
>
Ok. Probably I need to say why original patch did not consider non-VHE case:
- VHE and PAN features come within the same v8.1 extension bundle, so it is
unlucky to see IRL implementation with PAN but no VHE.
- Given above the only case where extra PAN instruction could count is
VHE-enabled system with CONFIG_ARM64_VHE is not set; However, IMO, usecase for
such setup is kind of debugging; it is quite obvious that those who care of
performance should not disable VHE in the first place...
Nit:
In general it is not polite to keep posting patches in a middle of the merge
window - people are busy with more important stuff...
Cheers
Vladimir
next prev parent reply other threads:[~2017-09-11 11:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 11:16 Dongjiu Geng
2017-09-11 11:20 ` Vladimir Murzin [this message]
2017-09-11 11:48 ` gengdongjiu
2017-09-12 14:07 ` Marc Zyngier
2017-09-12 14:19 ` Marc Zyngier
2017-09-12 15:32 gengdongjiu
2017-09-12 15:36 gengdongjiu
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=652c020f-172f-f022-d23e-3b53375c6aae@arm.com \
--to=vladimir.murzin@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=gengdongjiu@huawei.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
/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
all inboxes | Powered by JetHome®