Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3395839lkq; Mon, 23 Nov 2020 04:45:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWm0gwsyxeCsHkKipzOexm3XXmeLHcU41i9U1MncHpsDx3AhipCK7mHjt+sSYjMGX4RyFt X-Received: by 2002:a50:dac7:: with SMTP id s7mr45073836edj.106.1606135539601; Mon, 23 Nov 2020 04:45:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606135539; cv=none; d=google.com; s=arc-20160816; b=jKQM0YPkcw3gIhrsOb6TZee8GoAAg7buBLiKPImpL07NgitxjXX/8wvevBgjfx6Gb0 U6GL+EtTNJOysHMsyhlHL6FxKF5Vy1tv3TKxX9Ipx4mXqu7nvxKvdBsMR1pMEegcPh+v JSivWNM/n9ob4u7iP67sdzfjaoVpDXQfWwFrlo0eGNp616cRIxvQcdglyBg23pz2DVj1 ZZrvmVzmW6lZ5UnMXFAA77lO9Q0g3CKUKiGyGaPhyYKMM5LjYKp2EPyHfAp4MlgcdwE9 ZaPDZRhSiCJdR/XuvJKZrj8w+Uwm5HvbRZOSANKn5TD3c+q20JgGsR+XuSuyNl/xPDjF OyAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E8aqRZaOTeuMENxJa2kcEeokIro4jLJDycYtlmWI9EM=; b=0ZU8q87ZcgpS7wtMU97iUtPlHiJayvdok8QRpTXyENAdCjKGdwpCxIUGYsAbfWDOuz jifyjzBoD/tysFQaQy2iq0/0pzxIVNYLaNDOQFLUKKK1YRyojgcRAEG3bDVmZmavFzP5 tFQ/f4Hd69ZqPsrJEICJU/4IGQbtBlwL3Sya69uSc8WgPvifusG+c9sDnNMoQ99Wwu1f vYmUhFN1sdCFLiLXV4xtLC89hcBgmR88zjCRjNdlg7EPQtoleDJUySulL3Cqy5elAslz QZmEWejTVvlRz88Z/OyL7TcmnVVmUQEgexgIq8fUnxuQ31v8NsMrd2bjb2kGPOgadt75 kVTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ry/rUuqZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si6447929ejm.470.2020.11.23.04.45.15; Mon, 23 Nov 2020 04:45:39 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b="Ry/rUuqZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732395AbgKWMkE (ORCPT + 99 others); Mon, 23 Nov 2020 07:40:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:52780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732396AbgKWMkB (ORCPT ); Mon, 23 Nov 2020 07:40:01 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 7F0802065E; Mon, 23 Nov 2020 12:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135201; bh=RBl0T9IW6VKzCyg8ZrAnQlz21jCSqXjixPMlNfM9T9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ry/rUuqZLbPiKod2gjzxdQlYt84gGc+Tfm3vna+sYxMfnX5L9Lhe3MTMV42j9Q7kd BfIDdWnAu5Uayw4rNSbVKTqyDxw2m/1nDgnBVg2rA7ZAXG1kYKNfJ9mYcP43KVBGh7 mtNlHt0tXapRvmF5Y0zGHCkkxqnl4BbRsjfjfeZ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.4 141/158] xtensa: fix TLBTEMP area placement Date: Mon, 23 Nov 2020 13:22:49 +0100 Message-Id: <20201123121826.741479326@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Filippov commit 481535c5b41d191b22775a6873de5ec0e1cdced1 upstream. fast_second_level_miss handler for the TLBTEMP area has an assumption that page table directory entry for the TLBTEMP address range is 0. For it to be true the TLBTEMP area must be aligned to 4MB boundary and not share its 4MB region with anything that may use a page table. This is not true currently: TLBTEMP shares space with vmalloc space which results in the following kinds of runtime errors when fast_second_level_miss loads page table directory entry for the vmalloc space instead of fixing up the TLBTEMP area: Unable to handle kernel paging request at virtual address c7ff0e00 pc = d0009275, ra = 90009478 Oops: sig: 9 [#1] PREEMPT CPU: 1 PID: 61 Comm: kworker/u9:2 Not tainted 5.10.0-rc3-next-20201110-00007-g1fe4962fa983-dirty #58 Workqueue: xprtiod xs_stream_data_receive_workfn a00: 90009478 d11e1dc0 c7ff0e00 00000020 c7ff0000 00000001 7f8b8107 00000000 a08: 900c5992 d11e1d90 d0cc88b8 5506e97c 00000000 5506e97c d06c8074 d11e1d90 pc: d0009275, ps: 00060310, depc: 00000014, excvaddr: c7ff0e00 lbeg: d0009275, lend: d0009287 lcount: 00000003, sar: 00000010 Call Trace: xs_stream_data_receive_workfn+0x43c/0x770 process_one_work+0x1a1/0x324 worker_thread+0x1cc/0x3c0 kthread+0x10d/0x124 ret_from_kernel_thread+0xc/0x18 Cc: stable@vger.kernel.org Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- Documentation/xtensa/mmu.rst | 9 ++++++--- arch/xtensa/include/asm/pgtable.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) --- a/Documentation/xtensa/mmu.rst +++ b/Documentation/xtensa/mmu.rst @@ -82,7 +82,8 @@ Default MMUv2-compatible layout:: +------------------+ | VMALLOC area | VMALLOC_START 0xc0000000 128MB - 64KB +------------------+ VMALLOC_END - | Cache aliasing | TLBTEMP_BASE_1 0xc7ff0000 DCACHE_WAY_SIZE + +------------------+ + | Cache aliasing | TLBTEMP_BASE_1 0xc8000000 DCACHE_WAY_SIZE | remap area 1 | +------------------+ | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE @@ -124,7 +125,8 @@ Default MMUv2-compatible layout:: +------------------+ | VMALLOC area | VMALLOC_START 0xa0000000 128MB - 64KB +------------------+ VMALLOC_END - | Cache aliasing | TLBTEMP_BASE_1 0xa7ff0000 DCACHE_WAY_SIZE + +------------------+ + | Cache aliasing | TLBTEMP_BASE_1 0xa8000000 DCACHE_WAY_SIZE | remap area 1 | +------------------+ | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE @@ -167,7 +169,8 @@ Default MMUv2-compatible layout:: +------------------+ | VMALLOC area | VMALLOC_START 0x90000000 128MB - 64KB +------------------+ VMALLOC_END - | Cache aliasing | TLBTEMP_BASE_1 0x97ff0000 DCACHE_WAY_SIZE + +------------------+ + | Cache aliasing | TLBTEMP_BASE_1 0x98000000 DCACHE_WAY_SIZE | remap area 1 | +------------------+ | Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -70,7 +70,7 @@ */ #define VMALLOC_START (XCHAL_KSEG_CACHED_VADDR - 0x10000000) #define VMALLOC_END (VMALLOC_START + 0x07FEFFFF) -#define TLBTEMP_BASE_1 (VMALLOC_END + 1) +#define TLBTEMP_BASE_1 (VMALLOC_START + 0x08000000) #define TLBTEMP_BASE_2 (TLBTEMP_BASE_1 + DCACHE_WAY_SIZE) #if 2 * DCACHE_WAY_SIZE > ICACHE_WAY_SIZE #define TLBTEMP_SIZE (2 * DCACHE_WAY_SIZE)