Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754973AbcK1Tvr (ORCPT ); Mon, 28 Nov 2016 14:51:47 -0500 Received: from mail-qt0-f170.google.com ([209.85.216.170]:35435 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbcK1Tvk (ORCPT ); Mon, 28 Nov 2016 14:51:40 -0500 MIME-Version: 1.0 In-Reply-To: References: <1479863680-117511-1-git-send-email-dmatlack@google.com> <1479863680-117511-3-git-send-email-dmatlack@google.com> From: David Matlack Date: Mon, 28 Nov 2016 11:51:09 -0800 Message-ID: Subject: Re: [PATCH 2/4] KVM: nVMX: fix checks on CR{0,4} during virtual VMX operation 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: 418 Lines: 12 On Wed, Nov 23, 2016 at 3:31 AM, Paolo Bonzini wrote: > 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). Good point. I'll remove this duplication in v3.