From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Andrew Cooper <amc96@srcf.net>,
Oleksii Kurochko <oleksii.kurochko@gmail.com>,
Grygorii Strashko <grygorii_strashko@epam.com>
Subject: Re: [PATCH for-4.21??? 2/3] x86/vLAPIC: drop VLAPIC_VERSION
Date: Wed, 8 Oct 2025 18:23:03 +0200 [thread overview]
Message-ID: <aOaP54CZw8lgLLUv@Mac.lan> (raw)
In-Reply-To: <feb47fa6-27a0-4cf7-8fc6-bf5f29f467c1@suse.com>
On Wed, Oct 08, 2025 at 02:08:48PM +0200, Jan Beulich wrote:
> In preparation of making the value somewhat dynamic drop the constant.
> Replace its use in guest_wrmsr_x2apic() by actually fetching the LVR
> value.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/hvm/vlapic.c
> +++ b/xen/arch/x86/hvm/vlapic.c
> @@ -31,7 +31,6 @@
> #include <public/hvm/ioreq.h>
> #include <public/hvm/params.h>
>
> -#define VLAPIC_VERSION 0x00050014
> #define LVT_BIAS(reg) (((reg) - APIC_LVTT) >> 4)
>
> #define LVTS \
> @@ -1015,7 +1014,7 @@ int guest_wrmsr_x2apic(struct vcpu *v, u
> case APIC_SPIV:
> if ( val & ~(APIC_VECTOR_MASK | APIC_SPIV_APIC_ENABLED |
> APIC_SPIV_FOCUS_DISABLED |
> - (VLAPIC_VERSION & APIC_LVR_DIRECTED_EOI
> + (vlapic_get_reg(vlapic, APIC_LVR) & APIC_LVR_DIRECTED_EOI
> ? APIC_SPIV_DIRECTED_EOI : 0)) )
> return X86EMUL_EXCEPTION;
> break;
> @@ -1439,7 +1438,7 @@ static void vlapic_do_init(struct vlapic
> if ( !has_vlapic(vlapic_vcpu(vlapic)->domain) )
> return;
>
> - vlapic_set_reg(vlapic, APIC_LVR, VLAPIC_VERSION);
> + vlapic_set_reg(vlapic, APIC_LVR, 0x00050014);
(Maybe I'm getting ahead of patch 3, as I haven't looked yet)
Don't we want to use some kind of macros to build this in a more
friendly way?
We could have a pair of SET_APIC_{VERSION,MAXLVT}()?
Thanks, Roger.
next prev parent reply other threads:[~2025-10-08 16:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 12:07 [PATCH for-4.21??? 0/3] x86/vLAPIC: CMCI LVT handling Jan Beulich
2025-10-08 12:08 ` [PATCH for-4.21??? 1/3] x86/vLAPIC: add indirection to " Jan Beulich
2025-10-08 13:04 ` Andrew Cooper
2025-10-08 14:05 ` Jan Beulich
2025-10-08 14:22 ` Jan Beulich
2025-10-09 14:56 ` Grygorii Strashko
2025-10-09 15:31 ` Jan Beulich
2025-10-09 16:16 ` Grygorii Strashko
2025-10-10 5:32 ` Jan Beulich
2025-10-10 14:44 ` Roger Pau Monné
2025-10-13 6:31 ` Jan Beulich
2025-10-08 12:08 ` [PATCH for-4.21??? 2/3] x86/vLAPIC: drop VLAPIC_VERSION Jan Beulich
2025-10-08 16:23 ` Roger Pau Monné [this message]
2025-10-09 7:21 ` Jan Beulich
2025-10-10 13:52 ` Roger Pau Monné
2025-10-08 12:09 ` [PATCH for-4.21??? 3/3] x86/vLAPIC: properly support the CMCI LVT Jan Beulich
2025-10-09 15:08 ` Grygorii Strashko
2025-10-09 15:37 ` Jan Beulich
2025-10-14 14:12 ` Grygorii Strashko
2025-10-14 15:31 ` Jan Beulich
2025-10-14 19:36 ` Andrew Cooper
2025-10-15 6:30 ` Jan Beulich
2025-10-09 13:58 ` [PATCH for-4.21??? 0/3] x86/vLAPIC: CMCI LVT handling Oleksii Kurochko
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=aOaP54CZw8lgLLUv@Mac.lan \
--to=roger.pau@citrix.com \
--cc=amc96@srcf.net \
--cc=andrew.cooper3@citrix.com \
--cc=grygorii_strashko@epam.com \
--cc=jbeulich@suse.com \
--cc=oleksii.kurochko@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.