Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756423AbcKWLbU (ORCPT ); Wed, 23 Nov 2016 06:31:20 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32926 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756099AbcKWLbS (ORCPT ); Wed, 23 Nov 2016 06:31:18 -0500 Subject: Re: [PATCH 2/4] KVM: nVMX: fix checks on CR{0,4} during virtual VMX operation To: David Matlack , kvm@vger.kernel.org References: <1479863680-117511-1-git-send-email-dmatlack@google.com> <1479863680-117511-3-git-send-email-dmatlack@google.com> Cc: linux-kernel@vger.kernel.org, jmattson@google.com, rkrcmar@redhat.com From: Paolo Bonzini Message-ID: Date: Wed, 23 Nov 2016 12:31:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1479863680-117511-3-git-send-email-dmatlack@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 286 Lines: 13 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