Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3465541pxx; Mon, 2 Nov 2020 09:33:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHMA9PDdWnWczKVOc8k16ug0r74RuVglZzIC69PdOQAVKJChD7v6PoO1GMxx6mrfZBNY9X X-Received: by 2002:a17:906:cb88:: with SMTP id mf8mr12840151ejb.31.1604338416043; Mon, 02 Nov 2020 09:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604338416; cv=none; d=google.com; s=arc-20160816; b=jmwRUYoVbeFYwI0CmMirAO4z3fxJS2nDhlVQPq44YjRKmJ3I5TL0zJX71NbGqSnZZt RSILrMwhE17EHe+nLbq9rFRKIcmlhxIO2Be5YcGGFx9aCxe4i1Pzdv39QZG0VTUuuXOH SS1Bf0nvia9C+/OXa2deuGEprDaMHGaDV94Bpqv/sRVqX89Bl/1vGGIBegxRCRX5XJVA Khl2NUgx+AX4TuyZA2hTEIbUQsdvCkFZI9EYBdBA8Djuq3BbXm5EhPYsJAm6hKKTxvf8 958I/z0Wv2/jVPPvjC7RenNNi5as9oSfd0gW6ock8aKeirCCUEOSQSkecocOgrlfWFYK WhdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=dw4LqeO07vtneK7RX4S2YXaIsYJCSUuvEX2FzO8amhI=; b=0ycTWXstgySLj9dd/2I6EBawmnoVDNwoR+wWmzQSG6aMenMjMuHVYJMMccsrEOZh/N 1NFOkYEmyG+G7AqswfjzsRrgDj+0ybKINxi6YIt9kGVeo+0vd40S0J6Qd3g8y7qHn8TS /gWV5jeojE6BGbSAW6N5PqrFfjEtwiU1iRY1psaOdT0vZUCC3yNWK5UUs+zOBIiT49XM ZiARmcBP76sap8YEaaVtfJmBBJcwY3GmRObcMnnmWt9O23n6ko5mXikWKQZyEMEJLzQW Y4Dy4+/P+HGYQCHDzfqtP/AGocMKQ63XaH4kPC1aQf/ztIn6m9p0J0L3mAaW5KMwEWDG E6Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si9906049ejd.730.2020.11.02.09.33.10; Mon, 02 Nov 2020 09:33:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbgKBRbf (ORCPT + 99 others); Mon, 2 Nov 2020 12:31:35 -0500 Received: from mga02.intel.com ([134.134.136.20]:58695 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgKBRbf (ORCPT ); Mon, 2 Nov 2020 12:31:35 -0500 IronPort-SDR: Qp1/uALvXGx4w5lJK0MqhrW1/UV8ahNVVg37THQP/y6PKC2OqffeD0sW8hiIre9i8ueuUPNv+h SR69FTHoAZUw== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="155909597" X-IronPort-AV: E=Sophos;i="5.77,445,1596524400"; d="scan'208";a="155909597" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 09:31:34 -0800 IronPort-SDR: XDYVXdpZ637dAUON1ShOdypkhvFUCwXcWPE21VX6qdWBLfkxhohSWuTOtBiK7a1QP//whSl54N zjidFknihj3w== X-IronPort-AV: E=Sophos;i="5.77,445,1596524400"; d="scan'208";a="528093774" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.160]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 09:31:33 -0800 Date: Mon, 2 Nov 2020 09:31:32 -0800 From: Sean Christopherson To: Andy Lutomirski Cc: Tao Xu , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , kvm list , LKML , Xiaoyao Li Subject: Re: [PATCH] KVM: VMX: Enable Notify VM exit Message-ID: <20201102173130.GC21563@linux.intel.com> References: <20201102061445.191638-1-tao3.xu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 02, 2020 at 08:43:30AM -0800, Andy Lutomirski wrote: > On Sun, Nov 1, 2020 at 10:14 PM Tao Xu wrote: > > 2. Another patch to disable interception of #DB and #AC when notify > > VM-Exiting is enabled. > > Whoa there. > > A VM control that says "hey, CPU, if you messed up and livelocked for > a long time, please break out of the loop" is not a substitute for > fixing the livelocks. So I don't think you get do disable > interception of #DB and #AC. I think that can be incorporated into a module param, i.e. let the platform owner decide which tool(s) they want to use to mitigate the legacy architecture flaws. > I also think you should print a loud warning I'm not so sure on this one, e.g. userspace could just spin up a new instance if its malicious guest and spam the kernel log. > and have some intelligent handling when this new exit triggers. We discussed something similar in the context of the new bus lock VM-Exit. I don't know that it makes sense to try and add intelligence into the kernel. In many use cases, e.g. clouds, the userspace VMM is trusted (inasmuch as userspace can be trusted), while the guest is completely untrusted. Reporting the error to userspace and letting the userspace stack take action is likely preferable to doing something fancy in the kernel. Tao, this patch should probably be tagged RFC, at least until we can experiment with the threshold on real silicon. KVM and kernel behavior may depend on the accuracy of detecting actual attacks, e.g. if we can set a threshold that has zero false negatives and near-zero false postives, then it probably makes sense to be more assertive in how such VM-Exits are reported and logged.