From: Michael Ellerman <mpe@ellerman.id.au>
To: Nathan Lynch via B4 Relay
<devnull+nathanl.linux.ibm.com@kernel.org>,
Nicholas Piggin <npiggin@gmail.com>
Cc: "Nathan Lynch" <nathanl@linux.ibm.com>,
tyreld@linux.ibm.com, "Michal Suchánek" <msuchanek@suse.de>,
linuxppc-dev@lists.ozlabs.org, gcwilson@linux.ibm.com
Subject: Re: [PATCH v4 13/13] powerpc/selftests: Add test for papr-sysparm
Date: Wed, 29 Nov 2023 12:08:33 +1100 [thread overview]
Message-ID: <87plzt2woe.fsf@mail.lhotse> (raw)
In-Reply-To: <20231117-papr-sys_rtas-vs-lockdown-v4-13-b794d8cb8502@linux.ibm.com>
Nathan Lynch via B4 Relay <devnull+nathanl.linux.ibm.com@kernel.org>
writes:
> From: Nathan Lynch <nathanl@linux.ibm.com>
>
> Consistently testing system parameter access is a bit difficult by
> nature -- the set of parameters available depends on the model and
> system configuration, and updating a parameter should be considered a
> destructive operation reserved for the admin.
...
> diff --git a/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c b/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
> new file mode 100644
> index 000000000000..fc25c03e8bc7
> --- /dev/null
> +++ b/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
> @@ -0,0 +1,164 @@
...
> +static int set_hmc0(void)
> +{
> + struct papr_sysparm_io_block sp = {
> + .parameter = 0, // HMC0, not a settable parameter
> + };
> + const int devfd = open(DEVPATH, O_RDONLY);
> +
> + SKIP_IF_MSG(devfd < 0 && errno == ENOENT,
> + DEVPATH " not present");
> +
> + FAIL_IF(devfd < 0);
> +
> + // Ensure expected error
> + FAIL_IF(ioctl(devfd, PAPR_SYSPARM_IOC_SET, &sp) != -1);
> + FAIL_IF(errno != EPERM);
> +
> + FAIL_IF(close(devfd) != 0);
> +
> + return 0;
> +}
This one fails when run with qemu/KVM.
# selftests: powerpc: papr_sysparm
# test: open and close /dev/papr-sysparm without issuing commands
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# success: open and close /dev/papr-sysparm without issuing commands
# test: retrieve SPLPAR characteristics
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# success: retrieve SPLPAR characteristics
# test: verify EOPNOTSUPP for known-bad parameter
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# success: verify EOPNOTSUPP for known-bad parameter
# test: PAPR_SYSPARM_IOC_GET returns EFAULT on bad address
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# success: PAPR_SYSPARM_IOC_GET returns EFAULT on bad address
# test: PAPR_SYSPARM_IOC_SET returns EFAULT on bad address
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# success: PAPR_SYSPARM_IOC_SET returns EFAULT on bad address
# test: ensure EPERM on attempt to update HMC0
# tags: git_version:v6.7-rc2-35-g41ada9f713ae
# [FAIL] Test FAILED on line 113
# failure: ensure EPERM on attempt to update HMC0
It's returning EOPNOTSUPP.
Something like below would work to fix it.
cheers
diff --git a/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c b/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
index fc25c03e8bc7..9d4850c25aed 100644
--- a/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
+++ b/tools/testing/selftests/powerpc/papr_sysparm/papr_sysparm.c
@@ -110,6 +110,7 @@ static int set_hmc0(void)
// Ensure expected error
FAIL_IF(ioctl(devfd, PAPR_SYSPARM_IOC_SET, &sp) != -1);
+ SKIP_IF_MSG(errno == EOPNOTSUPP, "operation not supported");
FAIL_IF(errno != EPERM);
FAIL_IF(close(devfd) != 0);
prev parent reply other threads:[~2023-11-29 1:09 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-18 5:14 [PATCH v4 00/13] powerpc/pseries: New character devices for system parameters and VPD Nathan Lynch via B4 Relay
2023-11-18 5:14 ` [PATCH v4 01/13] powerpc/rtas: Add for_each_rtas_function() iterator Nathan Lynch via B4 Relay
2023-11-20 8:07 ` Aneesh Kumar K.V
2023-11-18 5:14 ` [PATCH v4 02/13] powerpc/rtas: Fall back to linear search on failed token->function lookup Nathan Lynch via B4 Relay
2023-11-20 8:07 ` Aneesh Kumar K.V
2023-11-18 5:14 ` [PATCH v4 03/13] powerpc/rtas: Add function return status constants Nathan Lynch via B4 Relay
2023-11-20 8:08 ` Aneesh Kumar K.V
2023-11-18 5:14 ` [PATCH v4 04/13] powerpc/rtas: Factor out function descriptor lookup Nathan Lynch via B4 Relay
2023-11-20 8:08 ` Aneesh Kumar K.V
2023-11-18 5:14 ` [PATCH v4 05/13] powerpc/rtas: Facilitate high-level call sequences Nathan Lynch via B4 Relay
2023-11-20 8:10 ` Aneesh Kumar K.V
2023-11-28 15:35 ` Nathan Lynch
2023-11-28 22:30 ` Michael Ellerman
2023-11-28 23:05 ` Nathan Lynch
2023-11-29 13:20 ` Michael Ellerman
2023-11-30 18:26 ` Nathan Lynch
2023-11-30 21:41 ` Nathan Lynch
2023-11-30 22:46 ` Michael Ellerman
2023-11-30 23:53 ` Nathan Lynch
2023-12-05 16:51 ` Nathan Lynch
2023-12-07 1:02 ` Michael Ellerman
2023-11-29 2:11 ` Michael Ellerman
2023-11-29 2:37 ` Nathan Lynch
2023-11-29 3:16 ` Michael Ellerman
2023-11-18 5:14 ` [PATCH v4 06/13] powerpc/rtas: Serialize firmware activation sequences Nathan Lynch via B4 Relay
2023-11-20 8:12 ` Aneesh Kumar K.V
2023-11-28 15:32 ` Nathan Lynch
2023-11-28 15:46 ` Aneesh Kumar K.V
2023-11-28 16:16 ` Nathan Lynch
2023-11-28 16:41 ` Nathan Lynch
2023-11-18 5:14 ` [PATCH v4 07/13] powerpc/rtas: Warn if per-function lock isn't held Nathan Lynch via B4 Relay
2023-11-20 8:13 ` Aneesh Kumar K.V
2023-11-18 5:14 ` [PATCH v4 08/13] powerpc/uapi: Export papr-miscdev.h header Nathan Lynch via B4 Relay
2023-11-18 5:14 ` [PATCH v4 09/13] powerpc/pseries: Add papr-vpd character driver for VPD retrieval Nathan Lynch via B4 Relay
2023-11-21 8:31 ` Michal Suchánek
2023-11-28 15:38 ` Nathan Lynch
2023-11-29 2:07 ` Michael Ellerman
2023-11-29 2:41 ` Nathan Lynch
2023-11-29 3:13 ` Michael Ellerman
2023-11-18 5:14 ` [PATCH v4 10/13] powerpc/pseries/papr-sysparm: Validate buffer object lengths Nathan Lynch via B4 Relay
2023-11-18 5:14 ` [PATCH v4 11/13] powerpc/pseries/papr-sysparm: Expose character device to user space Nathan Lynch via B4 Relay
2023-11-18 5:14 ` [PATCH v4 12/13] powerpc/selftests: Add test for papr-vpd Nathan Lynch via B4 Relay
2023-11-18 5:14 ` [PATCH v4 13/13] powerpc/selftests: Add test for papr-sysparm Nathan Lynch via B4 Relay
2023-11-29 1:08 ` Michael Ellerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87plzt2woe.fsf@mail.lhotse \
--to=mpe@ellerman.id.au \
--cc=devnull+nathanl.linux.ibm.com@kernel.org \
--cc=gcwilson@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=msuchanek@suse.de \
--cc=nathanl@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=tyreld@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).