Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4408626pxa; Mon, 10 Aug 2020 08:25:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/lKYYdlgbxzeaE1yUGq4DjUy8mSvf22mu7G7SpWpMCEqVyYZJqduNxGCj/0rHH/lDgEkg X-Received: by 2002:a17:906:c7d4:: with SMTP id dc20mr23318339ejb.283.1597073115756; Mon, 10 Aug 2020 08:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597073115; cv=none; d=google.com; s=arc-20160816; b=WgAhex2MTPhvws0wMicB5COm5FYcA3zpB836E+t1l3aRMKsKLQLB2GTwU+l6vcY8ph KWOe3TpN24TgIMaihEAAdOdELbDj8j+qQJ9KZWsY1t+WzDoAjCW6o++aK+Ec9KHR7W0T 8cT7Ws08hXFpM2s61AaeXeusPeHZTPfuQf9Oje4AwM/WUXCBlCt/sMpuK4Xca9H4kG71 XhnemlpgLp6mAeIyJyi62QU98LE58do4bJGWcjGEQOoRinSa/CCzZPisdl8W/X1JrOOY 0QE7JOOsAR758qStUDohtR9vXYz+4mmdtxhi+NHVlKrx4Vq/KKxh0r3Y6NszmMweWIG+ /jRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sPrX8XHxbBYfH/ZXMiKPHBSd2bG/cPdI7LdXQpzWVCU=; b=ssvlPdCv5pF6YMmER5fK8ctOH8p1eI3KNuhb6Q+yBl1RcR5SWHO8GuHJHcxCP3hWpY gQK+Oh5ZiKxappr0UdHufoBLWZXgFfYKC8zUAbpNYZbQ8rQtQGXWiPRvYFpYeA1xcjYM Zwn/ffYVnaZER3w6D6MsboH4a2uT9B8bRJF0zRXJlto1ilVK4ntqUwnl5GIB9quR6zV7 GCoNwlVunr018qlXV1lNKwLcu6gsqwOkWydLGV6Ya2Rdy3RtbUXiY7PIOXKK9tmKa15q bMFlkrhapSqcntD05IIkMf6HNRcDpgXqGnAmOEPUFTxIw1Ftj95CA5KbK1B0vKDEjPOU Qvew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c6FTiznw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd28si10504421edb.460.2020.08.10.08.24.52; Mon, 10 Aug 2020 08:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c6FTiznw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbgHJPUb (ORCPT + 99 others); Mon, 10 Aug 2020 11:20:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:50898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727982AbgHJPU2 (ORCPT ); Mon, 10 Aug 2020 11:20:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9316620656; Mon, 10 Aug 2020 15:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597072828; bh=58qp4gOupZaoLJO0q94LemFcLAKgWx1mlx/wmqqzCws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6FTiznwZ4dkzUQWHeLLpoTmuZs7KfP5bXesdc124wBIWJfpvBY+oLFlgNdH9Vut0 cZEnCQJEe9V6//CLxDE3UYJlwcSieUskqPESXZWVhAn8CESCc28eQIpV5brGGR7tkR 43U+JA7BqT/YRkAVT4jCZdAG3TJPFYQbltaLOjMA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Erhard F." , Christophe Leroy , Michael Ellerman Subject: [PATCH 5.8 32/38] Revert "powerpc/kasan: Fix shadow pages allocation failure" Date: Mon, 10 Aug 2020 17:19:22 +0200 Message-Id: <20200810151805.497933109@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810151803.920113428@linuxfoundation.org> References: <20200810151803.920113428@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy commit b506923ee44ae87fc9f4de16b53feb313623e146 upstream. This reverts commit d2a91cef9bbdeb87b7449fdab1a6be6000930210. This commit moved too much work in kasan_init(). The allocation of shadow pages has to be moved for the reason explained in that patch, but the allocation of page tables still need to be done before switching to the final hash table. First revert the incorrect commit, following patch redoes it properly. Fixes: d2a91cef9bbd ("powerpc/kasan: Fix shadow pages allocation failure") Cc: stable@vger.kernel.org Reported-by: Erhard F. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=208181 Link: https://lore.kernel.org/r/3667deb0911affbf999b99f87c31c77d5e870cd2.1593690707.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/kasan.h | 2 ++ arch/powerpc/mm/init_32.c | 2 ++ arch/powerpc/mm/kasan/kasan_init_32.c | 4 +--- 3 files changed, 5 insertions(+), 3 deletions(-) --- a/arch/powerpc/include/asm/kasan.h +++ b/arch/powerpc/include/asm/kasan.h @@ -27,10 +27,12 @@ #ifdef CONFIG_KASAN void kasan_early_init(void); +void kasan_mmu_init(void); void kasan_init(void); void kasan_late_init(void); #else static inline void kasan_init(void) { } +static inline void kasan_mmu_init(void) { } static inline void kasan_late_init(void) { } #endif --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c @@ -171,6 +171,8 @@ void __init MMU_init(void) btext_unmap(); #endif + kasan_mmu_init(); + setup_kup(); /* Shortly after that, the entire linear mapping will be available */ --- a/arch/powerpc/mm/kasan/kasan_init_32.c +++ b/arch/powerpc/mm/kasan/kasan_init_32.c @@ -117,7 +117,7 @@ static void __init kasan_unmap_early_sha kasan_update_early_region(k_start, k_end, __pte(0)); } -static void __init kasan_mmu_init(void) +void __init kasan_mmu_init(void) { int ret; struct memblock_region *reg; @@ -146,8 +146,6 @@ static void __init kasan_mmu_init(void) void __init kasan_init(void) { - kasan_mmu_init(); - kasan_remap_early_shadow_ro(); clear_page(kasan_early_shadow_page);