Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp667355ybb; Fri, 3 Apr 2020 09:36:44 -0700 (PDT) X-Google-Smtp-Source: APiQypK41KmLkDuEvSvnowLAYkQJdpRQmAzLbSfMCq/FUuDp9LMhgfpb6+EIzuudyjOA9hKXBLCi X-Received: by 2002:aca:c78e:: with SMTP id x136mr3690649oif.116.1585931804084; Fri, 03 Apr 2020 09:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585931804; cv=none; d=google.com; s=arc-20160816; b=ONPI3Kxsi9r6oGJYs9i4o74ls/iSwpg4Smmi0wpmksLPjiMrQ5JKCp8a1u+GuvR4Cq Az6b5PUJ8fGCSpfv0YaSwJK37FQteWENG9TQNQlLVtmgUj9GmSTesNeUuJhXa4mfJuku URIwSIiuL44UcZQP7U/Y6OsDi8G1NOCpAQ3eB0PlCljPsuBvJvy+irLUGfTUetsujJhV x+X/3AOb9jIOx/Cze4ApiO8ciA3EW+drNM4H6XO85/LDphmyXEodALuU+nk8UgEiqVc2 tY8FM+suzRW7AdWBylaiUGWa3Ut/bnKD+GmDb3I7krWZBqn7qNHeB3+FfxInndlh5wSw r4uA== 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:ironport-sdr:ironport-sdr; bh=CHQpx6AdFwxbt5q0RAJ7wCc/9imWuwLoMDIaUPmCX/g=; b=ryZwWdEkeYGjgriqI4qHwBo2bYkOQcYC7UhM+EP9NNfwqExRkiNMTXB5IhIENRE+Q1 dQfFxKz6NJSq/DzTkCk+3KQSKEC2CVguIkRkQrmDmgm6pez4MDBhFQ/q9A3QmhmNXlPB p2AaNfYUkwCVKh9wKm0+oEG3IpvHtp+4KT8FC8g3tm0MzbFVfxgOE+VtMbvIxQqENJW+ 1KLO5b5cupTHeedYkfncl20iBOM00q4+CakqAaIn62XUtH2XlkgKI5YxslHcWZ/uq/35 5kP9/S0ec57LNvmxcr0jlgJF3WFRbUDkej7vvZz3v+8VvO3DH7gth5TDE23X9JOubJjt BJyA== 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 m1si3956720ote.308.2020.04.03.09.36.29; Fri, 03 Apr 2020 09:36:44 -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 S1728381AbgDCQgG (ORCPT + 99 others); Fri, 3 Apr 2020 12:36:06 -0400 Received: from mga02.intel.com ([134.134.136.20]:5492 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728337AbgDCQgG (ORCPT ); Fri, 3 Apr 2020 12:36:06 -0400 IronPort-SDR: 5wECPqqMmb/QGhn7rZkZIg6q5Psmn8Xv8wCjHJPD2r40IJnb4j0cz4wrv+cWEu3ViMiQyH128v w8tshwFQlt1w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2020 09:36:06 -0700 IronPort-SDR: nfqsA8ph8/sO0PRYiwmKh85h3V8Mrzb76AlSI/SwIUCBAnpKzbPIxjQi2mSqEC8nvocUE/q65/ Bgk4YSmo0yWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,340,1580803200"; d="scan'208";a="253417422" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.202]) by orsmga006.jf.intel.com with ESMTP; 03 Apr 2020 09:36:05 -0700 Date: Fri, 3 Apr 2020 09:36:05 -0700 From: Sean Christopherson To: Thomas Gleixner Cc: LKML , x86@kernel.org, "Kenneth R. Crudup" , "Peter Zijlstra (Intel)" , Paolo Bonzini , Jessica Yu , Fenghua Yu , Xiaoyao Li , Nadav Amit , Thomas Hellstrom , Tony Luck , Steven Rostedt Subject: Re: [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Message-ID: <20200403163605.GC2701@linux.intel.com> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200402124205.242674296@linutronix.de> 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 Thu, Apr 02, 2020 at 02:32:59PM +0200, Thomas Gleixner wrote: > --- a/arch/x86/kernel/module.c > +++ b/arch/x86/kernel/module.c > @@ -24,6 +24,7 @@ > #include > #include > #include > +#include > > #if 0 > #define DEBUGP(fmt, ...) \ > @@ -253,6 +254,11 @@ int module_finalize(const Elf_Ehdr *hdr, > tseg, tseg + text->sh_size); > } > > + if (text && !me->sld_safe) { As also reported by the test bot, sld_safe only exist if CPU_SUP_INTEL=y. This can also be conditioned on boot_cpu_has(X86_FEATURE_VMX), or the static variant. If CPU_SUP_INTEL=y, X86_FEATURE_VMX will be set if and only if VMX is fully enabled, i.e. supported by the CPU and enabled in MSR_IA32_FEATURE_CONTROl. > + void *tseg = (void *)text->sh_addr; > + split_lock_validate_module_text(me, tseg, tseg + text->sh_size); > + } > + > if (para) { > void *pseg = (void *)para->sh_addr; > apply_paravirt(pseg, pseg + para->sh_size); > --- a/include/linux/module.h > +++ b/include/linux/module.h > @@ -407,6 +407,10 @@ struct module { > bool sig_ok; > #endif > > +#ifdef CONFIG_CPU_SUP_INTEL > + bool sld_safe; > +#endif > + > bool async_probe_requested; > > /* symbols that will be GPL-only in the near future. */ > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -3096,6 +3096,11 @@ static int check_modinfo(struct module * > "is unknown, you have been warned.\n", mod->name); > } > > +#ifdef CONFIG_CPU_SUP_INTEL > + if (get_modinfo(info, "sld_safe")) > + mod->sld_safe = true; > +#endif > + > err = check_modinfo_livepatch(mod, info); > if (err) > return err; >