From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbaEOQ2H (ORCPT ); Thu, 15 May 2014 12:28:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47169 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbaEOQ2E (ORCPT ); Thu, 15 May 2014 12:28:04 -0400 Message-ID: <1400171258.21547.136.camel@deneb.redhat.com> Subject: Re: [PATCH] arm64: fix pud_huge() for 2-level pagetables From: Mark Salter To: Steve Capper Cc: Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 15 May 2014 12:27:38 -0400 In-Reply-To: <20140515144424.GA23884@linaro.org> References: <1400163562-7481-1-git-send-email-msalter@redhat.com> <20140515144424.GA23884@linaro.org> Organization: Red Hat, Inc Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2014-05-15 at 15:44 +0100, Steve Capper wrote: > On Thu, May 15, 2014 at 10:19:22AM -0400, Mark Salter wrote: > > The following happens when trying to run a kvm guest on a kernel > > configured for 64k pages. This doesn't happen with 4k pages: > > > > BUG: failure at include/linux/mm.h:297/put_page_testzero()! > > Kernel panic - not syncing: BUG! > > CPU: 2 PID: 4228 Comm: qemu-system-aar Tainted: GF 3.13.0-0.rc7.31.sa2.k32v1.aarch64.debug #1 > > Call trace: > > [] dump_backtrace+0x0/0x16c > > [] show_stack+0x14/0x1c > > [] dump_stack+0x84/0xb0 > > [] panic+0xf4/0x220 > > [] free_reserved_area+0x0/0x110 > > [] free_pages+0x50/0x88 > > [] kvm_free_stage2_pgd+0x30/0x40 > > [] kvm_arch_destroy_vm+0x18/0x44 > > [] kvm_put_kvm+0xf0/0x184 > > [] kvm_vm_release+0x10/0x1c > > [] __fput+0xb0/0x288 > > [] ____fput+0xc/0x14 > > [] task_work_run+0xa8/0x11c > > [] do_notify_resume+0x54/0x58 > > > > In arch/arm/kvm/mmu.c:unmap_range(), we end up doing an extra put_page() > > on the stage2 pgd which leads to the BUG in put_page_testzero(). This > > happens because a pud_huge() test in unmap_range() returns true when it > > should always be false with 2-level pages tables used by 64k pages. > > This patch removes support for huge puds if 2-level pagetables are > > being used. > > Hi Mark, > I'm still catching up with myself, sorry (was off sick for a couple > of days)... > > I thought unmap_range was going to be changed? > Does the following help things? > https://lists.cs.columbia.edu/pipermail/kvmarm/2014-May/009388.html No, I get the same BUG. Regardless, pud_huge() should always return false for 2-level pagetables, right?