Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp985702imm; Wed, 6 Jun 2018 08:47:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI0+YQN5kpqOrR2I/uSMJnkaTTVs5a4XQfkrdkZphdbl325G1Bg7ma4nGqXFs+7fdEKOQ8q X-Received: by 2002:a63:6b84:: with SMTP id g126-v6mr2918895pgc.272.1528300076893; Wed, 06 Jun 2018 08:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528300076; cv=none; d=google.com; s=arc-20160816; b=wtdbdFkR6hy5WU3e5hLN2DYL8Ov+vli33/oRbUt7bXzyFqzxqxLU19GarztH57pwjz 2PYFnRr+tew53/Ck5xlWwru1yW0KkGHnO2x7LDTRfQ1xC5nUkkyMt9vdr2atvpfiyZJx +TUFCjIOjwap8wu+G0JI/4hbFhMDWCSBhhzSClX+1H+gok8sApW0fCNksKnZWzbkud2w QTlxl+n5DUGe5e5MQTRfC6MYBqLfmLxRjvOIT+EIhMxkl8/Nu9EmBVQY6S2xJkhIlSXu LshEY3/GzlUBbjODY8ZZ3RyFUhdpG9REJFTHeUAdTlN7VEhmxpEB8r8hwJCQrlAiEtHr 3HOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=dsKF9XQGKMUBiyER4fVac3O4fwqqb1re+n02VnyxhOE=; b=EYYPYxbDQH0h3lYsOkYOnpKNTjxml6ra/UTwZr7Fo8GeIDqFMpgPU2b/kEYTVYRkpL 3tF9wRQwjCyLE/XYHlrAi6oRU+DcE4owGVZS3/SvPy99UXABQU+mzJBcw5X8z436MdPa AbYJ/3nPfjqqb5djN2ePN2S8JerPR0KzNt6IhootclkPeYw/84DTsqiFvFp+M/AYBLqw 6EglymtUq+VajwwPX1vKKf08Af0V5ob4teQHgEbv0cpdsTQC12a7k+RZM5TgiY3Ci3QR djtO9LR10uF6tTXLCvhu0KjCAplPvd2PgnlM/I6uXIrLXJYpU6oG+yZsSfhiPyAkJyX6 JwKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n34-v6si50894824pld.91.2018.06.06.08.47.42; Wed, 06 Jun 2018 08:47:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615AbeFFPoI (ORCPT + 99 others); Wed, 6 Jun 2018 11:44:08 -0400 Received: from foss.arm.com ([217.140.101.70]:42212 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbeFFPoH (ORCPT ); Wed, 6 Jun 2018 11:44:07 -0400 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 A17B515AD; Wed, 6 Jun 2018 08:44:06 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 72B8F3F25D; Wed, 6 Jun 2018 08:44:06 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 6AFF81AE53AB; Wed, 6 Jun 2018 16:44:38 +0100 (BST) Date: Wed, 6 Jun 2018 16:44:38 +0100 From: Will Deacon To: Chintan Pandya Cc: catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, toshi.kani@hpe.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Hocko , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Joerg Roedel , stable@vger.kernel.org Subject: Re: [PATCH v13 1/3] ioremap: Update pgtable free interfaces with addr Message-ID: <20180606154437.GE6631@arm.com> References: <1528268481-19299-1-git-send-email-cpandya@codeaurora.org> <1528268481-19299-2-git-send-email-cpandya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528268481-19299-2-git-send-email-cpandya@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 06, 2018 at 12:31:19PM +0530, Chintan Pandya wrote: > From: Chintan Pandya > > The following kernel panic was observed on ARM64 platform due to a stale > TLB entry. > > 1. ioremap with 4K size, a valid pte page table is set. > 2. iounmap it, its pte entry is set to 0. > 3. ioremap the same address with 2M size, update its pmd entry with > a new value. > 4. CPU may hit an exception because the old pmd entry is still in TLB, > which leads to a kernel panic. > > Commit b6bdb7517c3d ("mm/vmalloc: add interfaces to free unmapped page > table") has addressed this panic by falling to pte mappings in the above > case on ARM64. > > To support pmd mappings in all cases, TLB purge needs to be performed > in this case on ARM64. > > Add a new arg, 'addr', to pud_free_pmd_page() and pmd_free_pte_page() > so that TLB purge can be added later in seprate patches. > > [toshi@hpe.com: merge changes, rewrite patch description] > Fixes: 28ee90fe6048 ("x86/mm: implement free pmd/pte page interfaces") > Signed-off-by: Chintan Pandya > Signed-off-by: Toshi Kani > Cc: Andrew Morton > Cc: Michal Hocko > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: Will Deacon > Cc: Joerg Roedel > Cc: > > --- > arch/arm64/mm/mmu.c | 4 ++-- > arch/x86/mm/pgtable.c | 8 +++++--- > include/asm-generic/pgtable.h | 8 ++++---- > lib/ioremap.c | 4 ++-- > 4 files changed, 13 insertions(+), 11 deletions(-) Reviewed-by: Will Deacon Thanks, Will