From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382AbcBHPzV (ORCPT ); Mon, 8 Feb 2016 10:55:21 -0500 Received: from mail.skyhub.de ([78.46.96.112]:52425 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754601AbcBHPzT (ORCPT ); Mon, 8 Feb 2016 10:55:19 -0500 Date: Mon, 8 Feb 2016 16:55:07 +0100 From: Borislav Petkov To: Boris Ostrovsky Cc: Andy Lutomirski , "Luis R. Rodriguez" , "Luis R. Rodriguez" , cocci@systeme.lip6.fr, Juergen Gross , mcb30@ipxe.org, 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 , Konrad Rzeszutek Wilk , david.e.box@intel.com, X86 ML , Ingo Molnar Subject: Re: [PATCH v2 3/3] paravirt: rename paravirt_enabled to paravirt_legacy Message-ID: <20160208155507.GF28980@pd.tnic> References: <1454733014-15237-1-git-send-email-mcgrof@kernel.org> <1454733014-15237-4-git-send-email-mcgrof@kernel.org> <20160206085930.GF25240@wotan.suse.de> <20160206220437.GA4435@pd.tnic> <56B8B6BF.6030007@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56B8B6BF.6030007@oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2016 at 10:39:43AM -0500, Boris Ostrovsky wrote: > It does. Very much IIRC, the problem was not caused by an access to MSR but > rather some sort of address not being available somewhere. See below. > >- microcode application on Xen: we've had this before. The hypervisor > >should do that (if it doesn't do so already). > > it does. Good. > >So yes, that paravirt_enabled() thing should go away. Even more so if we > >have CPUID leaf 0x4... reserved for hypervisors. > > I actually think this was the original proposal until we realized we had > paravirt_enabled(). So we can go back to checking CPUID 0x40000000. > > We might also be able to test for (x86_hyper!=NULL) and have guests that do > microcode management prior to init_hypervisor() rely on hypervisors ignoring > MSR accesses (as they do today). Right, so the early loader can't do that as on 32-bit it runs even before paging has been enabled. So I *think* the thing with CPUID would be best. What does the xen hypervisor return in regs when I do CPUID(4)? I.e., how do I reliably detect it in the guest? I can whip up a quick patch and get rid of paravirt_enabled() while at it... -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.