Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4228159ybv; Tue, 25 Feb 2020 15:56:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxRbOlNbdc2EHULTAUoha2ZjCOKDcxqOMrYbPjnhI8yVu2y46+8doNjBXtiq+Wct1yJtlbY X-Received: by 2002:a9d:6181:: with SMTP id g1mr900156otk.104.1582674963546; Tue, 25 Feb 2020 15:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582674963; cv=none; d=google.com; s=arc-20160816; b=QzZ4g3YfSU/ozszXLxS94WIUi1OSHXkZ44eK41P/Nc5QyI23Beb2o2yP0P2LwrMnLo o0WzamwipVf2GVERZopGHDIkGD20hKKRinFkM9mMJbuJCdCw96ZCS+K4G/MEl7/uvucO fIEx/eLg8jsozuy8WsWuDQbtcJrVhpAaptXoVeFdxkK7HsweV0/VpkSCDvrHHeAOy4QN JDKzh5xifRssXmqpHFnBtMQQ8Xgwpe9UQQfwxUnUMgpzR3YJuoM9fRAdtZMG1CKeiwoT MRsKlwiqJ4mvgXzSsqx74bfHiuyFDpqi9TB4QhI3Fz2sA33LOl22D097Ojz+WHRC6Mpx 4Nnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=5Ds+9SbHgbS1tKZ1OuzqnVWB7pWmZ62M3/JrBWdrZx4=; b=JNkKDwANPuoMyx7EaU0MkP7esebyQ9csRB//GLhDXkSKQEgj39XXPnvIW2Wg1OGC8O cdQUrKhxt5YHEj5wt2lvc8LmDy20SHsmtGWyVlJ5jsvmf52oj8Jci7sB1Wo4Ow+1ALUE WDv3dVW/5UjkIbaBM9XrEK6iEzGBwRj9ENlWIducuGKIij77AzmYYzEqQwZhP1DNeWqm ZG6PJmLnSTCjRacgxYjSCjSB/RQdXbSbrsl1zPY9/fvPPEw489oCYkSC4eILIXFa8maz OI6MKhI34jTYx2y8TBHb77SX27AVFooN5nIJMOQRCwOiJIbzbw9nh1+QW2ETkRgazlJY 5dHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f28si279912otc.110.2020.02.25.15.55.51; Tue, 25 Feb 2020 15:56:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729693AbgBYXyh (ORCPT + 99 others); Tue, 25 Feb 2020 18:54:37 -0500 Received: from mga06.intel.com ([134.134.136.31]:56759 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729090AbgBYXyh (ORCPT ); Tue, 25 Feb 2020 18:54:37 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2020 15:54:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,486,1574150400"; d="scan'208";a="230279712" Received: from jekeller-mobl1.amr.corp.intel.com (HELO [134.134.177.78]) ([134.134.177.78]) by fmsmga007.fm.intel.com with ESMTP; 25 Feb 2020 15:54:34 -0800 Subject: Re: [PATCH v5 13/19] x86/cpufeatures: Add flag to track whether MSR IA32_FEAT_CTL is configured To: Sean Christopherson Cc: TonyWWang-oc@zhaoxin.com, acme@kernel.org, alexander.shishkin@linux.intel.com, bp@alien8.de, bp@suse.de, hpa@zytor.com, jacob.jun.pan@linux.intel.com, jarkko.sakkinen@linux.intel.com, jmattson@google.com, jolsa@redhat.com, joro@8bytes.org, kvm@vger.kernel.org, lenb@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-pm@vger.kernel.org, mark.rutland@arm.com, mingo@redhat.com, namhyung@kernel.org, pbonzini@redhat.com, peterz@infradead.org, rkrcmar@redhat.com, shuah@kernel.org, tglx@linutronix.de, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, x86@kernel.org References: <20191221044513.21680-14-sean.j.christopherson@intel.com> <20200225221234.GL9245@linux.intel.com> <1eaf6fbe-0adb-5074-3bc4-1e8327e0cdb3@intel.com> <20200225232900.GO9245@linux.intel.com> From: Jacob Keller Organization: Intel Corporation Message-ID: <5434303a-0742-3811-fd14-6445d296c0f0@intel.com> Date: Tue, 25 Feb 2020 15:54:34 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200225232900.GO9245@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/2020 3:29 PM, Sean Christopherson wrote: > On Tue, Feb 25, 2020 at 02:52:32PM -0800, Jacob Keller wrote: >> On 2/25/2020 2:12 PM, Sean Christopherson wrote: >>> On Tue, Feb 25, 2020 at 01:49:13PM -0800, Jacob Keller wrote: >>>> Hi Sean, >>>> >>>> I suspect something is wrong and the features are enabled even though >>>> the BIOS has it disabled, leading to later failure because of this. >>> >>> Hrm. On the failing kernel, what are the values of MSR 0x3a for all CPUs, >>> i.e. what's the output of 'sudo rdmsr -a 0x3a'? >>> >> >> On the old (fedora 30) kernel, every cpu reports as '1'. >> >> I can't easily test the failing kernel because it crashes during boot. > > No need, your BIOS is likely locking the MSR, I doubt the value is any > different when running the new kernel. > > Does reverting commit a4d0b2fdbcf7 ("KVM: VMX: Use VMX feature flag to > query BIOS enabling") resolve the issue? > > Is the failing kernel an (umodified) upstream kernel? A stable kernel? > Or something else? Assuming it's an unmodified upstream kernel, can you > send your .config? I've tried all the obvious Kconfig combinations but > haven't been able to reproduce the problem. Staring at the code hasn't > yielded any revelations either. > I reverted the suggested commit and added some prints: [ 26.056398] X86_FEATURE_MSR_IA32_FEAT_CTL is enabled [ 26.062426] X86_FEATURE_VMX is enabled [ 26.066923] kvm: disabled by bios So the old code flow is finding KVM to be disabled, but both features are set... The code that sets this is run first: > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: FEAT_CTL_LOCKED is set > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: FEAT_CTL_VMX_ENABLED_INSIDE_SMX is unset > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX is unset > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: MSR locked by bios > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: VMX (outside TXT) disabled by BIOS > Feb 25 15:46:05 jbrandeb-saw1 kernel: x86/cpu: disabling X86_FEATURE_VMX But somehow... it is still set later... So there's something weird going on. Maybe "boot_cpu_has" in the vmx_disabled_by_bios is wrong? Hmm.