Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932652AbdHVLnO (ORCPT ); Tue, 22 Aug 2017 07:43:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932561AbdHVLnL (ORCPT ); Tue, 22 Aug 2017 07:43:11 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D058E83F42 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Subject: Re: [PATCH RFC v3 2/9] KVM: arm/arm64: fix vcpu self-detection in vgic_v3_dispatch_sgi() To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-mips@linux-mips.org, kvm-ppc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Paolo Bonzini , Christoffer Dall , Marc Zyngier , Christian Borntraeger , Cornelia Huck , James Hogan , Paul Mackerras , Alexander Graf References: <20170821203530.9266-1-rkrcmar@redhat.com> <20170821203530.9266-3-rkrcmar@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 22 Aug 2017 13:43:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170821203530.9266-3-rkrcmar@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 22 Aug 2017 11:43:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1167 Lines: 41 On 21.08.2017 22:35, Radim Krčmář wrote: > The index in kvm->vcpus array and vcpu->vcpu_id are very different > things. Comparing struct kvm_vcpu pointers is a sure way to know. > > Signed-off-by: Radim Krčmář > --- > virt/kvm/arm/vgic/vgic-mmio-v3.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c > index 408ef06638fc..9d4b69b766ec 100644 > --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c > +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c > @@ -797,7 +797,6 @@ void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg) > u16 target_cpus; > u64 mpidr; > int sgi, c; > - int vcpu_id = vcpu->vcpu_id; > bool broadcast; > > sgi = (reg & ICC_SGI1R_SGI_ID_MASK) >> ICC_SGI1R_SGI_ID_SHIFT; > @@ -821,7 +820,7 @@ void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg) > break; > > /* Don't signal the calling VCPU */ > - if (broadcast && c == vcpu_id) > + if (broadcast && c_vcpu == vcpu) > continue; > > if (!broadcast) { > Yes, this looks correct to me. Reviewed-by: David Hildenbrand -- Thanks, David