Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754351AbcLOTHC (ORCPT ); Thu, 15 Dec 2016 14:07:02 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:28763 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560AbcLOTHB (ORCPT ); Thu, 15 Dec 2016 14:07:01 -0500 Subject: Re: Can't boot as Xen dom0 due to commit fe055896 To: Borislav Petkov References: <73a4d64b-b139-6579-a560-92311641d6c7@suse.com> <20161215164635.thm7ruio2ddnxszw@pd.tnic> <20161215171755.xpfuax7a6q3jofet@pd.tnic> <20161215173609.ornfok6lk5oro2pj@pd.tnic> Cc: Juergen Gross , Linux Kernel Mailing List , xen-devel From: Boris Ostrovsky Message-ID: <385ac3cd-7a3f-4c4d-69bb-8feee235fb7e@oracle.com> Date: Thu, 15 Dec 2016 14:08:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161215173609.ornfok6lk5oro2pj@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1134 Lines: 36 On 12/15/2016 12:36 PM, Borislav Petkov wrote: > On Thu, Dec 15, 2016 at 12:27:49PM -0500, Boris Ostrovsky wrote: >> It will probably fix it but I don't think we want this: it's a >> build-time solution. Most kernels have XEN on even though they are >> booted bare-metal. > Lemme tell you want I want: a way to detect I'm running on xen. Does > CPUID(4) work really early, at load_ucode_bsp() time? > > IOW, can I use some of the functionality hypervisor_cpuid_base() uses to > detect xen and stop loading any further? I think we need at least diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 6f353bd..383b635 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -427,7 +427,7 @@ int __init save_microcode_in_initrd_amd(unsigned int fam) { enum ucode_state ret; int retval = 0; - u16 eq_id; + u16 eq_id = 0; if (!cont.data) { if (IS_ENABLED(CONFIG_X86_32) && (cont.size != -1)) { This fixes my PV boot problem. I am still failing to boot HVM, will need to look at this some more. -boris