Re: [PART1 V5 07/13] KVM: x86: Detect and Initialize AVIC support
From: Paolo Bonzini
Date: Tue May 10 2016 - 10:43:14 EST
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