From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_ILLEGAL_IP, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CD67C388F2 for ; Tue, 3 Nov 2020 05:35:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D85DD22277 for ; Tue, 3 Nov 2020 05:35:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbgKCFfM (ORCPT ); Tue, 3 Nov 2020 00:35:12 -0500 Received: from mga11.intel.com ([192.55.52.93]:45876 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbgKCFfM (ORCPT ); Tue, 3 Nov 2020 00:35:12 -0500 IronPort-SDR: /8G/iwx1jS1P9pvqL/CYU12LHgN0LireLJQsJW6R3YR1Hr7bDIieiIoSKKmXq5Idsoz4gZtV7I /cnFd3tpUeTA== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="165498172" X-IronPort-AV: E=Sophos;i="5.77,447,1596524400"; d="scan'208";a="165498172" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 21:35:11 -0800 IronPort-SDR: pvXmgZq8pEXonYygE2Xdqk69XDdFwn87bm3Tg7b+fGG1MIhdL2gAzuDXzcaic8ZnrtsOLoFU1f b8Qae/eTGlUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,447,1596524400"; d="scan'208";a="353081268" Received: from unknown (HELO [0.0.0.0]) ([10.109.19.69]) by fmsmga004.fm.intel.com with ESMTP; 02 Nov 2020 21:35:08 -0800 Subject: Re: [PATCH] KVM: VMX: Enable Notify VM exit To: Sean Christopherson , Andy Lutomirski Cc: 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 References: <20201102061445.191638-1-tao3.xu@intel.com> <20201102173130.GC21563@linux.intel.com> From: Tao Xu Message-ID: <34576238-eedf-4a94-880a-c961d2d5b237@intel.com> Date: Tue, 3 Nov 2020 13:35:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201102173130.GC21563@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/20 1:31 AM, Sean Christopherson wrote: > 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. > Sorry, I should add RFC tag for this patch. I will add it next time.