Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp687425pxu; Fri, 4 Dec 2020 12:59:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZTF+tBK+VbhI/M5ZN1ttS6KTzxZqfDiGcbhNW/2/C1xcELMGzrzyUqP38N7sfIkhAyMht X-Received: by 2002:a17:906:279a:: with SMTP id j26mr5227225ejc.203.1607115583101; Fri, 04 Dec 2020 12:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607115583; cv=none; d=google.com; s=arc-20160816; b=LraoTu9LJkKHAF9tIsTDn8dfgpNwAW9u35e7Cf68bSNaVC+ux/RnN/zR4KC5k6zbd1 giKu6UQExojpDMTuBPQB/5ev+F1C7AWQ7V5dv/M1VMHoSvIHkdi/xmnGKKh9otibOtZ1 6yxTDhwaMoVS8LhO9SPJgRDuc0Gx5malD1Q20tIzBW9NTlF89Kyu64mW5tstnsh+sEqU Jgi6j6fnxkIAVEvJItgb5pruokLfq1So/8ihAQbJO9WQ6ZGiC6c/Nd8REewGSzrGurkG Wi0peTc9vvKvWRwcdLO7Apmww5+O3H+6YngfjfDF7sJHhRIDyIYMSZopTqvSniRgu/Hk 2PfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=rXljD59g1oVzJ9jF+FjoI9sRZm03SEV2p7bFgHFt2DM=; b=uxt5jw8Ev635+sGLpRWIWqbZtLQXZLHMGRJZU8LezFBeotYtpnMsNPuBx37fe3dVlD 0/hMTfyu64zUpa7eu4XUUT82tjPFLH37IttebJzmgrbJkq+6A5FufW84Ool/UoBAFFnW 99nUen4XjD5HgEQec6H1+sbuClvRPWyrsycoO4t/dSMR9gjNawb+3UkAfRwoYTjcQugB Tx7KjKhc5qgDLG40g2LgqceOaknmL5IM77jcW4Kf7cri0RFDXXyBSoE9tJnaXq8WNMeO 6ccWyYhnLpMY4j3yl4eT+m8A7PSFPl4ZF/N/vyBEEe1g7bFXoTD7RXp4R9kQHo2KdNJE 9jMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="gt3Mr97/"; dkim=neutral (no key) header.i=@linutronix.de header.b="Ycrbek5/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oi20si877594ejb.500.2020.12.04.12.59.07; Fri, 04 Dec 2020 12:59:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=@linutronix.de header.s=2020 header.b="gt3Mr97/"; dkim=neutral (no key) header.i=@linutronix.de header.b="Ycrbek5/"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgLDU7F (ORCPT + 99 others); Fri, 4 Dec 2020 15:59:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726534AbgLDU7E (ORCPT ); Fri, 4 Dec 2020 15:59:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F6FDC0613D1; Fri, 4 Dec 2020 12:58:24 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607115502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rXljD59g1oVzJ9jF+FjoI9sRZm03SEV2p7bFgHFt2DM=; b=gt3Mr97/2vciv5YdoyaFRsmoYE/JGQYVgEhXOS2jFNU4afDXtiJJQI8FWmNpgJ6232PVlM GF791/vksstqewuQU46P6xpGfZ8T+iLIccS+vR4lTC/23LjbTn7pMJTl+1UL6bsZV88292 3DbVKsgQLL6la4/SVV1xF2parMH1WoDTG08eytykPyy4lHp0gmoovXm2klpgAUkBTyWFsH TP0Ql8ntELb1pWzWt0u8yKP6hJr1eKH5TUttYLzWO4wEF6OxRJAVNxyO2Hn+ON7dCU0E/G Fj09D1Ioe4mtWW/RXmXUKbiw3J4XwGvdpNN9JyLT4v64tXxiNGWhXnAuHfBlaQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607115502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rXljD59g1oVzJ9jF+FjoI9sRZm03SEV2p7bFgHFt2DM=; b=Ycrbek5/gf/49CBynySmzpUCfaHCA9bnz4vO95QH88mYYX/3lLMxH3GqpBELPbH+wvXO3a 9mGaGDJXqV59A6DQ== To: Corentin Labbe Cc: herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , linux-mm@kvack.org, Andrew Morton Subject: Re: crypto: sun4i-ss: error with kmap In-Reply-To: <20201204192753.GA19782@Red> References: <20201201135252.GA9584@Red> <87y2ihfw6z.fsf@nanos.tec.linutronix.de> <20201201144529.GA6786@Red> <87v9dlfthf.fsf@nanos.tec.linutronix.de> <20201202195501.GA29296@Red> <877dpzexfr.fsf@nanos.tec.linutronix.de> <20201203173846.GA16207@Red> <87r1o6bh1u.fsf@nanos.tec.linutronix.de> <20201204132631.GA25321@Red> <874kl1bod0.fsf@nanos.tec.linutronix.de> <20201204192753.GA19782@Red> Date: Fri, 04 Dec 2020 21:58:21 +0100 Message-ID: <87wnxx9tle.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Dec 04 2020 at 20:27, Corentin Labbe wrote: > On Fri, Dec 04, 2020 at 04:08:27PM +0100, Thomas Gleixner wrote: >> On Fri, Dec 04 2020 at 14:26, Corentin Labbe wrote: >> > On Fri, Dec 04, 2020 at 12:34:05AM +0100, Thomas Gleixner wrote: >> >> The unmap comes from sg_miter_stop() and looking at the previous >> >> map/unmap cycles there are never nested maps. >> >> >> >> [ 996.943030] cryptset-316 0d..4 73943317us : __kmap_local_pfn_prot: kmap_local_pfn: 1 ffefd000 >> >> >> >> is the first event which allocates a nested map. >> >> >> >> So something goes south either in sg_miter or in the crypto maze. >> >> >> >> Enabling CONFIG_DEBUG_KMAP_LOCAL and function tracing might give us more clue. >> > >> > Done, http://kernel.montjoie.ovh/130466.log >> >> Does not provide more information with the debug enabled. So can you >> please enable CONFIG_FUNCTION_TRACER and add 'ftrace=function' to the >> command line? > > Done, http://kernel.montjoie.ovh/130490.log Aaargh. That overwrites everything while printing out that warning. Can you please replace the debug patch with the one below and try again? That stops the trace right on the condition. Thanks, tglx --- diff --git a/mm/highmem.c b/mm/highmem.c index b49364a306b8..8f8862f79d23 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -485,6 +485,7 @@ static inline bool kmap_high_unmap_local(unsigned long vaddr) { #ifdef ARCH_NEEDS_KMAP_HIGH_GET if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) { + trace_printk("kunmap_high: %lx\n", vaddr); kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)])); return true; } @@ -520,6 +521,7 @@ void *__kmap_local_pfn_prot(unsigned long pfn, pgprot_t prot) preempt_disable(); idx = arch_kmap_local_map_idx(kmap_local_idx_push(), pfn); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); + trace_printk("kmap_local_pfn: %d %lx\n", idx, (unsigned long) vaddr); BUG_ON(!pte_none(*(kmap_pte - idx))); pteval = pfn_pte(pfn, prot); set_pte_at(&init_mm, vaddr, kmap_pte - idx, pteval); @@ -545,8 +547,10 @@ void *__kmap_local_page_prot(struct page *page, pgprot_t prot) /* Try kmap_high_get() if architecture has it enabled */ kmap = arch_kmap_local_high_get(page); - if (kmap) + if (kmap) { + trace_printk("kmap_local_high_get: %lx\n", (unsigned long) kmap); return kmap; + } return __kmap_local_pfn_prot(page_to_pfn(page), prot); } @@ -578,7 +582,11 @@ void kunmap_local_indexed(void *vaddr) preempt_disable(); idx = arch_kmap_local_unmap_idx(kmap_local_idx(), addr); - WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx)); + trace_printk("kunmap_local: %i %lx\n", idx, (unsigned long) vaddr); + if (addr != __fix_to_virt(FIX_KMAP_BEGIN + idx)) { + tracing_off(); + BUG(); + } arch_kmap_local_pre_unmap(addr); pte_clear(&init_mm, addr, kmap_pte - idx);