Received: by 2002:a89:2d5:0:b0:1ef:f8eb:5d24 with SMTP id d21csp184240lqs; Sun, 17 Mar 2024 17:14:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU76XgNR5XdRdOkX8bgnS9+3+tYsC5tP99eGsOcADfmH16EqHQJ2cEvl6QvKAnISHmvqQ+gixbi9k1Z+oD8J8voBNQNXS6grwTnSUrurg== X-Google-Smtp-Source: AGHT+IE8nAjS2wFw/L63DLsWXErj54w0Iq0hG7LxXKc1sdh8+YHF7B0qdu+S8M1W2fzphVpP0kfI X-Received: by 2002:a05:6512:238c:b0:513:e9cf:48b3 with SMTP id c12-20020a056512238c00b00513e9cf48b3mr1232331lfv.60.1710720850639; Sun, 17 Mar 2024 17:14:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710720850; cv=pass; d=google.com; s=arc-20160816; b=PUnre4xJJQ2k+2CYIr8spwsdpFpK+UrVMX42t2lMGtVMFdMnxujlQdOkPh3sSedLkq t0afHYZZ1FAA5JCIu78nas6XSX4iVBivfBMy3dvSUzQo4TK9RpijuOLAS9+mgdyI8n5U mSJpjZGuRDk0NhgLMXcFRs0CW4zNoPAApconssv/yifgQ2F0bpfaibYzIuWfgWwPHEDP fsctsQ0ZeN68gTc1BWm9Lc4wrcpUgxZb8On9+cVbMmUG0/HcrUbPds2bwMXIO4v8cmYb LeUN1cU3kaLKfe2mVdkXde5hsY/q1xu/aZIUdQ5PrwOjY9dbcAFFEQ6bmEbCe20HrYIY Ecaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=ZVZ52BDSjh9yH+lnGU//XZN+oBlR/jN1C9XX3w9YbMY=; fh=7c8ATO+qi47JwKdiCN50jbZnZC/bmBslT4O9fEyM08E=; b=dQXJUZG4NODE7/eA/EaGvHhdIVjJhIrvAMhNELzJaCx6wf5jF4MDpUC/CCevIMyksS rEr71XI5rmKo9t00O32QvGpLseVYq0jF1lYoh5ZzjPYPLg6fhq63p922UPFWW7J37X6/ KgDbB30knLEaw8O2Z8CcPOs9tDTUCOm2ljWqgmLOZAIO6C6IcEmPZ/b3dLCRk16I0kaO 8xg9x/lweOxPeqr+hUKi7yIv6BLHnMKFAO/KiZwfar+yeCIjym26mY4s0a4TGoX6UICf TSXRFZS9JrW4qiMRaygCYMmsZ5XvEWSY2GXdr+lWhMALGkIIujlkA+w1jtaO6h/XYGZy alAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WAlLix2U; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-crypto+bounces-2698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2698-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ne40-20020a1709077ba800b00a46a8fccd50si1660527ejc.926.2024.03.17.17.14.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 17:14:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WAlLix2U; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-crypto+bounces-2698-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2698-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 292F01F2206F for ; Mon, 18 Mar 2024 00:14:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56DAE111E; Mon, 18 Mar 2024 00:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WAlLix2U" X-Original-To: linux-crypto@vger.kernel.org Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E424EBF; Mon, 18 Mar 2024 00:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710720843; cv=none; b=JgfqDJ/Xl5gFP1f/yh0sx8wes6EpeUbJQMixcZeXlCdX8J7aMJUBst1cT+CAIwsn3irECAhNncw18XFjSkdhBjzTXLyFPaiPjOvTcv/MNKGjUGnKcX7mtthSHvZPqS8nd77WbuzGseE2H/Sf+SJqtkG0wRBxxc7/t7yhGacY4ms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710720843; c=relaxed/simple; bh=cZOKI1eZyGsmjUEZ+hRiNuYZGhMF+xPoAcEMoaVRFug=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aeIh4r6vZAViZTZKs/faEB84ybR/qVTsMsYgtot6CalacjUkCcaD7XV6/qDi9BaNOpSHZZib7pt2nGEMAIyMmxP666IuyYvtwzb8bMV5uKfCq4WvI520TvO4P4tm1P/3ZZXnZRkuV1OrI+OJ6uNcb2DHbjOoEXyhza5tApFFLEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WAlLix2U; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-21fb368b468so2318579fac.0; Sun, 17 Mar 2024 17:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710720840; x=1711325640; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=ZVZ52BDSjh9yH+lnGU//XZN+oBlR/jN1C9XX3w9YbMY=; b=WAlLix2Umgd7A1cGMjpGLMOzNGQTzICQLqJyFEwEKM62lYnBLyXj9CoNlweM+yQwQ/ Th1HzfWY4nx+o+NQaeiRXdTjKM/9b6w7X7hx9z9F/ZBYRyoHpAmwfllRpPI9cSsTCOl4 3e7IVUjPAvu6kx6yqsS78hZqWi6FtF9/G9ZdlmI+SQqgBln2UibioCtEIgFFnBuCOsep b3PqDC5FuRVGuwwC1xyESqRyRhjn79NOHz5t1lt2nnzFgxxnd7V4lJw6uhKJ/QcRsi2B w9gvSfjeamaB7zZff7H0qPHc5eoAJFUzoaBU4T7s2HrG1boDA9EIa5zulYqa/71yKZq9 fc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710720840; x=1711325640; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZVZ52BDSjh9yH+lnGU//XZN+oBlR/jN1C9XX3w9YbMY=; b=QUprB0Wunk3EPIrCf2ne6gqsaX8Kq5G7fts16sgP8TTnZ3qk6h1SBNsLJOmqDqlq3f RfVEa7/51J6TP1ix5rruBXGu33iMKPk5N6UKK3J9T5zIn81yXc4wiyRL7K+aqIdYiuz3 RH01/gFPPMTW1WU7sPLUzNW+XHtOs+IMkwnZPLkf2ebME4rPDI9aNZeHF/XuTyIM3HmM 3bwjweeQGbOwOAmFaxGAn1F2+BEfHV24hvB7IsaJiL9Ucdc+jy8YGr9XXw7OF+aWauIC 1hzuk+RRKtSJo+yigyUistF7GWyzO9T48uoxzymKt+ISa/MQLtNVU9qxNrv18N56qMXC eOIw== X-Forwarded-Encrypted: i=1; AJvYcCVSOLPUq4R/xonGm3RGwVDsK/FO4ZGnIz6Mpw+z4fuGJpnvNRURdZd0QazShT2qCty9U/lMT0MFRO3ox03kcBxeDHSRTZ/q/vXqJP9k1BffSYPWp2Dt7HGaMb1oNmq/ddRlK5vSp4LWGA8k X-Gm-Message-State: AOJu0YxAdj5rt12yNaFwrHabFnvEKFs0ak4n6qEMAjjm+Y8KIbEB+HcT +i1i8jB8DNyuPsMNupwgQPUYkMKR4ufyZ9k2dcXE1leDL0/0jUs3 X-Received: by 2002:a05:6870:a691:b0:220:873d:dbcc with SMTP id i17-20020a056870a69100b00220873ddbccmr11996322oam.49.1710720840376; Sun, 17 Mar 2024 17:14:00 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u14-20020aa7848e000000b006e6b4c637b6sm6682674pfn.116.2024.03.17.17.13.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Mar 2024 17:13:59 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Sun, 17 Mar 2024 17:13:57 -0700 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7] crypto: scompress: remove memcpy if sg_nents is 1 and pages are lowmem Content-Language: en-US To: Barry Song <21cnbao@gmail.com> Cc: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, akpm@linux-foundation.org, chrisl@kernel.org, sjenning@redhat.com, vitaly.wool@konsulko.com, linux-kernel@vger.kernel.org, Barry Song , Johannes Weiner , Nhat Pham , Yosry Ahmed , Chengming Zhou References: <20240301192745.14987-1-21cnbao@gmail.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROI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SLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/17/24 16:48, Barry Song wrote: > On Mon, Mar 18, 2024 at 7:13 AM Guenter Roeck wrote: >> >> Hi, >> >> On Sat, Mar 02, 2024 at 08:27:45AM +1300, Barry Song wrote: >> [ ... ] >>> @@ -152,8 +165,17 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) >>> ret = -ENOSPC; >>> goto out; >>> } >>> - scatterwalk_map_and_copy(scratch->dst, req->dst, 0, req->dlen, >>> - 1); >>> + if (dst == scratch->dst) { >>> + scatterwalk_map_and_copy(scratch->dst, req->dst, 0, >>> + req->dlen, 1); >>> + } else { >>> + int nr_pages = DIV_ROUND_UP(req->dst->offset + req->dlen, PAGE_SIZE); >>> + int i; >>> + struct page *dst_page = sg_page(req->dst); >>> + >>> + for (i = 0; i < nr_pages; i++) >>> + flush_dcache_page(dst_page + i); >> >> flush_dcache_page() is an empty macro on some architectures >> such as xtensa. This results in > > Hi Guenter, > > this is a bug of xtensa, could you test the patch: Thanks for the update. > https://lore.kernel.org/all/20240313045036.51065-1-21cnbao@gmail.com/ > That doesn't build for me. CC arch/xtensa/kernel/asm-offsets.s In file included from ./include/linux/highmem.h:8, from ./include/linux/bvec.h:10, from ./include/linux/blk_types.h:10, from ./include/linux/writeback.h:13, from ./include/linux/memcontrol.h:23, from ./include/linux/swap.h:9, from ./include/linux/suspend.h:5, from arch/xtensa/kernel/asm-offsets.c:24: ./include/linux/cacheflush.h:9:5: error: "ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE" is not defined, evaluates to 0 [-Werror=undef] 9 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE A similar works for loongarch, so I don't know what is wrong. Maybe some context patch is missing. Guenter