[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4B0C832B-BB75-40BD-85A9-9DC84DEB44E2@gmail.com>
Date: Fri, 14 Oct 2016 11:50:54 -0700
From: Nadav Amit <nadav.amit@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>,
Yang Zhang <yang.zhang.wz@...il.com>, feng.wu@...el.com,
mst@...hat.com
Subject: Re: [PATCH 1/5] KVM: x86: avoid atomic operations on APICv vmentry
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 23b99f305382..63a442aefc12 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -342,9 +342,11 @@ void __kvm_apic_update_irr(u32 *pir, void *regs)
> u32 i, pir_val;
>
> for (i = 0; i <= 7; i++) {
> - pir_val = xchg(&pir[i], 0);
> - if (pir_val)
> + pir_val = READ_ONCE(pir[i]);
Out of curiosity, do you really need this READ_ONCE?
Powered by blists - more mailing lists