lkml.org 
[lkml]   [2019]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: LAPIC: ARBPRI is a reserved register for x2APIC
From
Date
On 05/07/19 14:37, Liran Alon wrote:
>> + u64 rmask = 0x43ff01ffffffe70cULL;
> Why not rename this to “used_bits_mask” and calculate it properly by macros?
> It seems a lot nicer than having a pre-calculated magic.

Yes, I wanted to do the same but I didn't have time right now. I am
planning to cleanup after the merge window, but if a patch comes soon I
can apply it instead of course. :)

Something like

#define APIC_VALID_REG_MASK(reg) (1ull << ((reg) >> 4))
#define APIC_VALID_REGS_MASK(first, count) \
(APIC_VALID_REG_MASK(first) * (1ull << ((count) - 1)))

followed by

if (offset > 0x3f0 ||
!(valid_regs_mask & APIC_VALID_REG_MASK(offset))

Paolo

> -Liran
>

\
 
 \ /
  Last update: 2019-07-05 14:47    [W:0.096 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site