From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753832AbdKILFV (ORCPT ); Thu, 9 Nov 2017 06:05:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42112 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752821AbdKILFR (ORCPT ); Thu, 9 Nov 2017 06:05:17 -0500 Subject: Re: [PATCH v5 3/3] KVM: nVMX: Fix mmu context after VMLAUNCH/VMRESUME failure To: Wanpeng Li Cc: Jim Mattson , Krish Sadhukhan , LKML , kvm list , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li References: <1509670249-4907-1-git-send-email-wanpeng.li@hotmail.com> <1509670249-4907-3-git-send-email-wanpeng.li@hotmail.com> <50b82c53-1e57-88a9-25bd-76697bf2d048@oracle.com> <3201561c-55c4-8edb-41bc-d4247520f61c@redhat.com> From: Paolo Bonzini Message-ID: Date: Thu, 9 Nov 2017 12:05:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 09 Nov 2017 11:05:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/11/2017 11:47, Wanpeng Li wrote: > 2017-11-09 18:40 GMT+08:00 Paolo Bonzini : >> On 09/11/2017 01:37, Wanpeng Li wrote: >>> 2017-11-09 5:47 GMT+08:00 Jim Mattson : >>>> I realize now that there are actually many other problems with >>>> deferring some control field checks to the hardware VM-entry of >>>> vmcs02. When there is an invalid control field, the vCPU should just >>>> fall through to the next instruction, without any state modifiation >>>> other than the ALU flags and the VM-instruction error field of the >>>> current VMCS. However, in preparation for the hardware VM-entry of >>>> vmcs02, we have already changed quite a bit of the vCPU state: the >>>> MSRs on the VM-entry MSR-load list, DR7, IA32_DEBUGCTL, the entire >>>> FLAGS register, etc. All of these changes should be undone, and we're >>>> not prepared to do that. (For instance, what was the old DR7 value >>>> that needs to be restored?) >>> I didn't observe real issue currently, and I hope this patchset can >>> catch the upcoming merge window. Then we can dig more into your >>> concern. >> >> Can any of you write a simple testcase for just one bug (e.g. DR7)? > > Jim you can have a try for your concern, I have already tried tons of > stress testing and didn't observe any issue. You need to craft a testcase for kvm-unit-tests. No stress testing will find an issue. Your patch is fine, but Jim is saying that we cannot really skip the check for invalid control fields. It's a more general issue that can be fixed by adding explicit checks in KVM. Paolo