Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4450961ybb; Tue, 7 Apr 2020 07:45:54 -0700 (PDT) X-Google-Smtp-Source: APiQypLCxjCu5RjTNx/94E3QdbQ9fMiyqT9jDfmJKBYpzi0mwYHWOex37UlkJe3g501cU0SdoVaR X-Received: by 2002:aca:3302:: with SMTP id z2mr2031834oiz.3.1586270753934; Tue, 07 Apr 2020 07:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586270753; cv=none; d=google.com; s=arc-20160816; b=E0NWeb21wF+xDiP8fwPvIAC2tWuYKfH0seBB+I5u0gNxCzaw5WNIDmmwB4yTmXEhKg jJhrqfdOGpRxN7zCvJY+aZQVYfPfkgDRymomWWtUALa27Ks0zDzjYG3TmGmLGeB1qYTk GaiGoh8IB//2/q8MO7uvV8ktWF+BoMCR7GqOPXtV8NfCD6LBqy7qHV3FyGmZiIr6gFsx BDbCYTt3eVvqnhYebSajjUYGe1Fvjau89MH2iQYvl5RtYIYIeP3qwZRpVfm2NbTZTb+X B5d5IRPCPt94M7l8RoxWoxg/cyrB/Ws05zn+s7iJ/7lGmwt/1L/1Zwfznu5VObqtMUHP de5Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=AT0qdTW1KghtohwORbuJ6mTZmGdeHBnuCRf4FinRRxI=; b=jWQz4pNfNHpEF+EA1N8c2JA3qPWFR+pHdR7U9SUp6yQ3UsCqEVNaFx2H/USA+ZIbon J8MEb7w5ce/uOcGikHdPEwdCG6kBXbvZQu/gLMIjCzQGCECXhhi971ph7Bt9spi/+yFQ CQlfj09+kRl7tEyMyCNwuCBvBC4JpCdDIpzLBL3guCTxlGUbfodw+hjKLS8StPX6kG05 tzj2U5eUZf1hO067vzrZBwFNEomVkTeI1tDoS21ueyPKfOBD6kp/lSvwmfpurrayWcrE Ld5OIQUSgdpQ2teF3fi87FMxGZb9MlMYKBfKjgNKWepgRgt6xt5sd+r40WmKEx2jyVzW 4JrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=E5PJDuhs; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si706338oiy.150.2020.04.07.07.45.40; Tue, 07 Apr 2020 07:45:53 -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=@redhat.com header.s=mimecast20190719 header.b=E5PJDuhs; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729148AbgDGOpE (ORCPT + 99 others); Tue, 7 Apr 2020 10:45:04 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:37922 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728943AbgDGOpD (ORCPT ); Tue, 7 Apr 2020 10:45:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586270702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AT0qdTW1KghtohwORbuJ6mTZmGdeHBnuCRf4FinRRxI=; b=E5PJDuhss7NF5Y9mrTjkzHN8cRo7b66Ep05FDLAztU5ycATvEbiWSwSW+cS8+APYsetP9j HmQ6U6pqL2po3tafTCalprwjSFX/hJ+gkz4iDkB5Pr4opMycUAtePZF4zmZvZM0sK58T57 rDZlnDIEYUE2gPbRdRKqMLf7AZsY7T8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-qqPqT1giNlW1bk2YaVZPrg-1; Tue, 07 Apr 2020 10:45:00 -0400 X-MC-Unique: qqPqT1giNlW1bk2YaVZPrg-1 Received: by mail-wm1-f72.google.com with SMTP id p18so815250wmk.9 for ; Tue, 07 Apr 2020 07:45:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AT0qdTW1KghtohwORbuJ6mTZmGdeHBnuCRf4FinRRxI=; b=GF+HBThjzz6hBgxwS/jeNarAQHBTUK2W5e8fz9cE4BvhTPVUd8a2k1CWAVZV9kpres 6J00+DGorJhPNA+F6M1nOlIsRIeePpSRbRbw0nexlcyJ2q6AkGNekb9FSRXgfao2vVSv 3ztI4UOTPTyjzj9t9XaK7iEZz4hDq4LH5Mm9QmDynpWuHInr5W8xdUQiFH3M9DwMUZBW EHwVLNHIK0aOOG30kWEKVukmSgXkNBfloss4LnE6/5ZJH/4/59jSucWY4WI5oO7hJI49 SRP+oBRVFS+4wEjFsqhMZDef7xuOI8Ubj3u47Q61xkHzCBsr6iOT8JhZwBZVHMeQMEjO NgJw== X-Gm-Message-State: AGi0PubaT/Xd18St3sf05L6+4/Fo8/YuH/R2yxZhbbLOxOCD2Pd5kW01 0iS/Kmb84qUCrjkVw9Pjpu/sgVrWd6mhRXmUrhN9aC50GiqOouwki+T4+y/3WNxuIkYXmO+WVud osPiL2XPSgL5il1yUpc2lNSKi X-Received: by 2002:adf:e94a:: with SMTP id m10mr3202494wrn.324.1586270699290; Tue, 07 Apr 2020 07:44:59 -0700 (PDT) X-Received: by 2002:adf:e94a:: with SMTP id m10mr3202447wrn.324.1586270699024; Tue, 07 Apr 2020 07:44:59 -0700 (PDT) Received: from [192.168.10.150] ([93.56.170.5]) by smtp.gmail.com with ESMTPSA id j135sm2754009wmj.46.2020.04.07.07.44.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 07:44:58 -0700 (PDT) Subject: Re: [PATCH 3/4] x86,module: Detect VMX vs SLD conflicts To: Greg KH , Peter Zijlstra Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, hch@infradead.org, sean.j.christopherson@intel.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kenny@panix.com, jeyu@kernel.org, rasmus.villemoes@prevas.dk, fenghua.yu@intel.com, xiaoyao.li@intel.com, nadav.amit@gmail.com, thellstrom@vmware.com, tony.luck@intel.com, rostedt@goodmis.org, jannh@google.com, keescook@chromium.org, David.Laight@aculab.com, dcovelli@vmware.com, mhiramat@kernel.org References: <20200407110236.930134290@infradead.org> <20200407111007.352324393@infradead.org> <20200407143543.GB876345@kroah.com> From: Paolo Bonzini Message-ID: <527b5c72-96cb-a6cc-5301-449d86015ec9@redhat.com> Date: Tue, 7 Apr 2020 16:44:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200407143543.GB876345@kroah.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/04/20 16:35, Greg KH wrote: > On Tue, Apr 07, 2020 at 01:02:39PM +0200, Peter Zijlstra wrote: >> It turns out that with Split-Lock-Detect enabled (default) any VMX >> hypervisor needs at least a little modification in order to not blindly >> inject the #AC into the guest without the guest being ready for it. >> >> Since there is no telling which module implements a hypervisor, scan >> all out-of-tree modules' text and look for VMX instructions and refuse >> to load it when SLD is enabled (default) and the module isn't marked >> 'sld_safe'. >> >> Hypervisors, which have been modified and are known to work correctly, >> can add: >> >> MODULE_INFO(sld_safe, "Y"); >> >> to explicitly tell the module loader they're good. > > What's to keep any out-of-tree module from adding this same module info > "flag" and just lie about it? Isn't that what you are trying to catch > here, or is it a case of, "if you lie, your code will break" as well? It's the latter. Basically it's doing _the users_ of out-of-tree modules a favor by avoiding crashes of their virtual machines; developers need to fix them anyway. Paolo