From patchwork Tue Jun 30 10:34:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 489633 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6EA071402CF for ; Tue, 30 Jun 2015 20:38:32 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9ssy-0005JS-QB; Tue, 30 Jun 2015 10:35:28 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9ssw-0004Wq-Ag for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2015 10:35:26 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 283D3317; Tue, 30 Jun 2015 03:35:30 -0700 (PDT) Received: from [10.1.209.148] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B1DFE3F447; Tue, 30 Jun 2015 03:35:00 -0700 (PDT) Message-ID: <559270D3.8030305@arm.com> Date: Tue, 30 Jun 2015 11:34:59 +0100 From: Marc Zyngier Organization: ARM Ltd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: =?UTF-8?B?RGlyayBNw7xsbGVy?= Subject: Re: Regular oops on shutdown of KVM/ARM64 machines with VGA device References: <20150629100304.GB18931@leverpostej> <55914033.5060008@arm.com> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150630_033526_385134_F1BECAD1 X-CRM114-Status: GOOD ( 16.26 ) X-Spam-Score: -7.5 (-------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-7.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.101.70 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mark Rutland , Alexander Graf , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On 30/06/15 08:54, Dirk Müller wrote: > Hi Marc, > >> Also, care to provide some hints about your kernel configuration? > > I believe the relevant parameters are: > > CONFIG_PGTABLE_LEVELS=4 > # CONFIG_ARM64_64K_PAGES is not set > # CONFIG_ARM64_VA_BITS_39 is not set > CONFIG_ARM64_VA_BITS_48=y > CONFIG_ARM64_VA_BITS=48 > CONFIG_KVM_MMIO=y > CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y > CONFIG_KVM_COMPAT=y > CONFIG_VIRTUALIZATION=y > CONFIG_KVM=y > CONFIG_KVM_ARM_HOST=y > CONFIG_KVM_ARM_MAX_VCPUS=4 > > > the full config is here: http://pastebin.com/raw.php?i=GKAaVLYE > >> What is the VGA device you mention in $subject? >> A QEMU command line so that we can try and reproduce the issue you're >> seeing? > > with qemu 2.3.0: > > qemu-system-aarch64 --enable-kvm -M virt -cpu host -vnc :4 -bios > /usr/share/qemu/qemu-uefi-aarch64.bin -m 1G -device VGA > > then connecting to the vnc to cause the VGA device to be initialized, > and then simply ctrl-c'ing the qemu process, you'll get this crash > 100% of each and every time. If you want additional debug output or > try out something, just let me know and I'll be happy to provide you > with it. Can try the following patch? It seems to fix the issue for me, though with a relatively different configuration. Thanks, M. diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 7b42012..d902a53 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -109,7 +109,7 @@ static void kvm_flush_dcache_pud(pud_t pud) */ static void stage2_dissolve_pmd(struct kvm *kvm, phys_addr_t addr, pmd_t *pmd) { - if (!kvm_pmd_huge(*pmd)) + if (pmd_none(*pmd) || !kvm_pmd_huge(*pmd)) return; pmd_clear(pmd);