Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1253244pxa; Thu, 20 Aug 2020 06:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvqTq7Vpfp9fGPZrR+XqyIOt+lk8gveJITipZivRikIE/l4JRcgswyrbleE6PJFdcarHTT X-Received: by 2002:a05:6402:2042:: with SMTP id bc2mr3007423edb.109.1597931453486; Thu, 20 Aug 2020 06:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931453; cv=none; d=google.com; s=arc-20160816; b=Owk85v/nW2T2s5DkHA4v2kLGFZN1DX2bR/v9WcYNn9eJJKI/YKeMdRmYCIgTFGbEq9 XSEKTFJjw1/AG2DG/xCGEzPvomhHWO7AHSibWpvkI9qIXs1qpkotUCWRF4jb8GGaZGWw iVtiOxZohp1iNVcjSLbTQdKnuw8mRsfkPxqxys67ezZvA7X4oMsTXjioN0Tqb3dEcTj9 FKsUkZfxvUwwrS2DhjbIRL8YcBmG/xnscjumUgvJp0+mng0vyYOBFOjiGc3QfRc4TUYH 4w61R64hhfOVLjbF6saUIW8KZGn+40wEXrqBBrBT3KriFtbks0EXDveVmDsVq4v2GkeX j2aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=26wOjno2DGwRDtIOt3dC/mM1ZR5KHBJZp8dORVDMylQ=; b=iRo71ASREE0ZNUDMNkYSnPB0Gr9UrVnxBJx/tIE9ZIP8E6YzH7u+u1T2vaEuFANhWo NnkKXnwf+mJhce/k45C/iDVuqOPpGXGO0IBwu8SOq4zkXSEw3ZD+VbyIeHfhDEpCWt6Y joXppNOCE/feBBT1qlYAquUeGZ9puQr9OXSXnTrngGabMsU4Qs50du33sU9eAqkrGKAj 2etkChF03+H36MKSLJ9xXRBJiPPmb0veyUH3K15sn1+58GN3ktvdPlq4YZhIg/p+JyV3 3+kO/x65uFvIhYqBdL9JYBf5nWBL+pGCiUmQoDZVTcW8s4qefNCI7LFNYM0galJTsOGQ px8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l0Xbcp4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s23si1446558edy.158.2020.08.20.06.50.29; Thu, 20 Aug 2020 06:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l0Xbcp4s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729483AbgHTNjS (ORCPT + 99 others); Thu, 20 Aug 2020 09:39:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727828AbgHTJam (ORCPT ); Thu, 20 Aug 2020 05:30:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99A2420855; Thu, 20 Aug 2020 09:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915842; bh=BP2uJ9ktq3oZUfwxtBO2odfhgCbCxzcgJfknfPirCqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l0Xbcp4s6LeWuK3aGfiGAiKi8ty8gakiLL6VpHV//TnaqlCqaUEIC51uBQxMPV3D2 vLIwMpEf9HebEZdMafoTJI25hanw7izHMhulcvbd7nysobms/iZ0F4pLcRbb/q+FFk BjQ1eWQJylLGHpi7HwKyYSYffc0HRYcBc/DX0Ok0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Aneesh Kumar K.V" , Michael Ellerman , Sasha Levin Subject: [PATCH 5.8 152/232] selftests/powerpc: ptrace-pkey: Rename variables to make it easier to follow code Date: Thu, 20 Aug 2020 11:20:03 +0200 Message-Id: <20200820091620.172673057@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aneesh Kumar K.V [ Upstream commit 9a11f12e0a6c374b3ef1ce81e32ce477d28eb1b8 ] Rename variable to indicate that they are invalid values which we will use to test ptrace update of pkeys. Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200709032946.881753-21-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin --- .../selftests/powerpc/ptrace/ptrace-pkey.c | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index bdbbbe8431e03..f9216c7a1829e 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c @@ -44,7 +44,7 @@ struct shared_info { unsigned long amr2; /* AMR value that ptrace should refuse to write to the child. */ - unsigned long amr3; + unsigned long invalid_amr; /* IAMR value the parent expects to read from the child. */ unsigned long expected_iamr; @@ -57,8 +57,8 @@ struct shared_info { * (even though they're valid ones) because userspace doesn't have * access to those registers. */ - unsigned long new_iamr; - unsigned long new_uamor; + unsigned long invalid_iamr; + unsigned long invalid_uamor; }; static int sys_pkey_alloc(unsigned long flags, unsigned long init_access_rights) @@ -100,7 +100,7 @@ static int child(struct shared_info *info) info->amr1 |= 3ul << pkeyshift(pkey1); info->amr2 |= 3ul << pkeyshift(pkey2); - info->amr3 |= info->amr2 | 3ul << pkeyshift(pkey3); + info->invalid_amr |= info->amr2 | 3ul << pkeyshift(pkey3); if (disable_execute) info->expected_iamr |= 1ul << pkeyshift(pkey1); @@ -111,8 +111,8 @@ static int child(struct shared_info *info) info->expected_uamor |= 3ul << pkeyshift(pkey1) | 3ul << pkeyshift(pkey2); - info->new_iamr |= 1ul << pkeyshift(pkey1) | 1ul << pkeyshift(pkey2); - info->new_uamor |= 3ul << pkeyshift(pkey1); + info->invalid_iamr |= 1ul << pkeyshift(pkey1) | 1ul << pkeyshift(pkey2); + info->invalid_uamor |= 3ul << pkeyshift(pkey1); /* * We won't use pkey3. We just want a plausible but invalid key to test @@ -196,9 +196,9 @@ static int parent(struct shared_info *info, pid_t pid) PARENT_SKIP_IF_UNSUPPORTED(ret, &info->child_sync); PARENT_FAIL_IF(ret, &info->child_sync); - info->amr1 = info->amr2 = info->amr3 = regs[0]; - info->expected_iamr = info->new_iamr = regs[1]; - info->expected_uamor = info->new_uamor = regs[2]; + info->amr1 = info->amr2 = info->invalid_amr = regs[0]; + info->expected_iamr = info->invalid_iamr = regs[1]; + info->expected_uamor = info->invalid_uamor = regs[2]; /* Wake up child so that it can set itself up. */ ret = prod_child(&info->child_sync); @@ -234,10 +234,10 @@ static int parent(struct shared_info *info, pid_t pid) return ret; /* Write invalid AMR value in child. */ - ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr3, 1); + ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->invalid_amr, 1); PARENT_FAIL_IF(ret, &info->child_sync); - printf("%-30s AMR: %016lx\n", ptrace_write_running, info->amr3); + printf("%-30s AMR: %016lx\n", ptrace_write_running, info->invalid_amr); /* Wake up child so that it can verify it didn't change. */ ret = prod_child(&info->child_sync); @@ -249,7 +249,7 @@ static int parent(struct shared_info *info, pid_t pid) /* Try to write to IAMR. */ regs[0] = info->amr1; - regs[1] = info->new_iamr; + regs[1] = info->invalid_iamr; ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 2); PARENT_FAIL_IF(!ret, &info->child_sync); @@ -257,7 +257,7 @@ static int parent(struct shared_info *info, pid_t pid) ptrace_write_running, regs[0], regs[1]); /* Try to write to IAMR and UAMOR. */ - regs[2] = info->new_uamor; + regs[2] = info->invalid_uamor; ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 3); PARENT_FAIL_IF(!ret, &info->child_sync); -- 2.25.1