From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/2] KVM: nVMX: invvpid handling improvements Date: Tue, 25 Oct 2016 15:36:38 +0200 Message-ID: <6a4750fc-764b-1556-e9b0-4700fd3b19cd@redhat.com> References: <1476830705-19269-1-git-send-email-jan.dakinevich@gmail.com> <1476830705-19269-2-git-send-email-jan.dakinevich@gmail.com> <20161021200224.GC29131@potion> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, kernellwp@gmail.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Jan Dakinevich Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46372 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933363AbcJYNgn (ORCPT ); Tue, 25 Oct 2016 09:36:43 -0400 In-Reply-To: <20161021200224.GC29131@potion> Sender: kvm-owner@vger.kernel.org List-ID: On 21/10/2016 22:02, Radim Krčmář wrote: >> >> + case VMX_VPID_EXTENT_INDIVIDUAL_ADDR: >> case VMX_VPID_EXTENT_SINGLE_CONTEXT: >> + case VMX_VPID_EXTENT_SINGLE_CONTEXT_RETAINING_GLOBALS: The comment below can be moved here, saying that Hyper-V and old versions of KVM require these cases to be supported: /* * Hyper-V and old versions of KVM require that we support these * cases, even though we cannot really do anything special about * them and treat them as all-context invalidation. */ Paolo >> + if (!vpid) { >> + nested_vmx_failValid(vcpu, >> + VMXERR_INVALID_OPERAND_TO_INVEPT_INVVPID); >> + skip_emulated_instruction(vcpu); >> + return 1; > > (Just break and share the code.) > >> + } >> + /* fall through */ >> + case VMX_VPID_EXTENT_GLOBAL_CONTEXT: >> /* >> - * Old versions of KVM use the single-context version so we >> - * have to support it; just treat it the same as all-context. >> + * Treat any invvpid type as all-context invalidation >> */ >> - case VMX_VPID_EXTENT_GLOBAL_CONTEXT: >> __vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02); >> nested_vmx_succeed(vcpu); >> break;