re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
,黄韶宇 时间:2017-09-06 23:19:38 主题:Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits On 06/09/17 16:08, gengdongjiu wrote: > It is similar with the PAN,when the guest traps to el2,it will reset the > pstate.PAN <http://pstate.PAN> to 0, and continue run。In fact the host

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread kbuild test robot
Hi gengdongjiu, [auto build test ERROR on arm64/for-next/core] [also build test ERROR on v4.13 next-20170906] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
...@linaro.org,pbonz...@redhat.com,rkrc...@redhat.com,linux-arm-ker...@lists.infradead.org,kvmarm@lists.cs.columbia.edu,k...@vger.kernel.org,linux-kernel,suzuki.poul...@arm.com,mark.rutl...@arm.com,Catalin > Marinas > *抄送:*James Morse,张海斌,黄韶宇 > *时间:*2017-09-06 22:41:09 > *主题:*Re: [P

答复:re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
..@arm.com,Catalin Marinas 抄送:James Morse,张海斌,黄韶宇 时间:2017-09-06 22:41:09 主题:Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits On 06/09/17 15:10, gengdongjiu wrote: > Hi, Vladimir > >>>> Do you see effect of "PAN is unexpectedly enabled"? >>> In fact

re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
nas 抄送:James Morse,张海斌,黄韶宇 时间:2017-09-06 22:41:09 主题:Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits On 06/09/17 15:10, gengdongjiu wrote: > Hi, Vladimir > >>>> Do you see effect of "PAN is unexpectedly enabled"? >>> In fact I did not encounter t

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
On 06/09/17 15:10, gengdongjiu wrote: > Hi, Vladimir > Do you see effect of "PAN is unexpectedly enabled"? >>> In fact I did not encounter this case, but I think it can exist. >>> I think if host OS dynamically disable PAN, it wants the host kernel access >>> the user space address space

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
Hi, Vladimir > >> Do you see effect of "PAN is unexpectedly enabled"? > > In fact I did not encounter this case, but I think it can exist. > > I think if host OS dynamically disable PAN, it wants the host kernel access > > the user space address space not through copy_to/from_user > API. > > Now

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
On 06/09/17 13:44, gengdongjiu wrote: > > > On 2017/9/6 20:30, Vladimir Murzin wrote: >> On 06/09/17 13:14, gengdongjiu wrote: >>> >>> >>> On 2017/9/6 20:00, Vladimir Murzin wrote: On 06/09/17 11:35, gengdongjiu wrote: > Vladimir, > > On 2017/9/6 17:41, Vladimir Murzin wrote:

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
On 2017/9/6 20:30, Vladimir Murzin wrote: > On 06/09/17 13:14, gengdongjiu wrote: >> >> >> On 2017/9/6 20:00, Vladimir Murzin wrote: >>> On 06/09/17 11:35, gengdongjiu wrote: Vladimir, On 2017/9/6 17:41, Vladimir Murzin wrote: > Can you please elaborate on cases where PAN is

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
On 2017/9/6 20:00, Vladimir Murzin wrote: > On 06/09/17 11:35, gengdongjiu wrote: >> Vladimir, >> >> On 2017/9/6 17:41, Vladimir Murzin wrote: >>> Can you please elaborate on cases where PAN is not enabled? >> >> I mean the informal private usage, For example, he disabled the PAN >> dynamically

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
On 06/09/17 13:14, gengdongjiu wrote: > > > On 2017/9/6 20:00, Vladimir Murzin wrote: >> On 06/09/17 11:35, gengdongjiu wrote: >>> Vladimir, >>> >>> On 2017/9/6 17:41, Vladimir Murzin wrote: Can you please elaborate on cases where PAN is not enabled? >>> >>> I mean the informal private

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
On 2017/9/6 20:00, Vladimir Murzin wrote: > On 06/09/17 11:35, gengdongjiu wrote: >> Vladimir, >> >> On 2017/9/6 17:41, Vladimir Murzin wrote: >>> Can you please elaborate on cases where PAN is not enabled? >> >> I mean the informal private usage, For example, he disabled the PAN >> dynamically

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
On 06/09/17 11:35, gengdongjiu wrote: > Vladimir, > > On 2017/9/6 17:41, Vladimir Murzin wrote: >> Can you please elaborate on cases where PAN is not enabled? > > I mean the informal private usage, For example, he disabled the PAN > dynamically to let kernel space to access the user space. >

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
Vladimir, On 2017/9/6 17:41, Vladimir Murzin wrote: > Can you please elaborate on cases where PAN is not enabled? I mean the informal private usage, For example, he disabled the PAN dynamically to let kernel space to access the user space. After he dynamic disabled the PAN, then switched to

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
For UAO, if not save/restore PSTATE.UAO, we can use below fixing. diff --git a/arch/arm64/kvm/hyp/sysreg-sr.c b/arch/arm64/kvm/hyp/sysreg-sr.c index 9341376..c3dd761 100644 --- a/arch/arm64/kvm/hyp/sysreg-sr.c +++ b/arch/arm64/kvm/hyp/sysreg-sr.c @@ -21,6 +21,8 @@ #include #include +#include

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Vladimir Murzin
On 06/09/17 10:32, gengdongjiu wrote: > Hi Marc, > > On 2017/9/6 16:17, Marc Zyngier wrote: >> On 05/09/17 19:58, gengdongjiu wrote: >>> when exit from guest, some host PSTATE bits may be lost, such as >>> PSTATE.PAN or PSTATE.UAO. It is because host and hypervisor all run >>> in the EL2, host

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread gengdongjiu
Hi Marc, On 2017/9/6 16:17, Marc Zyngier wrote: > On 05/09/17 19:58, gengdongjiu wrote: >> when exit from guest, some host PSTATE bits may be lost, such as >> PSTATE.PAN or PSTATE.UAO. It is because host and hypervisor all run >> in the EL2, host PSTATE value cannot be saved and restored via >>

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-06 Thread Marc Zyngier
On 05/09/17 19:58, gengdongjiu wrote: > when exit from guest, some host PSTATE bits may be lost, such as > PSTATE.PAN or PSTATE.UAO. It is because host and hypervisor all run > in the EL2, host PSTATE value cannot be saved and restored via > SPSR_EL2. So if guest has changed the PSTATE, host

Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits

2017-09-05 Thread gengdongjiu
CC Catalin On 2017/9/6 2:58, gengdongjiu wrote: > when exit from guest, some host PSTATE bits may be lost, such as > PSTATE.PAN or PSTATE.UAO. It is because host and hypervisor all run > in the EL2, host PSTATE value cannot be saved and restored via > SPSR_EL2. So if guest has changed the