Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp220324ybb; Fri, 3 Apr 2020 01:11:10 -0700 (PDT) X-Google-Smtp-Source: APiQypKy7B5h4R+EXpfDDTn1/v3cDQmQMPC188kQa2S7UCmvBz5E27TArDyGHtw/hM4CW+4uX5Th X-Received: by 2002:a4a:d1a5:: with SMTP id z5mr5821161oor.63.1585901469998; Fri, 03 Apr 2020 01:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585901469; cv=none; d=google.com; s=arc-20160816; b=pceMxE7qtHQ1n81/D5sQGBfxFyZlt1ID1zW2JcIooawg9PPmvFmpPNyTkhK8uXtmvJ ekjsIU2nlf650daiewrK0soU+ZDrsAGwaoRNHiq+NSCaOWgiSMdx73Ni8/1MJjkGluqZ anh35K7nj6GxLZ4ylj4A6tM5gQfaUJMYbfUTxwgLs97fjz3PsR3kbCsJ6zaSna8qCUvl YP6e0Z3Mm204ndhi8Oo01Y0/6r7GfSbxYUKo+WjfFEZRldmLPv2HPQFKjjgNES6ijR70 6RouAAlrvRiaMyWqA8lVOgx1FWanibn+c9g3kyP0cohlOJUYOdvIXV9KlYjbf/ZI6wZy r4IA== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=8lB7EqlfeFcPWjpwJEwVuaSO5fWjhQBlG5Dts4CfdUU=; b=ojGHzdQHmkCreM16PKQ56abV7IpqJTuBvSODp2Mtg68ajZoP8N4bT4EMQSELc02lyF kPPgrLh99GuQShKnwJQ7M6AesvabbMgMZv1ggHH9aRcNfySyZ9lFXmvpQTbgxXZzdwBJ dOA5W2bRHXKRCJ/lQQ1f7u7ZiDD2XJ0xYezgTl/FpIwFVlUlFceg/AUy+1MhpWP1Mopn pQq0yz9qKjNnMyRdNv2ObCEJJ8ieb33zCk0opzKT8U73Yuoj4mjgRXOMOkakRm40a/cQ 5w4xtfVDMAIioQzctWxfsQH8j8qXZbqZZy4rFLalnL0xde43bF/e9IctEYv2ZdERIHBf QKKQ== 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=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137si3373617oic.139.2020.04.03.01.10.56; Fri, 03 Apr 2020 01:11:09 -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=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390296AbgDCIJJ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 3 Apr 2020 04:09:09 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:23780 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727431AbgDCIJJ (ORCPT ); Fri, 3 Apr 2020 04:09:09 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-216-2nJT-0BSNJKCaNUE6rLCiQ-1; Fri, 03 Apr 2020 09:09:04 +0100 X-MC-Unique: 2nJT-0BSNJKCaNUE6rLCiQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 3 Apr 2020 09:09:03 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Fri, 3 Apr 2020 09:09:03 +0100 From: David Laight To: 'Peter Zijlstra' , Thomas Gleixner CC: 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 Thread-Topic: [patch v2 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Thread-Index: AQHWCQK4i0gO2diBOkK6XKhOFlCL2qhnC2Fg Date: Fri, 3 Apr 2020 08:09:03 +0000 Message-ID: <9b95fe9e81c14370859e19f081cc23e4@AcuMS.aculab.com> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200402152340.GL20713@hirez.programming.kicks-ass.net> In-Reply-To: <20200402152340.GL20713@hirez.programming.kicks-ass.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)