From: Paolo Bonzini <pbonzini@redhat.com>
To: Liran Alon <liran.alon@oracle.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: LAPIC: ARBPRI is a reserved register for x2APIC
Date: Fri, 5 Jul 2019 14:46:10 +0200 [thread overview]
Message-ID: <e8926d53-173b-c525-1c6e-36df9315337a@redhat.com> (raw)
In-Reply-To: <D76638DF-1934-4B1C-84CD-FFCE11AA175F@oracle.com>
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
>
next prev parent reply other threads:[~2019-07-05 12:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 12:14 Paolo Bonzini
2019-07-05 12:37 ` Liran Alon
2019-07-05 12:46 ` Paolo Bonzini [this message]
2019-07-05 13:37 ` Nadav Amit
2019-07-05 13:43 ` Paolo Bonzini
2019-07-05 13:47 ` Nadav Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e8926d53-173b-c525-1c6e-36df9315337a@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liran.alon@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®