Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbcK1VMy (ORCPT ); Mon, 28 Nov 2016 16:12:54 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:32838 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755352AbcK1VMh (ORCPT ); Mon, 28 Nov 2016 16:12:37 -0500 MIME-Version: 1.0 In-Reply-To: References: <1479863680-117511-1-git-send-email-dmatlack@google.com> <1479863680-117511-2-git-send-email-dmatlack@google.com> From: David Matlack Date: Mon, 28 Nov 2016 13:11:55 -0800 Message-ID: Subject: Re: [PATCH 1/4] KVM: nVMX: support restore of VMX capability MSRs To: Paolo Bonzini Cc: kvm list , "linux-kernel@vger.kernel.org" , Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 22 On Wed, Nov 23, 2016 at 3:44 AM, Paolo Bonzini wrote: > On 23/11/2016 02:14, David Matlack wrote: >> switch (msr_index) { >> case MSR_IA32_VMX_BASIC: >> + return vmx_restore_vmx_basic(vmx, data); >> + case MSR_IA32_VMX_TRUE_PINBASED_CTLS: >> + case MSR_IA32_VMX_PINBASED_CTLS: >> + case MSR_IA32_VMX_TRUE_PROCBASED_CTLS: >> + case MSR_IA32_VMX_PROCBASED_CTLS: >> + case MSR_IA32_VMX_TRUE_EXIT_CTLS: >> + case MSR_IA32_VMX_EXIT_CTLS: >> + case MSR_IA32_VMX_TRUE_ENTRY_CTLS: >> + case MSR_IA32_VMX_ENTRY_CTLS: > > PINBASED_CTLS, PROCBASED_CTLS, EXIT_CTLS and ENTRY_CTLS can be derived > from their "true" counterparts, so I think it's better to remove the > "non-true" ones from struct nested_vmx (and/or add the "true" ones when > missing) and make them entirely computed. But it can be done on top. Good point. And that would mean userspace does not need to restore the non-true MSRs, right? KVM does not emulate MSR_IA32_VMX_BASIC[55]=0, and will probably never want to.