From patchwork Thu Nov 15 15:14:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Hao X-Patchwork-Id: 10683623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 233D014D6 for ; Thu, 15 Nov 2018 06:52:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10BCE2C211 for ; Thu, 15 Nov 2018 06:52:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 050092C228; Thu, 15 Nov 2018 06:52:31 +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=-1.7 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 134CF2C22A for ; Thu, 15 Nov 2018 06:52:29 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=Qf5nA8JtAk809V6JxLbwTBHwReaBMVpAUdbCzqgfA2E=; b=gBk H0txmfbbuwEk4mWEsvcSNBBT1nPZEz/qC0oJ2SSCoqCw6R98pS3UJ1uA5Qg5Ciin5Iok5UVhuBrQ9 nOm8tI5MZ3NBISpwG+KW42UaivLJG8Zih73thLwoWWnbClh8h3xldUL0f3AEbTgmInt8x2sy9q4Qr e+a4Udk8ZQxIH3BRfzfJkvLZ23eaEK6z852S8iv7MmAnrvGdPvb1INMKqyiqp5DZoKRuQ8FXpF6kC BLNylHgClnXIDqZDNRJH3awqnGQ5O9RLm6f7GEd4PNgaj0ZxoHUwYTrQjOo9zJZuBcu8LU4yQiQVq d/gJcO++wA358xaiV5qD13b4JmZjwcQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNBVq-0007cL-H8; Thu, 15 Nov 2018 06:52:26 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNBVp-0007cE-2r for linux-arm-kernel@bombadil.infradead.org; Thu, 15 Nov 2018 06:52:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=WsYisKOVKssxE72P3evEe6Qd0i4Y3XVjv2770oVPQ9U=; b=e4XCKbObFRpUh2TqmJSCrNcO+ o/LgtfcGQypQns2nYXW58tITs8aRdQtHRLLzGJIOGqVmF0g4tuq1QOBlP4SUx3+RaOU3FAdjuKavw NZqkgY0t7/cjQvpSFPX09yBjKKLP/VqtQwi9kkAC9jGGxNE824ei911N0HVeW/Cc8uLztZf+BlNLe RUAAKs5GOBITXb4QjnV8es3iK4Kp8rS8g0jyT1/iEYmDEuHeFHnSGKZmIgnlsRHid1cBbgCqpEuHo PWipR5PM4oOCnWStHCtE1YCGwNUOYn/PCB48eXBKq8oEZZMjqEHHb7xWsnHtAmxAR4+gxaaHFQT1p wfJ/CLsmA==; Received: from mxhk.zte.com.cn ([63.217.80.70]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNBVh-0007zG-JP for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2018 06:52:20 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id BBFEBC0FA753D29C14F9; Thu, 15 Nov 2018 14:51:56 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAF6phup015813; Thu, 15 Nov 2018 14:51:43 +0800 (GMT-8) (envelope-from peng.hao2@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.74.120.59]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018111514521267-10831359 ; Thu, 15 Nov 2018 14:52:12 +0800 From: Peng Hao To: christoffer.dall@arm.com, marc.zyngier@arm.com Subject: [PATCH] kvm: arm/arm64 : fix vm's hanging at startup time Date: Thu, 15 Nov 2018 23:14:08 +0800 Message-Id: <1542294848-73839-1-git-send-email-peng.hao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-15 14:52:12, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-15 14:51:31, Serialize complete at 2018-11-15 14:51:31 X-MAIL: mse01.zte.com.cn wAF6phup015813 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181115_065219_019810_B227B3B5 X-CRM114-Status: GOOD ( 11.51 ) 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: Peng Hao , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 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 When virtual machine starts, hang up. The kernel version of guest is 4.16. Host support vgic_v3. It was mainly due to the incorrect vgic_irq's(intid=27) group value during injection interruption. when kvm_vgic_vcpu_init is called, dist is not initialized at this time. Unable to get vgic V3 or V2 correctly, so group is not set. group is setted to 1 when vgic_mmio_write_group is invoked at some time. when irq->group=0 (intid=27), No ICH_LR_GROUP flag was set and interrupt injection failed. Signed-off-by: Peng Hao --- virt/kvm/arm/vgic/vgic-v3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c index 9c0dd23..d101000 100644 --- a/virt/kvm/arm/vgic/vgic-v3.c +++ b/virt/kvm/arm/vgic/vgic-v3.c @@ -198,7 +198,7 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr) if (vgic_irq_is_mapped_level(irq) && (val & ICH_LR_PENDING_BIT)) irq->line_level = false; - if (irq->group) + if (model == KVM_DEV_TYPE_ARM_VGIC_V3) val |= ICH_LR_GROUP; val |= (u64)irq->priority << ICH_LR_PRIORITY_SHIFT;