Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422847rdh; Sun, 29 Oct 2023 15:58:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUD3YKLtXQXwIctA/sWTv0+NzHWgtvr6d+3xYH5Q4T5ePalAbEvd2R+caIJ5gwa3AhWiA1 X-Received: by 2002:a05:6830:4492:b0:6b9:146a:f1c9 with SMTP id r18-20020a056830449200b006b9146af1c9mr11182090otv.0.1698620306025; Sun, 29 Oct 2023 15:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620305; cv=none; d=google.com; s=arc-20160816; b=gF7qZpeZmBzihtZwcEYePr1afVz7pcrFmgeIwFoGeYqOtDwsOKT85FTm5+mi9T/Qim zGHzQdEVXjeXi0TG4wisbTlKmaGWljWPZjthfsMNmJ4ZL7Miv70FTW8Spsf6NMCL/274 gqTvZfQqku/iFwsWuEr0qttKyj5jav5p/C4F//tMCOY4fz6GZKpEdqAOkjZBxdnWTXJK KUbz9Awer9ayZ/BZIjIbP/C6kNGR2GYa9LkqovE0ATcpuMcSWl5bkKdN6wc2zV0xE9If SgStoyPGvVwPN5wbSKt+nLSCY+k476k39XjRCa/IN71BHfejcpZAthkRCT6DQ0Z9EySo nA+A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=u9ycFje4sKl+G2k93QZ6xRMErgGnIwGOs5sUGESveBQ=; fh=usWxYeJMCXkI0CW05cpwAWNhJ4V9fzC8AdXlF/kI8X8=; b=t6PgNhuSvUFd5XTq9acUbxok1XvcaPMm9v09d+VU0i7mKllTZiw/JPBVuv6j/5ifUD 9FFBJpX23fy/bw1fGg8Nt9s/+d75BhP6YUcDoB0vVxYnCYXy4rWepU9biPSt+6dDEt3T DbULJibckAqOV+zhZbaN2qxoHNyDos3ytYqG6DUUL7XROx8738H6ZaNr5+Rw3tIkTa0f AHP3CTk0dnNm2axRNgMcxu4Qycsy/Y4opwp/zUOfHeNUBsgJEbh2UgOLKkANkq2XQEuu 6VkjnPxPEyG8bBw7RuR+R+8ROa5DRsY62FZ61dbj3yW6TfOrf39b2I8VqYr2h0f+Lw5l uffA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qbJmcvEO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id mu10-20020a17090b388a00b00280203592dbsi3019007pjb.90.2023.10.29.15.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qbJmcvEO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B525E806A629; Sun, 29 Oct 2023 15:58:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbjJ2W6P (ORCPT + 99 others); Sun, 29 Oct 2023 18:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231335AbjJ2W6K (ORCPT ); Sun, 29 Oct 2023 18:58:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 319673842; Sun, 29 Oct 2023 15:57:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 081DFC4167D; Sun, 29 Oct 2023 22:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620200; bh=2aIYLIjhBACuLNLbp6WIuPI+Kz9KP0HOlGxSnfGtGPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qbJmcvEOL7t0m/JXDKTK4i3JRDB0rfxybsukpgc1u9gTEOWDUAG8rSETxpjX1m1KV 5NWUMVWMm66rwjx17dNYsZWA5Q6rJOCSS4k2AagcznvQZsnCQKOQUV9Qd2l7u9qJTm cnDxA2AmGaF6ErQXtU56XD5XojLHNVHneBBmJXWQktxJC7aov4LxLf5AgOuzBePqJR iyHdCU+Ngn6aQY95t+Kuy3BAqxvv3sV0L1riU0I0iBwHPCadwbQBINkiEd3PNby06S aoFPCAmYucYSztsf1uCuXBRrXnEBD+BuWMzfQoXoZ1duBZMPhyFnYYVoIibjQ4PAQA fuuM6K6haTqSw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Huacai Chen , Deepak R Varma , Sasha Levin , chenhuacai@kernel.org, maobibo@loongson.cn, akpm@linux-foundation.org, chenfeiyang@loongson.cn, arnd@arndb.de, loongarch@lists.linux.dev Subject: [PATCH AUTOSEL 6.5 42/52] LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage() Date: Sun, 29 Oct 2023 18:53:29 -0400 Message-ID: <20231029225441.789781-42-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:58:23 -0700 (PDT) From: Huacai Chen [ Upstream commit 477a0ebec101359f49d92796e3b609857d564b52 ] Replace kmap_atomic()/kunmap_atomic() calls with kmap_local_page()/ kunmap_local() in copy_user_highpage() which can be invoked from both preemptible and atomic context [1]. [1] https://lore.kernel.org/all/20201029222652.302358281@linutronix.de/ Suggested-by: Deepak R Varma Signed-off-by: Huacai Chen Signed-off-by: Sasha Levin --- arch/loongarch/mm/init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c index 51c9a6c90a169..d967d881c3fef 100644 --- a/arch/loongarch/mm/init.c +++ b/arch/loongarch/mm/init.c @@ -68,11 +68,11 @@ void copy_user_highpage(struct page *to, struct page *from, { void *vfrom, *vto; - vto = kmap_atomic(to); - vfrom = kmap_atomic(from); + vfrom = kmap_local_page(from); + vto = kmap_local_page(to); copy_page(vto, vfrom); - kunmap_atomic(vfrom); - kunmap_atomic(vto); + kunmap_local(vfrom); + kunmap_local(vto); /* Make sure this page is cleared on other CPU's too before using it */ smp_wmb(); } -- 2.42.0