Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7349728rwl; Fri, 30 Dec 2022 07:17:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXtB7MJ7a8s7KgoSC3ZzYBEug3W+OtLmvRS09YVEfUOz8C4HE+XQIv5L0JCtpjFFYSU3YJCr X-Received: by 2002:a17:907:a64b:b0:7c1:13b7:a5a1 with SMTP id vu11-20020a170907a64b00b007c113b7a5a1mr29742313ejc.46.1672413425290; Fri, 30 Dec 2022 07:17:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672413425; cv=none; d=google.com; s=arc-20160816; b=NaEe9Bd9aSzpiJ5YAFh/PHyR0hFJN97AY+oiQfoE0y7YPKRTuoXRqbWV/5qqh1avyr ycHKqgURC9ygaUXF4hYkEBt9HoS4LEVT6JYNnFWYHMoGd9t+HvlRJmtAV45YtyOluheQ Hshj8+PSSNdiDx5eQnG20QF24X0+dAzSLxdal1c8bHSRYWu2VbhhslflQEVYRwo5Zjt4 I2s4Kkn5wpe4GBnHqk194rE40svyF19inuI8g3ee7cfJqHv/68wFKXa8Y3dJLGzciFCO oy6QIl1zpgw77K9H++ptnGWF5nKRrZGg3nmO8JkxaEcXjf8aKGOB8MFr2m8XPwspYiY5 SYvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2NtIS9KlbxawljYsJMRawHGqCxYowTti6jfAwJLfcBo=; b=adigfLoVjXRSkPsPKmvFVQxQMQvvWibLGtWcd+l8pVhC5/GLE9SWP/UCIyk4ZjV9dn Y8AWQeWBVQFgGzYiZwf11rTpMTEOGF8/LgU3hbMC/DvsWsupFviUhSv6ZcSYkFR0XPMA qsKucKJFcgIxzductgm/lq9pFmAL7mlMHRbwOAVcJWRXTv2Rb5NqizEH1QfAbJXI7fRO 7k6rfCx7ncM+RI/xP8sXHezuBgrqusukweo6iVr1LcT1VJkaxkcMmYORg9CSbz0F+eQx LpKCgxI3HANleacdm6gmorBj6fwTmOrztJyvCqaiAyQyUfEWISEVkNtCTylx9WGvxyu8 Tkjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs36-20020a1709073ea400b0073db353cb25si18653241ejc.869.2022.12.30.07.16.41; Fri, 30 Dec 2022 07:17:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbiL3PLH (ORCPT + 99 others); Fri, 30 Dec 2022 10:11:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbiL3PLG (ORCPT ); Fri, 30 Dec 2022 10:11:06 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4DAC14024 for ; Fri, 30 Dec 2022 07:11:05 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1pBH2E-00COpF-9l; Fri, 30 Dec 2022 23:11:03 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 30 Dec 2022 23:11:02 +0800 Date: Fri, 30 Dec 2022 23:11:02 +0800 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Eric Biggers , "Elliott, Robert (Servers)" Subject: Re: [RFC PATCH] crypto: use kmap_local() not kmap_atomic() Message-ID: References: <20221213161310.2205802-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221213161310.2205802-1-ardb@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Dec 13, 2022 at 05:13:10PM +0100, Ard Biesheuvel wrote: > kmap_atomic() is used to create short-lived mappings of pages that may > not be accessible via the kernel direct map. This is only needed on > 32-bit architectures that implement CONFIG_HIGHMEM, but it can be used > on 64-bit other architectures too, where the returned mapping is simply > the kernel direct address of the page. > > However, kmap_atomic() does not support migration on CONFIG_HIGHMEM > configurations, due to the use of per-CPU kmap slots, and so it disables > preemption on all architectures, not just the 32-bit ones. This implies > that all scatterwalk based crypto routines essentially execute with > preemption disabled all the time, which is less than ideal. > > So let's switch scatterwalk_map/_unmap and the shash/ahash routines to > kmap_local() instead, which serves a similar purpose, but without the > resulting impact on preemption on architectures that have no need for > CONFIG_HIGHMEM. > > Cc: Eric Biggers > Cc: Herbert Xu > Cc: "Elliott, Robert (Servers)" > Signed-off-by: Ard Biesheuvel > --- > crypto/ahash.c | 4 ++-- > crypto/shash.c | 4 ++-- > include/crypto/scatterwalk.h | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt