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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 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 A004CC43461 for ; Tue, 15 Sep 2020 07:06:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69DBC206C9 for ; Tue, 15 Sep 2020 07:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726048AbgIOHGq (ORCPT ); Tue, 15 Sep 2020 03:06:46 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:44894 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbgIOHGN (ORCPT ); Tue, 15 Sep 2020 03:06:13 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kI51n-0008KX-UH; Tue, 15 Sep 2020 17:05:25 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Tue, 15 Sep 2020 17:05:23 +1000 Date: Tue, 15 Sep 2020 17:05:23 +1000 From: Herbert Xu To: Linus Torvalds Cc: Thomas Gleixner , Ard Biesheuvel , LKML , Linux Crypto Mailing List Subject: Re: [PATCH] crypto: lib/chacha20poly1305 - Set SG_MITER_ATOMIC unconditionally Message-ID: <20200915070523.GA26629@gondor.apana.org.au> References: <20200914204209.256266093@linutronix.de> <871rj4owfn.fsf@nanos.tec.linutronix.de> <20200915033024.GB25789@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Sep 14, 2020 at 11:55:53PM -0700, Linus Torvalds wrote: > > Maybe we could hide it behind a debug option, at least. > > Or, alterantively, introduce a new "debug_preempt_count" that doesn't > actually disable preemption, but warns about actual sleeping > operations.. I'm more worried about existing users of kmap_atomic relying on the preemption disabling semantics. Short of someone checking on every single instance (and that would include derived cases such as all users of sg miter), I think the safer option is to create something brand new and then migrate the existing users to it. Something like static inline void *kmap_atomic_ifhigh(struct page *page) { if (PageHighMem(page)) return kmap_atomic(page); return page_address(page); } static inline void kunmap_atomic_ifhigh(struct page *page, void *addr) { if (PageHighMem(page)) kunmap_atomic(addr); } Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt