[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ccbd5ad5-efc4-0eef-4c2c-b6cbe730e266@redhat.com>
Date: Wed, 27 Apr 2022 18:19:36 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sasha Levin <sashal@...nel.org>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Chao Gao <chao.gao@...el.com>,
Sean Christopherson <seanjc@...gle.com>, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
x86@...nel.org, kvm@...r.kernel.org
Subject: Re: [PATCH MANUALSEL 5.15 5/7] KVM: x86: Do not change ICR on write
to APIC_SELF_IPI
On 4/27/22 17:54, Sasha Levin wrote:
> From: Paolo Bonzini <pbonzini@...hat.com>
>
> [ Upstream commit d22a81b304a27fca6124174a8e842e826c193466 ]
>
> Emulating writes to SELF_IPI with a write to ICR has an unwanted side effect:
> the value of ICR in vAPIC page gets changed. The lists SELF_IPI as write-only,
> with no associated MMIO offset, so any write should have no visible side
> effect in the vAPIC page.
>
> Reported-by: Chao Gao <chao.gao@...el.com>
> Reviewed-by: Sean Christopherson <seanjc@...gle.com>
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> arch/x86/kvm/lapic.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 4d92fb4fdf69..83d1743a1dd0 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -2125,10 +2125,9 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
> break;
>
> case APIC_SELF_IPI:
> - if (apic_x2apic_mode(apic)) {
> - kvm_lapic_reg_write(apic, APIC_ICR,
> - APIC_DEST_SELF | (val & APIC_VECTOR_MASK));
> - } else
> + if (apic_x2apic_mode(apic))
> + kvm_apic_send_ipi(apic, APIC_DEST_SELF | (val & APIC_VECTOR_MASK), 0);
> + else
> ret = 1;
> break;
> default:
Acked-by: Paolo Bonzini <pbonzini@...hat.com>
Powered by blists - more mailing lists