From patchwork Mon Dec 9 09:50:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13899184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 060BCE77180 for ; Mon, 9 Dec 2024 09:50:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 764FF8D0030; Mon, 9 Dec 2024 04:50:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EE148D0029; Mon, 9 Dec 2024 04:50:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 58F118D0030; Mon, 9 Dec 2024 04:50:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 308668D0029 for ; Mon, 9 Dec 2024 04:50:44 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D51561203AA for ; Mon, 9 Dec 2024 09:50:43 +0000 (UTC) X-FDA: 82874950704.15.B4F28D2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf24.hostedemail.com (Postfix) with ESMTP id B644A180016 for ; Mon, 9 Dec 2024 09:50:39 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf24.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733737833; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4mPs3wye+bX06omYN6bcJnJM599UffflhhHId/XaClw=; b=52amNUfUjtgS8V+i+1dWWSxByH91NYg2LShzwa6NfXRgkYJtTdE3JH4DiaUHAUbKMoofh4 JXSotyzSsEzTkFIaZvQpAZ0ehO16eSC/lcUgrkYeFs6+UqjVj1eyuC4LrSaa+NJ3WN27pN /nr/FWzw+vgBfjTonT9c5IT7PVZtJJI= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf24.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733737833; a=rsa-sha256; cv=none; b=FYH5qWs1V/8HWtCVOH/OnYoV9bXusK0DoaSPyp4k873TLejAOUI78hfS0cDIO/LkNP+72n ylYhlUEoYDIHztoL8us4l/3vCrTqYz701WkvdDFAslRwJNMHrn/nQs4NvvlxxY3eBZMx0z JDhtVOmeigm2N6rAltOuIH785Hn8gnQ= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AE5D0143D; Mon, 9 Dec 2024 01:51:09 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A4ABF3F720; Mon, 9 Dec 2024 01:50:39 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , akpm@linux-foundation.org, aruna.ramakrishna@oracle.com, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, keith.lucas@oracle.com, ryan.roberts@arm.com, shuah@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 01/14] selftests/mm: Fix condition in uffd_move_test_common() Date: Mon, 9 Dec 2024 09:50:06 +0000 Message-ID: <20241209095019.1732120-2-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241209095019.1732120-1-kevin.brodsky@arm.com> References: <20241209095019.1732120-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: B644A180016 X-Stat-Signature: a66webheewucxmhubu9d6bnnn65ctu99 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1733737839-787395 X-HE-Meta: U2FsdGVkX1+tjLXqhwhcf2p2GnslnvK54uXraWXNzXfMeg6UOoSclOWB42kyXq0Q95fN3R7cJS+rMkpZnBJFz9z8MLrzCXBt7OB5/scQKp6pPs00t2ppEYDpA5w43HKL2SVivRkwj5zlTRF0kqMSnsIjtilUjpHt95tioG3fnhWISRnK/jQ57tO8rVSilU4u2pNjv8DUSOt6XVlSPBwdEbmibNKyQpvRa/dt+jbFrYatiBYri7KWbO1WBYnmcrc82bG/D/zlQKlPu2gTob7pMboDJ4C4PmeeLYqT7dqkhrBpiTGPnhMrKqoSma6CSq1f99HrBUfPr1V+OtQQ3TsCwPBzSWvshBM3CYE9oUgPivdBQ3vMDpkvEpPhktFIqopfrwlj3vofOOp7fJyLm2eH7tJuBTTn7P1bXOKb2B1Qo2NOVXh4o9dAt3SyFhXJFfd06y/lWJ7Y1MxqZONUas8IZKbvwMxm0EuXuiMdt4kewg0lJKPqt0KmTu+D/Cv3Xzz28zfu5GXLsUnfn5281vxF8O18bp6vgiZTetzcaAGzh4X+8bXIh9T+JW0rWEbxR3g698QJW9ycUo5RoTnvleT82mRipEgs84zIjpEJBXXAnJelqm/iu33WTEd4Fw6AqYHST2pGbswiFrK+wt8NLi7XbpdWkRdxagI3j608XT/eHVyepw9kOL/p9QYWKVh/7EdqaYUsXsYuMse1zPLTZjd9Hjz2BKn6DuGPEw0hj9TTA5BVqHtqF0+F0Ht9VuNpLBQ5ge4NSkIlsmR/oGoGL4qXs741ot59kLaKe4MCXAk03+eDTTyaxZDXdMgRvXSnI/UEeieF26GHLFXJGRpl+JdzBFMa9SFNLs5rJ4jepFGPnZQRaozLkgKC1fRP4nf0i3uaGUjfB/RFPcRJNcAUuiYIVI2e7wtf/0Gv5iqPg0RHaYvaTLUtFz5cPR9a6X2W8EAJTSFSl/PdCFNeYpVqwYE fwjcesny DvJba4RkQzIa5efhNJO3N0QuoLnj2qvkB3/EIPCTWg4eTDK7tKcUs6niPWlFRdLt9dEv2q11K1B2jnUYCJZOJDGZ3pYf1TVYD36U+9IyFXMw0Kjwe9tvzLfK5+U04ZCvxRhh5aW/MZ4kPymTVyZjySWnThWHU8c5JUI7nKTagat/Eua49ekX0x1Jz91oNfPop9J8Se0dpUzTjJdf9KgSh9cZ+YTipuvJw05muHDCwfPh+Xn4rbNXrQL0MJboe+KWEgIVdVSOVyvT2ihb7n9sLwutl8YlKu1A2uNkXqLk2NzzoFweXLIVCf3aAHCkmFRIczZrz X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: area_src and area_dst are saved at the beginning of the function if chunk_size > page_size. The intention is quite clearly to restore them at the end based on the same condition, but step_size is considered instead of chunk_size. Considering that step_size is a number of pages, the condition is likely to be false. Use the same condition as when saving so that the globals are restored as intended. Fixes: a2bf6a9ca805 ("selftests/mm: add UFFDIO_MOVE ioctl test") Signed-off-by: Kevin Brodsky --- tools/testing/selftests/mm/uffd-unit-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index a2e71b1636e7..74c884713bf7 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -1190,7 +1190,7 @@ uffd_move_test_common(uffd_test_args_t *targs, unsigned long chunk_size, nr, count, count_verify[src_offs + nr + i]); } } - if (step_size > page_size) { + if (chunk_size > page_size) { area_src = orig_area_src; area_dst = orig_area_dst; }