Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: gengdongjiu <gengdongjiu@huawei.com>
To: Marc Zyngier <marc.zyngier@arm.com>, James Morse <james.morse@arm.com>
Cc: "christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
	"vladimir.murzin@arm.com" <vladimir.murzin@arm.com>,
	"rkrcmar@redhat.com" <rkrcmar@redhat.com>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"shankerd@codeaurora.org" <shankerd@codeaurora.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Zhanghaibin (Euler)" <zhanghaibin7@huawei.com>,
	Huangshaoyu <huangshaoyu@huawei.com>
Subject: Re: [PATCH] arm64: KVM: VHE: reset PSTATE.UAO when switch to host
Date: Fri, 8 Sep 2017 15:19:21 +0800	[thread overview]
Message-ID: <1bcd0c1e-c3b5-aac4-bb4f-83ee14b1d1ab@huawei.com> (raw)
In-Reply-To: <d01b49a2-e204-73af-23e3-5fd7f7202859@arm.com>



On 2017/9/7 23:23, Marc Zyngier wrote:
> On 07/09/17 16:03, gengdongjiu wrote:
>>> On 07/09/17 12:49, gengdongjiu wrote:
>>>>
[...]

> 
> I really cannot think of a good reason why we'd want to do that. Playing
> with set_fs() is almost universally wrong, and I'm certainly going to
> oppose to any change in that area unless the code that calls set_fs()
> has been made public and properly reviewed. Until then, UAO/PAN will
> stay as they are unless you prove that our current code is wrong.

Marc,

sorry I have another question for the PAN.

In the non-VHE mode, The host kernel is running in the EL1. Before host kernel enter guest, host OS will call 'HVC' instruction to do the world-switch,
and the pstate.PAN will be saved into the SPSR_EL2. When world-switch back to host kernel from EL2, it will call 'eret' instruction to EL1 host,
this 'eret' instruction will restore the SPSR_EL2 to the PSTATE. so the PSTATE.PAN will be restored.

For the Non-VHE mode, in the EL2 where mainly have word-switch code, do you think it needs to reset the PSTATE.PAN? From the spec, it does not provide SCTLR_EL2.SPAN bit for non-VHE mode,
so reset the PSTATE.PAN does not sure whether it is needed or whether affects the performance. If you think it is needed for El2 in Non-VHE mode, moving the reset PSTATE.PAN to
the exception entry to EL2 may be better, such as "el1_sync", because host can also call 'hvc' instruction without guest running.

> 
> 	M.
> 

  reply	other threads:[~2017-09-08  7:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 15:03 [PATCH] arm64: KVM: VHE: reset PSTATE.UAO when switch to host gengdongjiu
2017-09-07 15:23 ` Marc Zyngier
2017-09-08  7:19   ` gengdongjiu [this message]
2017-09-08  8:21     ` Marc Zyngier
2017-09-08  9:05       ` gengdongjiu
2017-09-08 12:10         ` Marc Zyngier
  -- strict thread matches above, loose matches on Subject: below --
2017-09-08 13:33 gengdongjiu
2017-09-07  5:54 Dongjiu Geng
2017-09-07  9:20 ` James Morse
2017-09-07 10:05   ` gengdongjiu
2017-09-07 10:13     ` Marc Zyngier
2017-09-07 11:49       ` gengdongjiu
2017-09-07 12:00         ` Marc Zyngier

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=1bcd0c1e-c3b5-aac4-bb4f-83ee14b1d1ab@huawei.com \
    --to=gengdongjiu@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=huangshaoyu@huawei.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=rkrcmar@redhat.com \
    --cc=shankerd@codeaurora.org \
    --cc=vladimir.murzin@arm.com \
    --cc=zhanghaibin7@huawei.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