From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753780AbdKILKe (ORCPT ); Thu, 9 Nov 2017 06:10:34 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:47735 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644AbdKILKc (ORCPT ); Thu, 9 Nov 2017 06:10:32 -0500 X-Google-Smtp-Source: AGs4zMaHMpkuQq3L4qg5u0nxYkBgxKo1nlD8NevR8vKUp1X4cfxEA9u8uU5TvF9foY+Yaegpt+7+Pudy2KW+GX5+ldk= MIME-Version: 1.0 In-Reply-To: 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: Wanpeng Li Date: Thu, 9 Nov 2017 19:10:31 +0800 Message-ID: Subject: Re: [PATCH v5 3/3] KVM: nVMX: Fix mmu context after VMLAUNCH/VMRESUME failure To: Paolo Bonzini Cc: Jim Mattson , Krish Sadhukhan , LKML , kvm list , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2017-11-09 19:05 GMT+08:00 Paolo Bonzini : > 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. Fair enough. I will find time to do this recently. I guess Radim can apply the whole patchset today. :) Regards, Wanpeng Li