Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp300823ybf; Wed, 26 Feb 2020 13:25:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxXZxSTMlCpIpnda1FZhxWIH2qoXN0KULOwy73EO72xn4hjevqhLdm3nsEppPsQD6adGmcM X-Received: by 2002:a9d:7304:: with SMTP id e4mr590929otk.99.1582752356038; Wed, 26 Feb 2020 13:25:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582752356; cv=none; d=google.com; s=arc-20160816; b=mSNaXeyfJmCoE+0tseEpNsB2PMEACJk6pUorwfv41rOtSS5xZojiSB6bnRmHc3Xb2q lzNBzIbSSv0yKvtYi7RhtjuUv4nnrXRwfIqAos+ADc5ITAuGEzM8mXpBJEQVoGAZHvJh pRRwu3h/4Gylpe8SOux+qo2tIbgQ7o8m5xlCUeRflVEF9crooELPYfwDuJoT08Ea44ri NsIz7/Cu8kLH4sfEIAfgqfQotgKQHL966+ALC05g7XJdCudIN5Jep1uYctJyuOVE7yix pq0UH0gNI4OQNpCqkC9hoIcv3TOC/yk2llc2W2q+Hd7fC7vcDkZSsD/GDdaqkEilkHXt /1qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=m5r3iugxOpjFI9xUmujsiwt6xDAoG85yUJ5wlLUMoSU=; b=hqCeNcawQ0O5zA8ZxbgkwujZZLgjCzhbjMQcZzK8nSp3AE7CvDvMDIwpr4e0AzPoZK UAPH0pVoWD4yN7abSiXxrPvgKaadJgf4KR6khgg+qK+6fJMJ7X7DKwirdR4yWBAYJxuc S2joKt81pJXx3uLXTIbEjSYH/2gHS7p4LAsG6kIY75L92etAdZTYGmS8w41h+QCGaCfp QKZflR0pul+md8k2DlIqTJjal+2rrzM612S/CFyVa9ZvusZ2E80FhDZ9bYRYOfc9DDWh 7DNmrjGbK55/LTVDQn5eg4Fo/w21J81XIx7983Vub6Qj4f7ynab3O7fIJyMEERZ99nU5 YueQ== 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 j15si194415oie.15.2020.02.26.13.25.44; Wed, 26 Feb 2020 13:25:56 -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 S1727619AbgBZVZj (ORCPT + 99 others); Wed, 26 Feb 2020 16:25:39 -0500 Received: from mga02.intel.com ([134.134.136.20]:51811 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727503AbgBZVZj (ORCPT ); Wed, 26 Feb 2020 16:25:39 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 13:25:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,489,1574150400"; d="scan'208";a="256472357" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga002.jf.intel.com with ESMTP; 26 Feb 2020 13:25:37 -0800 Date: Wed, 26 Feb 2020 13:25:37 -0800 From: Sean Christopherson To: Jacob Keller 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 Subject: Re: [PATCH v5 13/19] x86/cpufeatures: Add flag to track whether MSR IA32_FEAT_CTL is configured Message-ID: <20200226212537.GR9940@linux.intel.com> References: <20200225221234.GL9245@linux.intel.com> <1eaf6fbe-0adb-5074-3bc4-1e8327e0cdb3@intel.com> <20200225232900.GO9245@linux.intel.com> <5434303a-0742-3811-fd14-6445d296c0f0@intel.com> <20200226004258.GP9245@linux.intel.com> <20200226205745.GQ9940@linux.intel.com> <9a0a7373-f469-f2ae-c218-5821f805f0d8@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a0a7373-f469-f2ae-c218-5821f805f0d8@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 26, 2020 at 01:03:01PM -0800, Jacob Keller wrote: > On 2/26/2020 12:57 PM, Sean Christopherson wrote: > > Bummer. Using clear_cpu_cap() instead of setup_clear_cpu_cap() was me > > being fancy and trying to allow KVM to identify the case where VMX is > > available and configured on some CPUs but not all. I'll work on a fix. > > > Hmm. Right. For that to work, you'd need to make this disabling happen > significantly later, and/or fix setup_pku to somehow honor this properly. Arguably, setup_pku() should be a little less heavy handed in updating cpufeatures for X86_FEATURE_OSPKE, but init_ia32_feat_ctl() should also be more robust. I've reproduced the bug, should have a fix ready by EOD. > But it looks like rdmsr is global and not tied to a given CPU anyways? For better or worse, the MSR is thread scoped.