Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932145AbdIFNAw (ORCPT ); Wed, 6 Sep 2017 09:00:52 -0400 Received: from foss.arm.com ([217.140.101.70]:50570 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754147AbdIFNAd (ORCPT ); Wed, 6 Sep 2017 09:00:33 -0400 Subject: Re: [PATCH] arm64: KVM: VHE: save and restore some PSTATE bits To: gengdongjiu , Marc Zyngier , "christoffer.dall@linaro.org" , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "suzuki.poulose@arm.com" , mark.rutland@arm.com, catalin.marinas@arm.com References: <0184EA26B2509940AA629AE1405DD7F2015DF717@DGGEMA503-MBX.china.huawei.com> <2a5d4299-2523-aef5-7db1-f351ca66b562@arm.com> <981d7334-8841-d3e3-0833-1aa061bf97a2@arm.com> <62860a85-c29c-87bb-24b7-c6e5ac6065f9@huawei.com> <31b18967-c32a-1761-7e60-15c0de28203c@arm.com> <57ba125f-9c3c-3504-35a6-9800a47450cf@huawei.com> <11e22405-1214-3dee-e2d2-f1e10340d0e4@huawei.com> Cc: James Morse , zhanghaibin7@huawei.com, Huangshaoyu From: Vladimir Murzin Message-ID: Date: Wed, 6 Sep 2017 14:00:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <11e22405-1214-3dee-e2d2-f1e10340d0e4@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 61 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: >>>>>> 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 guest OS. after return to host. he found the PAN stage is modified. >>>>> Of cause this is not a formal usage, in our host kernel, it is always enabled, no dynamic change, but I means it may exist such cases. >>>>> >>>>> >>>> >>>> So, in short, there is no real issue with PAN, right? What about UAO? >>> For the PAN, if host OS dynamically enable/disable PAN should have issue. >>> Do you think that is not a issue as above description? >>> >>> "host OS dynamically disable the PAN, but after go back from the guest OS, The PAN is unexpectedly enabled" >> >> 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 if it is unexpectedly enabled, when host kernel still accesses the user space address, it will happen MMU fault exception. And this is expected! The only allowed channel for kernel <-> user is uaccess API. I guess that you have test (and that great!) which violates that rule (for testing purpose, why not?) and now you are trying to fit kernel into it... Cheers Vladimir > > >> >> Cheers >> Vladimir >> >>> >>>> >>>> Cheers >>>> Vladimir >>>> >>>> . >>>> >>> >>> >> >> >> . >> > >