From: Maxim Levitsky <mlevitsk@redhat.com>
To: lirongqing@baidu.com, kvm@vger.kernel.org
Subject: Re: [RFC][PATCH] kvm: i8254: Deactivate APICv when using in-kernel PIT re-injection mode.
Date: Mon, 06 Feb 2023 11:10:23 +0200 [thread overview]
Message-ID: <8a9deed754bb45cf48fa8562850dadc511bbd4df.camel@redhat.com> (raw)
In-Reply-To: <1675673814-23372-1-git-send-email-lirongqing@baidu.com>
On Mon, 2023-02-06 at 16:56 +0800, lirongqing@baidu.com wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> Intel VMX APICv accelerates EOI write and does not trap. This causes
> in-kernel PIT re-injection mode to fail since it relies on irq-ack
> notifier mechanism. So, APICv is activated only when in-kernel PIT
> is in discard mode e.g. w/ qemu option:
>
> -global kvm-pit.lost_tick_policy=discard
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index fe5615f..16952a9 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -8051,7 +8051,8 @@ static bool vmx_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
> BIT(APICV_INHIBIT_REASON_HYPERV) |
> BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
> BIT(APICV_INHIBIT_REASON_APIC_ID_MODIFIED) |
> - BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
> + BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED) |
> + BIT(APICV_INHIBIT_REASON_PIT_REINJ);
>
> return supported & BIT(reason);
> }
AFAIK, APICv has EOI exiting bitmap, for this exact purpose, it allows to trap only some
vectors when EOI is performed.
KVM uses it so APICv shouldn't need this inhibit but it is possible that something got broken.
Take a look at vcpu_load_eoi_exitmap.
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2023-02-06 9:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 8:56 [RFC][PATCH] kvm: i8254: Deactivate APICv when using in-kernel PIT re-injection mode lirongqing
2023-02-06 9:10 ` Maxim Levitsky [this message]
2023-02-07 3:17 ` Li,Rongqing
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=8a9deed754bb45cf48fa8562850dadc511bbd4df.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lirongqing@baidu.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 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.