From: Paolo Bonzini Subject: Re: [PATCH 2/4] KVM: nVMX: fix checks on CR{0,4} during virtual VMX operation Date: Wed, 23 Nov 2016 12:31:14 +0100 Message-ID: References: <1479863680-117511-1-git-send-email-dmatlack@google.com> <1479863680-117511-3-git-send-email-dmatlack@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linux-kernel@vger.kernel.org, jmattson@google.com, rkrcmar@redhat.com To: David Matlack , kvm@vger.kernel.org Return-path: In-Reply-To: <1479863680-117511-3-git-send-email-dmatlack@google.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 23/11/2016 02:14, David Matlack wrote: > +static bool fixed_bits_valid(u64 val, u64 fixed0, u64 fixed1) > +{ > + return ((val & fixed0) == fixed0) && ((~val & ~fixed1) == ~fixed1); > +} > + This is the same as vmx_control_verify (except with u64 arguments instead of u32). Paolo