Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp777817ybb; Fri, 3 Apr 2020 11:37:07 -0700 (PDT) X-Google-Smtp-Source: APiQypKC/Gq7xIJX7GhGqOMycgMcpZ08Hl5fJ7v2SgqRBwRmbcHp6qf2Y97c/KSK3vn3Rq4yGY8D X-Received: by 2002:a05:6808:495:: with SMTP id z21mr4268068oid.30.1585939026842; Fri, 03 Apr 2020 11:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585939026; cv=none; d=google.com; s=arc-20160816; b=x03jfbjpIVx6cdKekJ/baBwX8jiKQRLC+dmR58kfVh1Tbogv6KhSi4bwMiUe/HlA3Z A7DKPO+0K+GJYDej9ZZwx4lZ9aqOyC+NJbUFdm/IU9pTm+ULmvULD+PlhtdAL6Np+SjR BDEfhi/YWGUL19/6yT4FByH9SSfctCQZ6hKmQK8c/vvdlNs5b3a5aKZZOmucQYLpZyCp tIS36bYmwpy1+kVkngCeRFAUG9UWLpdxW/6HQxtdwuDn7ZaE/c4YshK3hxs6Cubb8QdA LKYoscCl9QHQEwLE77d/X24/bDAPZx4ZEZy69KxJmV87HfpS+z5fS9l45VcCEbD1Jhql lV3g== 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:dkim-signature; bh=sHGPmWA4JOwCeO+sz/XEbYtIW21fcBIgnQ7/5Wr1Vrw=; b=JVaFCFhNwFyLqLGghIZp/VxHB2D278NMowrrVEe05klnAf3louMGUTqHbiGqo3FDyl GQaV8DXMADHcHs7LeRfZBx9jzpcb6goV76rd77GucPEaw4soqvMEMOuGLNZhZ4jXfwGp 43tdYTxJ5XytoV7y1quUR1s7mYakEI1CDd6r6CjZ6INTbrp+oD38VysJgRMEL6pY1gNG rve0O3elekW2WmOfLmuSAS3RDyeSsq1ue3jDnupeoQ9ExJOiW2IecsaTdufYACaJLfYz aD04n/HG3/Pte5gUuqRvgWtzH3aDtQCN3e8Er4VovhXhduEj69S7mrkRMLo3nggbs9Hr 190A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JeQ9+pUN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r205si4095990oig.174.2020.04.03.11.36.52; Fri, 03 Apr 2020 11:37:06 -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=pass header.i=@kernel.org header.s=default header.b=JeQ9+pUN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404032AbgDCSfV (ORCPT + 99 others); Fri, 3 Apr 2020 14:35:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:48354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgDCSfV (ORCPT ); Fri, 3 Apr 2020 14:35:21 -0400 Received: from linux-8ccs (p3EE2C7AC.dip0.t-ipconnect.de [62.226.199.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A8A1120737; Fri, 3 Apr 2020 18:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585938921; bh=Gx76OWxX9x0q7P0Z37+EbVclgWRovp84Puof/u/5vEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JeQ9+pUN2c8n8uUQYjFz+dS/UE4wuA5ctlqaMFqD/40NAvVNnup89ZeKUH4pvJj3I bMxbdHHE9qn17bP3IVaeG92n4eUdKEN66EuKoSi5lEhmGzb3BODyehc0TibGwf5svU 6bGWiyvfOjjlpgRD4UrW8lzBge9YU4oyCPlVQPqY= Date: Fri, 3 Apr 2020 20:35:15 +0200 From: Jessica Yu To: Peter Zijlstra Cc: Sean Christopherson , Thomas Gleixner , LKML , x86@kernel.org, "Kenneth R. Crudup" , Paolo Bonzini , 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: <20200403183515.GA2529@linux-8ccs> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200403163605.GC2701@linux.intel.com> <20200403164156.GY20730@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200403164156.GY20730@hirez.programming.kicks-ass.net> X-OS: Linux linux-8ccs 4.12.14-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Peter Zijlstra [03/04/20 18:41 +0200]: >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 :/. Hm, I can look into exposing load_info to arch module code and will post a patch on Monday. Jessica