public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, Dongli Zhang <dongli.zhang@oracle.com>,
	 Chao Gao <chao.gao@intel.com>
Subject: Re: [PATCH 6.1.y] KVM: nVMX: Immediately refresh APICv controls as needed on nested VM-Exit
Date: Mon, 5 Jan 2026 12:23:00 -0800	[thread overview]
Message-ID: <aVwdpA-OEkL7rYPh@google.com> (raw)
In-Reply-To: <20251231151153.3146021-1-sashal@kernel.org>

On Wed, Dec 31, 2025, Sasha Levin wrote:
> From: Dongli Zhang <dongli.zhang@oracle.com>
> 
> [ Upstream commit 29763138830916f46daaa50e83e7f4f907a3236b ]
> 
> If an APICv status updated was pended while L2 was active, immediately
> refresh vmcs01's controls instead of pending KVM_REQ_APICV_UPDATE as
> kvm_vcpu_update_apicv() only calls into vendor code if a change is
> necessary.
> 
> E.g. if APICv is inhibited, and then activated while L2 is running:
> 
>   kvm_vcpu_update_apicv()
>   |
>   -> __kvm_vcpu_update_apicv()
>      |
>      -> apic->apicv_active = true
>       |
>       -> vmx_refresh_apicv_exec_ctrl()
>          |
>          -> vmx->nested.update_vmcs01_apicv_status = true
>           |
>           -> return
> 
> Then L2 exits to L1:
> 
>   __nested_vmx_vmexit()
>   |
>   -> kvm_make_request(KVM_REQ_APICV_UPDATE)
> 
>   vcpu_enter_guest(): KVM_REQ_APICV_UPDATE
>   -> kvm_vcpu_update_apicv()
>      |
>      -> __kvm_vcpu_update_apicv()
>         |
>         -> return // because if (apic->apicv_active == activate)
> 
> Reported-by: Chao Gao <chao.gao@intel.com>
> Closes: https://lore.kernel.org/all/aQ2jmnN8wUYVEawF@intel.com
> Fixes: 7c69661e225c ("KVM: nVMX: Defer APICv updates while L2 is active until L1 is active")
> Cc: stable@vger.kernel.org
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> [sean: write changelog]
> Link: https://patch.msgid.link/20251205231913.441872-3-seanjc@google.com
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> [ exported vmx_refresh_apicv_exec_ctrl() and added declaration in vmx.h ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---

Acked-by: Sean Christopherson <seanjc@google.com>

      reply	other threads:[~2026-01-05 20:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 14:28 FAILED: patch "[PATCH] KVM: nVMX: Immediately refresh APICv controls as needed on" failed to apply to 6.1-stable tree gregkh
2025-12-31 15:11 ` [PATCH 6.1.y] KVM: nVMX: Immediately refresh APICv controls as needed on nested VM-Exit Sasha Levin
2026-01-05 20:23   ` Sean Christopherson [this message]

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=aVwdpA-OEkL7rYPh@google.com \
    --to=seanjc@google.com \
    --cc=chao.gao@intel.com \
    --cc=dongli.zhang@oracle.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox