Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp681936ybb; Fri, 3 Apr 2020 09:52:48 -0700 (PDT) X-Google-Smtp-Source: APiQypJbQpu8KOlhaVrIcWt7BPLs3VToVJDEVNf5LV0Y3D0XYal+2cuTTTYMbg/Us4XYMcxlxkeW X-Received: by 2002:a05:6830:1c65:: with SMTP id s5mr7515799otg.25.1585932768532; Fri, 03 Apr 2020 09:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585932768; cv=none; d=google.com; s=arc-20160816; b=wcsFFQdHBDyMjCf9p/6lgjHhkSalP8ItmNAU/RNBw/M3W6lVOeFUaNektGrnxlXmty 4RElOzy9HJmVB+CqN2AUaoB9yHG7VcOi8lv6vdn2/2KDa7ixkYYmxyGUQKTSaGd76oht TOsWT+7jS9jkk+z9W4dZKE2Q8BuhwOWhlIqGui5JNIrRNO+Fnh6wJv/O+i8I1Z7bANmp RKzBklGM3RuglWxfo9w+nXdc8ZBm9gy8ie7Shck/JY4OqqVJTHRmEkVQkNwCDyWU+345 fSmhfxxYKiNbi7OqmUaBYGOJFryNgv2FPvaEav3uyhm0ZDVqAShJXoKAevkBn6/YSm3d Xw0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oWXG5QSbpYfvkFdjY4l1811DSoPH7nI2HTV6dvF6oBU=; b=KO3Ad/RV+UyI2zic8PtBqTr05SpF71OIhUN8/YWz2KR/GEPN5ts4rBmvEBoiFReAt1 fJ5SWrHqv70Pb5FjSMc5aZYLdQs3tTcqiVOnz2TB+gk01vgUNxwPez0dZQLgalp5MGjJ YCWbhspetdImqeBhno/IJGtWPr+CZDMjFBHxKguTk3vPo56FZ82wwuy5BMwFxv3E8i0t rd2BmUzaQ+xUYv2YeSEdCt5w/elvsWyQQOi+qX87NgxULjXSTRA4boe+YrApe0TO7Y3i 3271ABs9y9Cb5frygPSN4UzxTX7mAmsOC5ibjQaKdB2h7wjpJS+dezi+5l4z8tE8mDip uy/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="OB9f/mtN"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v108si3857020otb.136.2020.04.03.09.52.35; Fri, 03 Apr 2020 09:52:48 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="OB9f/mtN"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404586AbgDCQmJ (ORCPT + 99 others); Fri, 3 Apr 2020 12:42:09 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47598 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728381AbgDCQmJ (ORCPT ); Fri, 3 Apr 2020 12:42:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oWXG5QSbpYfvkFdjY4l1811DSoPH7nI2HTV6dvF6oBU=; b=OB9f/mtNJpcSeSG9Y1OSONyoRb mvrjE2qVstB/4X/XS6tNMkYuF3KRM2GYdfqPEec0+TfM1pnTyNmbZMPbji8SjFrb2RnvVhb3/0Npm uG5VruxgD0I1hRH4wDNxFzrTZcsSPQaePfkvISS5seSpy3RXCVOL6vprS4KfMGSEI0y1RBBPdUKPh 0B3u3HJqFlZVqq35EHNfaMFl+Bw5LB0I3609d24YzfEZP5KiYV+IXO0FFPqANFCWfOWpyWJ3Ovc5v HdFrleiKC0Xg0gP2xQ7PGdxatAUD3B3N16VVDcCD3UrllIGGDZgT763y1BNgRPkSyRHZO+wZLGlRn k/Iobs2g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKPOH-0003Jq-K7; Fri, 03 Apr 2020 16:41:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6DF873010BC; Fri, 3 Apr 2020 18:41:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 225DA2B12078B; Fri, 3 Apr 2020 18:41:56 +0200 (CEST) Date: Fri, 3 Apr 2020 18:41:56 +0200 From: Peter Zijlstra To: Sean Christopherson Cc: Thomas Gleixner , LKML , x86@kernel.org, "Kenneth R. Crudup" , 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: <20200403164156.GY20730@hirez.programming.kicks-ass.net> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200403163605.GC2701@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200403163605.GC2701@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 03, 2020 at 09:36:05AM -0700, Sean Christopherson wrote: > 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); > > + } Ideally we push it all into arch code, but load_info isn't exposed to arch module code :/.