From: Janosch Frank <frankja@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org,
linux-kernel@vger.kernel.org,
Viktor Mihajlovski <mihajlov@linux.ibm.com>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>,
Nico Boehr <nrb@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Hendrik Brueckner <brueckner@linux.ibm.com>
Subject: Re: [PATCH v3 4/6] s390/uvdevice: Add 'Lock Secret Store' UVC
Date: Tue, 6 Jun 2023 17:24:48 +0200 [thread overview]
Message-ID: <2e0a8215-ba68-f80c-1610-fb1e5489f6fd@linux.ibm.com> (raw)
In-Reply-To: <20230606113736.2934503-5-seiden@linux.ibm.com>
On 6/6/23 13:37, Steffen Eiden wrote:
> Userspace can call the Lock Secret Store Ultravisor Call
> using IOCTLs on the uvdevice.
> During the handling of the new IOCTL nr the uvdevice will do some sanity
> checks first. Then, perform the Ultravisor command, and copy the
> return codes to userspace.
> If the Lock Secrets UV facility is not present, UV will return
> invalid command rc. This won't be fenced in the driver and does not
> result in a negative return value. This is also true for any other
> possible error code the UV can return.
>
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
[...]
> +/** uvio_lock_secrets() - perform a Lock Secret Store UVC
> + * @uv_ioctl: ioctl control block
> + *
> + * uvio_lock_secrets() performs the Lock Secret Store Ultravisor Call. It
> + * performs the UV-call and copies the return codes to the ioctl control block.
> + * After this call was dispatched successfully every following Add Secret UVC
> + * and Lock Secrets UVC will fail with return code 0x102.
> + *
> + * The argument address and size must be 0.
> + *
> + * If the List Secrets UV facility is not present, UV will return invalid
> + * command rc. This won't be fenced in the driver and does not result in a
> + * negative return value.
This is not "list secrets" though.
> + *
> + * Context: might sleep
> + *
> + * Return: 0 on success or a negative error code on error.
> + */
> +static int uvio_lock_secrets(struct uvio_ioctl_cb *ioctl)
> +{
> + struct uv_cb_nodata uvcb = {
> + .header.len = sizeof(uvcb),
> + .header.cmd = UVC_CMD_LOCK_SECRETS,
> + };
> +
> + if (ioctl->argument_addr || ioctl->argument_len)
> + return -EINVAL;
> +
> + uv_call(0, (u64)&uvcb);
> + ioctl->uv_rc = uvcb.header.rc;
> + ioctl->uv_rrc = uvcb.header.rrc;
> +
> + return 0;
> +}
> +
> static int uvio_copy_and_check_ioctl(struct uvio_ioctl_cb *ioctl, void __user *argp,
> unsigned long cmd)
> {
> @@ -384,6 +420,9 @@ static long uvio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> case UVIO_IOCTL_LIST_SECRETS_NR:
> ret = uvio_list_secrets(&uv_ioctl);
> break;
> + case UVIO_IOCTL_LOCK_SECRETS_NR:
> + ret = uvio_lock_secrets(&uv_ioctl);
> + break;
> default:
> ret = -ENOIOCTLCMD;
> break;
next prev parent reply other threads:[~2023-06-06 15:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 11:37 [PATCH v3 0/6] s390/uvdevice: Expose secret UVCs Steffen Eiden
2023-06-06 11:37 ` [PATCH v3 1/6] s390/uvdevice: Add info IOCTL Steffen Eiden
2023-06-06 13:33 ` Janosch Frank
2023-06-06 11:37 ` [PATCH v3 2/6] s390/uvdevice: Add 'Add Secret' UVC Steffen Eiden
2023-06-06 14:18 ` Janosch Frank
2023-06-06 11:37 ` [PATCH v3 3/6] s390/uvdevice: Add 'List Secrets' UVC Steffen Eiden
2023-06-06 11:37 ` [PATCH v3 4/6] s390/uvdevice: Add 'Lock Secret Store' UVC Steffen Eiden
2023-06-06 15:24 ` Janosch Frank [this message]
2023-06-06 11:37 ` [PATCH v3 5/6] s390/uv: replace scnprintf with sysfs_emit Steffen Eiden
2023-06-06 13:50 ` Janosch Frank
2023-06-06 11:37 ` [PATCH v3 6/6] s390/uv: Update query for secret-UVCs Steffen Eiden
2023-06-06 15:23 ` Janosch Frank
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=2e0a8215-ba68-f80c-1610-fb1e5489f6fd@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=brueckner@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mihajlov@linux.ibm.com \
--cc=nrb@linux.ibm.com \
--cc=seiden@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