From patchwork Mon Aug 21 20:35:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= X-Patchwork-Id: 9913739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A32F603F9 for ; Mon, 21 Aug 2017 20:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D5BF2866C for ; Mon, 21 Aug 2017 20:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5245A2868C; Mon, 21 Aug 2017 20:39:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HK_RANDOM_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB5712866C for ; Mon, 21 Aug 2017 20:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o66DjUkhcxoOUSLTtW+K3ylg3Dz6fJRR/DcpO8W+OVs=; b=cvekv+rswrAfZK UWMNH/9zGIN1ENHIZPTQCosfpFrU03gd4sMh3lhWkGUwYA6j6RMguwLIBjSh0i7u057mxeg9xuFYG Eozptrc6q5EFIS33PYwk8FsQMmAZ847jOahpEv2i5zT52oCmJiZD9kqYiWR7EiNEVVAxvbAka33KW OwQlbU33fKjme9d3JBVyTpWi1hP+/g61O57kDHDwtmLw6Bvt//vz6pQkR2QnIoVcwawp0aNxK7w/I Sp8J7wwk4b//MksP9sJjxWFPdjl+qqWQpQwYiJUnaOJPPLi2AxlR6uaWrZKU5BCidNh7RE9umoLc/ /3ZT+BfdHn6GK0EWiqDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1djtU1-00040B-P8; Mon, 21 Aug 2017 20:39:37 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1djtTH-0003Jf-2M for linux-arm-kernel@bombadil.infradead.org; Mon, 21 Aug 2017 20:38:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CN3qb33SDqetgETDzb8USD5QYEFc90ANMBKA9kEOwD0=; b=MGlphb6WqmKez9Yr+W40mw1Tus gSOTngm53kr8Q+R9QB5da60S29c+vDi+cTEJVBXpSj1xorAt6aGdFXxIF2yrzdFAXYK734ATI9W1+ OxyEGvkTSHJXiNTGCEv3EhhLghtVAteeI0Uvj29NtTMQI8wpiYBrDN7EVayysgh3HwciMMQMgvO75 Nc5IFymyO7uEwlsWNcy0MXLYCoy/N6xZSXPwAYUgcGSx5RKnETebCk9iz6ah6N9ojjUYfdTIIhCH8 9yZSwhvgzQD48l5jzNBTppxD7pQ2cWC6Ln33pPAIeR/GUTcwLVxbGzAhg3GmWVxzX9Fgg+Hr/lkGi 59DdOevQ==; Received: from mx1.redhat.com ([209.132.183.28]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1djtTE-0003m7-7z for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2017 20:38:49 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E76E46298; Mon, 21 Aug 2017 20:38:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9E76E46298 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=rkrcmar@redhat.com Received: from flask (unknown [10.43.2.80]) by smtp.corp.redhat.com (Postfix) with SMTP id 7EBAA17C2A; Mon, 21 Aug 2017 20:38:05 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Mon, 21 Aug 2017 22:38:04 +0200 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= To: 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 Subject: [PATCH RFC v3 2/9] KVM: arm/arm64: fix vcpu self-detection in vgic_v3_dispatch_sgi() Date: Mon, 21 Aug 2017 22:35:23 +0200 Message-Id: <20170821203530.9266-3-rkrcmar@redhat.com> In-Reply-To: <20170821203530.9266-1-rkrcmar@redhat.com> References: <20170821203530.9266-1-rkrcmar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 21 Aug 2017 20:38:09 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170821_213848_408244_15E08AFB X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoffer Dall , James Hogan , David Hildenbrand , Marc Zyngier , Cornelia Huck , Paul Mackerras , Christian Borntraeger , Paolo Bonzini , Alexander Graf Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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ář Reviewed-by: David Hildenbrand Acked-by: Christoffer Dall --- 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) {