Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753961AbdGJMPK (ORCPT ); Mon, 10 Jul 2017 08:15:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753673AbdGJMPJ (ORCPT ); Mon, 10 Jul 2017 08:15:09 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BE8CDC04B941 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=david@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BE8CDC04B941 Subject: Re: [PATCH 2/3 v2] KVM: nVMX: Enable VMFUNC for the L1 hypervisor To: Paolo Bonzini , Bandan Das , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20170706230323.29952-1-bsd@redhat.com> <20170706230323.29952-3-bsd@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Mon, 10 Jul 2017 14:15:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 10 Jul 2017 12:15:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 813 Lines: 31 On 10.07.2017 13:03, Paolo Bonzini wrote: > > > On 10/07/2017 11:17, David Hildenbrand wrote: >>> + >>> + vmcs12 = get_vmcs12(vcpu); >>> + if ((vmcs12->vm_function_control & (1 << function)) == 0) >> (learned that in c, shifting beyond the type size is undefined) >> >> Should we check for function < 64 here? (as SDM mentions) > > It should be already. The manual says: > > The VMFUNC instruction causes an invalid-opcode exception (#UD) if the > “enable VM functions” VM-execution controls is 0 1 or the value of EAX > is greater than 63 (only VM functions 0–63 can be enable). Otherwise, > the instruction causes a VM exit if the bit at position EAX is 0 in the > VM-function controls (the selected VM function is not enabled). > Thanks, I missed that paragraph. > Paolo > -- Thanks, David