From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423493AbcBQWWJ (ORCPT ); Wed, 17 Feb 2016 17:22:09 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:28762 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965454AbcBQWWH (ORCPT ); Wed, 17 Feb 2016 17:22:07 -0500 Subject: Re: [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy To: Borislav Petkov References: <1454733014-15237-1-git-send-email-mcgrof@kernel.org> <1454733014-15237-4-git-send-email-mcgrof@kernel.org> <20160206085930.GF25240@wotan.suse.de> <56B8B4D8.7050208@oracle.com> <20160209070629.GK25240@wotan.suse.de> <20160217204954.GO2023@pd.tnic> <56C4E474.2070206@oracle.com> <20160217220304.GP2023@pd.tnic> Cc: "Luis R. Rodriguez" , Konrad Rzeszutek Wilk , Andrew Cooper , David Vrabel , Andy Lutomirski , Juergen Gross , Michael Brown , Thomas Gleixner , Andrey Ryabinin , Joerg Roedel , Robert Moore , Mauro Carvalho Chehab , "Rafael J. Wysocki" , Xen Devel , "H. Peter Anvin" , Rusty Russell , Jan Beulich , Lv Zheng , "linux-kernel@vger.kernel.org" , long.wanglong@huawei.com, Fengguang Wu , qiuxishi@huawei.com, Andrey Ryabinin , david.e.box@intel.com, X86 ML , Ingo Molnar From: Boris Ostrovsky Message-ID: <56C4F208.2010505@oracle.com> Date: Wed, 17 Feb 2016 17:19:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20160217220304.GP2023@pd.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/17/2016 05:03 PM, Borislav Petkov wrote: > On Wed, Feb 17, 2016 at 04:21:56PM -0500, Boris Ostrovsky wrote: >> That's exactly the point: if something is mapped it's an error for a >> non-PV kernel. > How would something be mapped there? __PAGE_OFFSET is > 0xffff880000000000. > > Or are you thinking about some insanely b0rked kernel code mapping stuff > in there? The latter. This is to detect things that clearly shouldn't be happening. > >> By removing paravirt_enabled() we may miss those errors. Worse, I think we >> may even crash while doing pagetable walk (although it's probably better to >> crash here than to use an unexpected translation in real code somewhere) > Well, if this is the only site which keeps paravirt_enabled() from being > buried, we need to think about a better way to detect a hypervisor. > Maybe we should look at x86_hyper, use CPUID(0x4...) Can't use CPUID 0x40000000 because it will return hypervisor (Xen or otherwise) for non-PV guests as well. In Xen's case, you can't determine guest type from hypervisor leaves. > or something else. We could say xen_pv_domain(). But this means using Xen-specific code in x86-generic file to detect things specified by ABI. I don't know if I'd like that. -boris > > What's your preference? >