Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp545680ybb; Fri, 3 Apr 2020 07:36:31 -0700 (PDT) X-Google-Smtp-Source: APiQypLukxBcQEKe4C4sCIGz+dFcjJO2+7uK2LczxuV5Ek+j9i6sGr390h4JNK7UWps5rqpEdGj3 X-Received: by 2002:a54:4181:: with SMTP id 1mr3090693oiy.61.1585924591564; Fri, 03 Apr 2020 07:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585924591; cv=none; d=google.com; s=arc-20160816; b=kdWk7ti2t6gC5PH2jcpEGu1ukFmY63hQOuy4RqCPLXKh4/D/QIDZDtovtV3m9VkW7x 0XO7t32VUgigRVR4yjIeRWKeA6ngLnRhJO22GUdPYhQWHFWf3s/sil/p/ti5ttkYvj6/ gU27HW2ul8SO5NlaLKWfmhzxrusjV0UrVnZCVfs8VUTTimVMmfuMX/HDPwG/UDVpDC15 A6FdNOaBxj63DHA9rlm3gbaJLw416JBUrj4fC/gtmdMTlAbXJSjO0QYV8c+TY9zQbRxP xUkZ5SJySBzI9R+LUR3Fgft8DMR28kLXgWpzEPcx43UJtB8AYyORoE2pVvIOyEjSOdTw Y0vA== 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=ms4LVOzhF0vPDOhEHsaxnyIsKzU/f/4CTRFC4kv8zA8=; b=ocg0n9gPTht4qFkoQ80TQwsnpQ7mSGc2lyJX2dYieiXyWkin2FTDqNKORJssW8TfQs STUXgM8LNAXuFxJxQSihe6MyCuZ3bS2OMUKS94uN5Zwqoo8m8TfT46tKQBR801j/W8se jYNZuJgODzECKIdM7Zn2oIOYovpf+gvNr6Vq/sBes7/wGuevWWAEWawkit3/sJ14k1QY ErrtpEtlK4SrEpk/JpA2gVzzQywmFtbp93blAWzYrLqASkhz5TzY8Bqanghd32/sgAXj wo38Yi44UKd+4WbxLiS8/xzBwiNQJggr1TK2lTUPkzis5x4FAUdnpbNuQNmOYfE1pwYP GLXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=je50tGed; 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 h27si3972604oos.21.2020.04.03.07.36.19; Fri, 03 Apr 2020 07:36:31 -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=bombadil.20170209 header.b=je50tGed; 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 S2390796AbgDCOd6 (ORCPT + 99 others); Fri, 3 Apr 2020 10:33:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36720 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbgDCOd5 (ORCPT ); Fri, 3 Apr 2020 10:33:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=ms4LVOzhF0vPDOhEHsaxnyIsKzU/f/4CTRFC4kv8zA8=; b=je50tGed4E17GOQUyIWT5kd1j6 Ua/PVXId51dLBBxiVIp0jW7hZL+Y0ckijQLCYtaTZ3jNFgO9w23AMgiRdUzpmTwQFd8jU4FMB6yjl ef55cQFBo3XeFlsP/4a2j3ZpdKdsWdqSTDYwpSHLE1RewSabrUDhWNgkX6ApM39L2MKQxjhYH5+LR xApplv/IrRCUyrEoKLoF+icmr30f4cnvmyPvaLJq2I66LD/Ey+fn2Y8LxKRMCAtCW/a/14AVqJti5 66cHcmz1tSZbT4E5wMSrvgAbUm9G0MDALCw6lwSUW2Tj9RbPHgj2Hrl413hapDVwmUR9NlwJjYM9t 4iu3n7jA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKNOG-0000li-0M; Fri, 03 Apr 2020 14:33:48 +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 DD8593056DE; Fri, 3 Apr 2020 16:33:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C5B5B2B12210A; Fri, 3 Apr 2020 16:33:44 +0200 (CEST) Date: Fri, 3 Apr 2020 16:33:44 +0200 From: Peter Zijlstra To: David Laight Cc: Thomas Gleixner , LKML , "x86@kernel.org" , "Kenneth R. Crudup" , Paolo Bonzini , Jessica Yu , Fenghua Yu , Xiaoyao Li , Nadav Amit , Thomas Hellstrom , Sean Christopherson , Tony Luck , Steven Rostedt Subject: Re: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Message-ID: <20200403143344.GP20730@hirez.programming.kicks-ass.net> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200402152340.GL20713@hirez.programming.kicks-ass.net> <9b95fe9e81c14370859e19f081cc23e4@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b95fe9e81c14370859e19f081cc23e4@AcuMS.aculab.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 08:09:03AM +0000, David Laight wrote: > From: Peter Zijlstra > > Sent: 02 April 2020 16:24 > > > > I picked VMXOFF (which also appears in vmmon.ko) instead of VMXON > > because that latter takes an argument is therefore more difficult to > > decode. > ... > > + while (text < text_end) { > > + kernel_insn_init(&insn, text, text_end - text); > > + insn_get_length(&insn); > > + > > + if (WARN_ON_ONCE(!insn_complete(&insn))) > > + break; > > + > > + if (insn.length == 3 && > > + (!memcmp(text, vmlaunch, sizeof(vmlaunch)) || > > + !memcmp(text, vmxoff, sizeof(vmxoff)))) > > + goto bad_module; > > + > > + text += insn.length; > > + } > > How long is that going to take on a module with (say) 400k of text? It's module load, why would you care? I suspect it's really fast, but even if it wasn't I couldn't be arsed.