From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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> Sender: stable-owner@vger.kernel.org List-ID: 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