From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52582C433FE for ; Sat, 5 Dec 2020 18:45:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E66222B37 for ; Sat, 5 Dec 2020 18:45:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E66222B37 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/ot+HbHA3fjL3+Qs8ne+xvb1v3+N4be9KNHAwItQJEk=; b=G9gUVcw20ME928W/9djLm4ZLm XPo6tKrKg3Z00Lup2UB/KONnhDAHOvwBegD96LRKyvejXhjI1gl5hYf4tA4hWwkD1TafRSbdCpPdO r1ia8j0YZcA9085MO7u8N7nsIFycBRMJ1AcnTOqy1iVpIRe6TOO3ZM4cnhU7CQT1M2pIj8pE62riC B3hetl9OdKUFROb/j1J8mrWNuulw2JZ/ItQ08yXpLc1083GQn4YakGbU1JMutI50Tt9I+9RxqGgtY 5IPGIFBUno/0pqaS1zZX2WOahuI/qyRbaiduXmzbjpZdIz2S+z3wgGIEpxNtFjH59eq44hfXHntzi T3Nc8fC2w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klcX2-00022q-3N; Sat, 05 Dec 2020 18:43:44 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klcWz-00021z-K2 for linux-arm-kernel@lists.infradead.org; Sat, 05 Dec 2020 18:43:42 +0000 Received: by mail-wm1-x341.google.com with SMTP id a6so8104191wmc.2 for ; Sat, 05 Dec 2020 10:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xy8pTkIM3V0NC8hsWJahqGP6V2oO9J48tUSWZxlA9uk=; b=ZC0wB4xOfrZGXbQAYkwSKi5ecx7lxC5Vf4+MXSsx4L7QUjRw4dfdEiQ8MIPjAiBNgn vGLaRLq9GDAwwVjdTIE3mb6aa8BdM5f0ozv+eGRpnvq+rMgpgoaf5eXNtd+XcdO1efkI q4apFVhyQ4I2JjN3jjJzcVbbnVijKtGUyNC9WtR2Ye91BioAlGYWa4M+4gCiXsmu4Eb+ urVod55S1VNcUvoxhkXZYS/Dg+8NDwuy4KoHjDqd8APLAa5jUepNnZwhMdAo9NeXwJLc 5MuUYSuHiB7Vf/Kplln2nrwITqqVXiajQRpn6Iu2ZUsPQ+GqGcliBEK3zoqcc9/8Mi1w 9oJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xy8pTkIM3V0NC8hsWJahqGP6V2oO9J48tUSWZxlA9uk=; b=ToqTzHpgAqefjSumFYdNUonD8EUf9OX3if/T9AVGIzSjOW++msvIPOLqso8j8vcdmt vT95xJn4utRMO+rSJAnqqX3gLvef0yk5u/4F8tPFjXnODXJi6RBhGAEs2woy5+vkceUG /suez+O877fxj1lTm/umn2Mw+BM5zM1MQUnOpiBfuWDBOhEnw6UjFrYnCpEM3T8jTbyy m1/ksyaZ/0UpjjgBACvdla3tNLaM72YsJvvWBc03u5Zyx30ybuzwvXqWH+13raNIIlES bwFb2azr2qh8mHXGp0VeTrjN5imMSLsAPgNHrPdVOSt1EpY3bfjTIOEC9BuJRzpm9RiW +2MQ== X-Gm-Message-State: AOAM533Z58KC1fxGOHd9gRU8oFgjdOut37BEcOJ80QAM7YFMQOKhaAr6 C2a4oTVYQlsHp/kG7rAkhfk= X-Google-Smtp-Source: ABdhPJwSK1RomPg3IX344esDcP0wSct5ZEkZlRVcgy1IeoI9W66W/Q0BTNxSa5aKL27jcKYmnyX4yQ== X-Received: by 2002:a1c:7c09:: with SMTP id x9mr10401089wmc.98.1607193819114; Sat, 05 Dec 2020 10:43:39 -0800 (PST) Received: from Red ([2a01:cb1d:3d5:a100:264b:feff:fe03:2806]) by smtp.googlemail.com with ESMTPSA id j6sm8401536wrq.38.2020.12.05.10.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 10:43:38 -0800 (PST) Date: Sat, 5 Dec 2020 19:43:34 +0100 From: Corentin Labbe To: Thomas Gleixner Subject: Re: crypto: sun4i-ss: error with kmap Message-ID: <20201205184334.GA8034@Red> References: <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> <87wnxx9tle.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87wnxx9tle.fsf@nanos.tec.linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_134341_686661_27D018FB X-CRM114-Status: GOOD ( 24.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org, mripard@kernel.org, linux-mm@kvack.org, wens@csie.org, linux-crypto@vger.kernel.org, Andrew Morton , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Dec 04, 2020 at 09:58:21PM +0100, Thomas Gleixner wrote: > 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); > Hello, the result could be found at http://kernel.montjoie.ovh/130739.log Thanks _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel