From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbcEJOnM (ORCPT ); Tue, 10 May 2016 10:43:12 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37191 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbcEJOnK (ORCPT ); Tue, 10 May 2016 10:43:10 -0400 Subject: Re: [PART1 V5 07/13] KVM: x86: Detect and Initialize AVIC support To: Borislav Petkov , Suravee Suthikulpanit References: <1462388992-25242-1-git-send-email-Suravee.Suthikulpanit@amd.com> <1462388992-25242-8-git-send-email-Suravee.Suthikulpanit@amd.com> <20160510091447.GA16752@pd.tnic> Cc: rkrcmar@redhat.com, joro@8bytes.org, gleb@kernel.org, alex.williamson@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, wei@redhat.com, sherry.hurwitz@amd.com From: Paolo Bonzini Message-ID: <5731F379.9080309@redhat.com> Date: Tue, 10 May 2016 16:43:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160510091447.GA16752@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/2016 11:14, Borislav Petkov wrote: >> > +#define AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK (0xFF) >> > +#define AVIC_LOGICAL_ID_ENTRY_VALID_MASK (1 << 31) >> > + >> > +#define AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK (0xFFULL) >> > +#define AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK (0xFFFFFFFFFFULL << 12) >> > +#define AVIC_PHYSICAL_ID_ENTRY_IS_RUNNING_MASK (1ULL << 62) >> > +#define AVIC_PHYSICAL_ID_ENTRY_VALID_MASK (1ULL << 63) > Those defines could be shortened a little. Maybe > > #define AVIC_PHYSID_HOST_PHYS_MASK > #define AVIC_PHYSID_BACKING_PG_MASK That was actually our suggestion. Despite the long names, the lines do not come out too long because the masks are only used for writing fields, not very much for reading them (e.g. in complex "if" conditions). Paolo