Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1943441ybb; Thu, 2 Apr 2020 10:08:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIJ30pDd5PtyIPQL9sg0bNKsaA20JcTJYcCWf7TiXaNZllnTTRaSPI5KrlTCigNnN0nAdIU X-Received: by 2002:a05:6830:144e:: with SMTP id w14mr3316784otp.75.1585847307400; Thu, 02 Apr 2020 10:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585847307; cv=none; d=google.com; s=arc-20160816; b=lNTMnBtpZuiP67ngHPEZTcIKNGOzpibbhWjhU28DBYo1OxaXdlRHlrq0DhNFB4F7zk ciPk3AchBulw6asSBq6z+UYWOTbNzSi5Fi4wfnsITuqkvqZ//HbrYneUJ51RGP2ppFe5 S1DJw4BD+QyFO+w+ZduzAkKcKbr0RBefsX5uarWGG0b1LYys6rI1KNBTbFWKN6tZSTIt 5rxw6fNPL3ltxDvyZZrk5XYsetaj3CLr/uq1m8dp+IvgzkJ/SNJDM47Jc5QyCgwDnSg8 xeT0u8R61RxKcd7qaq7RoCWoCO2DbYbrqH4zzYYRPQUdm/0nu0T7oedm0tImz/LnA0s9 0Ztg== 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:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=Q+cyUT2RmIIEch5etrlIKrw75Nud1hNYWTEzkYUjKcs=; b=0ZXIfuB5ck5emBsPQJjN+FwUgUPEmUeZOI9mU6skFosnVe+w3aKlodIU1+5+AjZszO HyXWvySiFzhgqEYKiTfKp7x+a0GyPfsewlHVVhITetlrBHPPKIH1f6v0Xojuwe8xRfi3 X68mecJRc/Z3MXJjShKHti4zeopRTpWTsw5oENtKL7SVw5v0qFTpmHvtW436Qwhwgd16 GWr7qco/goBBap8CLcfsleixldiIyGJuBCCTFgnQDejioyeIqEjbl30pJbhDnw0CL9Oo Hg/F8qJmUeYO4E/D6ZBiTey2cJDkvCBNzu1YnyIl1KniNOZ/94VPwl2lam9mJZDtKmjS OSgw== 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 c67si2676365oif.5.2020.04.02.10.08.14; Thu, 02 Apr 2020 10:08:27 -0700 (PDT) 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 S2389885AbgDBQmD (ORCPT + 99 others); Thu, 2 Apr 2020 12:42:03 -0400 Received: from mga18.intel.com ([134.134.136.126]:55493 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbgDBQmC (ORCPT ); Thu, 2 Apr 2020 12:42:02 -0400 IronPort-SDR: KCUgcajdfJNsnPeo+czqs1faKay3oyHniad+b38d65kHZjJRwVAcikGCgC6QzBM2dipps9Br6v C6gYVezyqbHA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2020 09:42:02 -0700 IronPort-SDR: nRCn5XujqpcJlyzDA7FP1e7OHy2RhPcU9qyjSkkoPKWIN1REVvqGWirY0hqNhf0H9KZH+Hao9r 4BJRTGJn/ZzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,336,1580803200"; d="scan'208";a="273629977" Received: from xiaoyaol-mobl.ccr.corp.intel.com (HELO [10.249.169.179]) ([10.249.169.179]) by fmsmga004.fm.intel.com with ESMTP; 02 Apr 2020 09:41:58 -0700 Subject: Re: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect To: Peter Zijlstra Cc: Thomas Gleixner , LKML , x86@kernel.org, "Kenneth R. Crudup" , Paolo Bonzini , Jessica Yu , Fenghua Yu , Nadav Amit , Thomas Hellstrom , Sean Christopherson , Tony Luck , Steven Rostedt References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200402152340.GL20713@hirez.programming.kicks-ass.net> <725ca48f-8194-658e-0296-65d4368803b5@intel.com> <20200402162548.GH20730@hirez.programming.kicks-ass.net> From: Xiaoyao Li Message-ID: <2d2140c4-712a-2f8d-cde7-b3e64c28b204@intel.com> Date: Fri, 3 Apr 2020 00:41:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200402162548.GH20730@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed 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 4/3/2020 12:25 AM, Peter Zijlstra wrote: > > Learn to trim your replies already! Sorry. > On Fri, Apr 03, 2020 at 12:20:08AM +0800, Xiaoyao Li wrote: >> On 4/2/2020 11:23 PM, Peter Zijlstra wrote: > >>> +bad_module: >>> + pr_warn("disabled due to VMX in module: %s\n", me->name); >>> + sld_state = sld_off; >> >> shouldn't we remove the __ro_after_init of sld_state? > > Oh, that's probably a good idea. I can't actually test this due to no > hardware. > >> And, shouldn't we clear X86_FEATURE_SPLIT_LOCK_DETECT flag? > > Don't think you can do that this late. Also, the hardware has the MSR > and it works, it's just that we should not. > Actually, I agree to keep this flag. But, during the previous patch review, tglx wants to make sld_off = no X86_FEATURE_SPLIT_LOCK_DETECT I'm not sure whether he still insists on it now. I really want to decouple sld_off and X86_FEATURE_SPLIT_LOCK_DETECT. So if X86_FEATURE_SPLIT_LOCK_DETECT is set, we can virtualize and expose it to guest even when host is sld_off.