From patchwork Sun Jan 26 07:47:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13950602 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 12D8DC0218D for ; Sun, 26 Jan 2025 07:48:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F46E2800EB; Sun, 26 Jan 2025 02:48:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A3CC2800E8; Sun, 26 Jan 2025 02:48:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66BA52800EB; Sun, 26 Jan 2025 02:48:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 463DA2800E8 for ; Sun, 26 Jan 2025 02:48:06 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E6E99120731 for ; Sun, 26 Jan 2025 07:48:05 +0000 (UTC) X-FDA: 83048824530.10.8CA0980 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf25.hostedemail.com (Postfix) with ESMTP id 5E82AA0004 for ; Sun, 26 Jan 2025 07:48:04 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=t5r4qgbb; spf=pass (imf25.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737877684; 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:dkim-signature; bh=+HrNZ99qkNC8KEVuL9mBInkUyujn5g9T+2i2xoZ40eA=; b=AgYMZCi7HedDviU5GyBhv9HLUtI/tMNbv0BMyrP5V9E5b9PgSKrm8NvKVG2NKVYIKFBTGv r09m/ToOePbS8Am9z0EahzpK97fmHjcTX6nXVkTdWXBL9gj7Og9gvm8qSum7aTHeb9S3AZ KVO0/ozuqZpQKY3gsbZsqGaFgUBzfyQ= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=t5r4qgbb; spf=pass (imf25.hostedemail.com: domain of rppt@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737877684; a=rsa-sha256; cv=none; b=G7ipqod1eMf1JH7lY7cBHwW4rH9I+Ru5Opd1m+xyPB7AVHkbFx3qWhrU+0+XNUrSzOGERc sNfZzVJJsc1OPpiDRaUacKkfINWmf2nmj9FGfGKrzfhgGnjDGhZzuf2A1x7v8a2z8QnAe/ 6mmgQWZPj6inWfp2t/Sm4aGxZK4F8oA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 1B329A40135; Sun, 26 Jan 2025 07:46:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34FF5C4CEEA; Sun, 26 Jan 2025 07:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737877682; bh=dDY3jvGc45EmH43gWTWL5MYq9/Q1o2IM8rTUBWv64F4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t5r4qgbbVp+nn4AwESyq/kRBw7iTmIzwwOhO3g1QZKZPsL1LLunQnJSvESCwGNX31 fLfPLM9b9UVXxJ1voOhzdE2kaPMQswbGjy8LnTPVrwb6a+JqfwGRg2d2bTNgrVscEe wSEIp2UELK9QFXarhTcBem6rAsoeTzDEztXuHCE2IDKD+8q+h8vaMBMOtMBsslCWMI LgFtJPlxWPZ4Duaypkzc9ZGfgijEAzwbLYGxqkBN05QJpFrSNxB7AbaKYpR/BrwIrv JImzfewDKD/78iXFN+lUP0nSrcuA/GyVpaKeOoJZZ9LFtTqCUm0WT0cIxtZCjp9p3E Oz/ejtI5b29RQ== From: Mike Rapoport To: x86@kernel.org Cc: Andrew Morton , Andy Lutomirski , Anton Ivanov , Borislav Petkov , Brendan Higgins , Daniel Gomez , Daniel Thompson , Dave Hansen , David Gow , Douglas Anderson , Ingo Molnar , Jason Wessel , Jiri Kosina , Joe Lawrence , Johannes Berg , Josh Poimboeuf , "Kirill A. Shutemov" , Lorenzo Stoakes , Luis Chamberlain , Mark Rutland , Masami Hiramatsu , Mike Rapoport , Miroslav Benes , "H. Peter Anvin" , Peter Zijlstra , Petr Mladek , Petr Pavlu , Rae Moar , Richard Weinberger , Sami Tolvanen , Shuah Khan , Song Liu , Steven Rostedt , Thomas Gleixner , kgdb-bugreport@lists.sourceforge.net, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-um@lists.infradead.org, live-patching@vger.kernel.org Subject: [PATCH v3 1/9] x86/mm/pat: cpa-test: fix length for CPA_ARRAY test Date: Sun, 26 Jan 2025 09:47:25 +0200 Message-ID: <20250126074733.1384926-2-rppt@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250126074733.1384926-1-rppt@kernel.org> References: <20250126074733.1384926-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Que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RL0Ka8 qb4gkQ3a hlFJkm35MQUXlGoEdeThMQtpKMvVPJtsdfl41BSf2bFPNtkj1UnmLzQDVZkJX+tIOtvIT4h1kKgj3ErUWp6XHpjRQySdE67F5irp39Sl79BiqNKfTPjh/4nV2ObgMV//w10H+HPcC4j5qcnxNfKaufOR6f/fsUL1N8e1X5Lb5pgCrtLJq60VFxbna9p5l+xRAozSTUSI4SJZLCsIk1lrRv44yIn4nhbgRuhKw8qtOtepijE5qjTpJU7q/sPsCQVB2220eJoxfB36CILxR5tOSKE4wHA== 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: From: "Mike Rapoport (Microsoft)" The CPA_ARRAY test always uses len[1] as numpages argument to change_page_attr_set() although the addresses array is different each iteration of the test loop. Replace len[1] with len[i] to have numpages matching the addresses array. Fixes: ecc729f1f471 ("x86/mm/cpa: Add ARRAY and PAGES_ARRAY selftests") Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/mm/pat/cpa-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/pat/cpa-test.c b/arch/x86/mm/pat/cpa-test.c index 3d2f7f0a6ed1..ad3c1feec990 100644 --- a/arch/x86/mm/pat/cpa-test.c +++ b/arch/x86/mm/pat/cpa-test.c @@ -183,7 +183,7 @@ static int pageattr_test(void) break; case 1: - err = change_page_attr_set(addrs, len[1], PAGE_CPA_TEST, 1); + err = change_page_attr_set(addrs, len[i], PAGE_CPA_TEST, 1); break; case 2: