Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756429AbdIHNfm convert rfc822-to-8bit (ORCPT ); Fri, 8 Sep 2017 09:35:42 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:11766 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756349AbdIHNfh (ORCPT ); Fri, 8 Sep 2017 09:35:37 -0400 From: gengdongjiu To: Marc Zyngier CC: James Morse , "christoffer.dall@linaro.org" , "vladimir.murzin@arm.com" , "rkrcmar@redhat.com" , "catalin.marinas@arm.com" , "shankerd@codeaurora.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Zhanghaibin (Euler)" , Huangshaoyu Subject: Re: [PATCH] arm64: KVM: VHE: reset PSTATE.UAO when switch to host Thread-Topic: [PATCH] arm64: KVM: VHE: reset PSTATE.UAO when switch to host Thread-Index: AdMopfZ77m1HPx6yTSemzwxXMb1VeA== Date: Fri, 8 Sep 2017 13:33:06 +0000 Message-ID: <0184EA26B2509940AA629AE1405DD7F2015F55E9@DGGEMA503-MBX.china.huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.45.61.121] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.59B29C1F.0060,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.143, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1720eb77480ba8b7146f8b211e0a30bf Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 28 Hi Marc, > > On 08/09/17 10:05, gengdongjiu wrote: > > Marc, > > Thanks for reply. > > > > On 2017/9/8 16:21, Marc Zyngier wrote: > >>> Marc, > >>> > >>> sorry I have another question for the PAN. [...] > There cannot be any userspace mapping at EL2 when non-VHE, so there cannot be any valid PAN setting. I repeat: there is not such thing as > PAN at EL2 when HCR_EL2.E2H==0. This bit *has no effect*. Just read the documentation (ARM DDI 0487B.a, D4.4.2). Thanks Marc's comments, I completely agree with you, I understand the architecture, in non-VHE, user space mapping only exists at EL1 and pointed by the ttbr0_el1. In the EL1, it uses ttbr0_el1 to point userspace page table, uses ttbr1_el1 to point kernel mapping. In the EL2, it uses ttbr0_el2 or vttbr_el2 for address translation, cannot use the ttbr0_el1. > > If you're going to change this kind of code, please start by understanding the architecture. OK, so I plant to remove the PAN setting at EL2 in non-VHE. > > M. > -- > Jazz is not dead. It just smells funny...