Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3296405ybl; Sun, 2 Feb 2020 20:17:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxiQS1o0sja0i1BBTixDWZtktQ0iCQ9EXJnX5hh9Ctb7NRu2IOK8OHpT5yWEA6JGdGDFpsv X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr15516415otq.1.1580703476385; Sun, 02 Feb 2020 20:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580703476; cv=none; d=google.com; s=arc-20160816; b=H8ca8ZVvod5Ag1as6BSQ1p8G45mWIM4P9bUCCdE36HuLrEcbjwawADTGyAZRkYQlso wUYGahGP5ZDuScxXjif9JnG1nBmKZdmMtOFxcAC229vNcB9gFdMF94+Oxi+OBIKCqvqM WCm11IbQv7xsac7lUri5rjiYmNTeNlqsZC9bfeEoH+Mgj+LTxJjbZUdgt+fRSDafKX+w n4DpWkd2yPEG8ckW15eDaKXNvX02Wr9te+jKKcNtRJqcDT7rj+XTSgRTmWDUNVQ1Y5io Sp/AOxNdqjY6FRFs7U7BVp6TqYiah6tnY8m1seRlWYkdBvO/bazsWtwnUhIdUspvWY50 rDWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=ntWVZciBCTV9Kx9uHUvm46UpydxIvOSaEf6BmCKHw+8=; b=sFmDvMk9WKbnt2F7w3KALtnVvG8KuZNCsXFEjpPRDeGRgNalVlbPoqWqxUOCGp4bZ9 0FSWfz07DJpLjdUScYjzQjrT0WYi4gAZcWpSBNTumZ1nbJaabff5Q3lIWhKQHe8MqO42 TmU4sO3LiXVfDAfoyaMXcJkuf0pplQM6fVEK8Eh921ceFovrIvNZImLtbhGwmEti1fqp aAshxB+wp0P2pZVDkgvgbn3waETE+/WsCuQKrtpJXnaAohFd513tEkWltNAHMONgbO2L HjuDcewA1z5sncd9pw6fr/t1oSRak4Fpg8+jcg4HNighUuAROhhE55BZ6mRqlsTIHAAb 69fg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si8149047otc.160.2020.02.02.20.17.44; Sun, 02 Feb 2020 20:17:56 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727261AbgBCD30 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 2 Feb 2020 22:29:26 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:2936 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727034AbgBCD30 (ORCPT ); Sun, 2 Feb 2020 22:29:26 -0500 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id C98D5E13684D1791D165; Mon, 3 Feb 2020 11:29:20 +0800 (CST) Received: from dggeme715-chm.china.huawei.com (10.1.199.111) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 3 Feb 2020 11:29:20 +0800 Received: from dggeme763-chm.china.huawei.com (10.3.19.109) by dggeme715-chm.china.huawei.com (10.1.199.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 3 Feb 2020 11:29:20 +0800 Received: from dggeme763-chm.china.huawei.com ([10.6.66.36]) by dggeme763-chm.china.huawei.com ([10.6.66.36]) with mapi id 15.01.1713.004; Mon, 3 Feb 2020 11:29:20 +0800 From: linmiaohe To: Vitaly Kuznetsov , Paolo Bonzini , Sean Christopherson , Jim Mattson CC: kvm list , LKML , "the arch/x86 maintainers" , =?iso-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Wanpeng Li , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" Subject: Re: [PATCH] KVM: nVMX: set rflags to specify success in handle_invvpid() default case Thread-Topic: [PATCH] KVM: nVMX: set rflags to specify success in handle_invvpid() default case Thread-Index: AdXaOs5msQGrd2JlS/qT+AceqW9QkQ== Date: Mon, 3 Feb 2020 03:29:19 +0000 Message-ID: <668e0827d62c489cbf52b7bc5d27ba9b@huawei.com> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.173.221.158] Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Kuznetsov writes: > Sean Christopherson writes: >> On Thu, Jan 23, 2020 at 10:22:24AM -0800, Jim Mattson wrote: >>> On Thu, Jan 23, 2020 at 1:54 AM Paolo Bonzini wrote: >>> > >>> > On 23/01/20 10:45, Vitaly Kuznetsov wrote: >>> > >>> SDM says that "If an >>> > >>> unsupported INVVPID type is specified, the instruction fails." >>> > >>> and this is similar to INVEPT and I decided to check what >>> > >>> handle_invept() does. Well, it does BUG_ON(). >>> > >>> >>> > >>> Are we doing the right thing in any of these cases? >>> > >> >>> > >> Yes, both INVEPT and INVVPID catch this earlier. >>> > >> >>> > >> So I'm leaning towards not applying Miaohe's patch. >>> > > >>> > > Well, we may at least want to converge on BUG_ON() for both >>> > > handle_invvpid()/handle_invept(), there's no need for them to differ. >>> > >>> > WARN_ON_ONCE + nested_vmx_failValid would probably be better, if we >>> > really want to change this. >>> > >>> > Paolo >>> >>> In both cases, something is seriously wrong. The only plausible >>> explanations are compiler error or hardware failure. It would be nice >>> to handle *all* such failures with a KVM_INTERNAL_ERROR exit to >>> userspace. (I'm also thinking of situations like getting a VM-exit >> for >>>> INIT.) >> >> Ya. Vitaly and I had a similar discussion[*]. The idea we tossed >> around was to also mark the VM as having encountered a KVM/hardware >> bug so that the VM is effectively dead. That would also allow >> gracefully handling bugs that are detected deep in the stack, i.e. >> can't simply return 0 to get out to userspace. > >Yea, I was thinking about introducing a big hammer which would stop the whole VM as soon as possible to make it easier to debug such situations. Something like (not really tested): > Yea, please just ignore my origin patch and do what you want. :) I'm sorry for reply in such a big day. I'am just backing from a really hard festival. :(