From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: Nayna Jain <nayna@linux.ibm.com>,
linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org,
linux-integrity@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Jeremy Kerr <jk@ozlabs.org>,
Matthew Garret <matthew.garret@nebula.com>,
Mimi Zohar <zohar@linux.ibm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Claudio Carvalho <cclaudio@linux.ibm.com>,
George Wilson <gcwilson@linux.ibm.com>,
Elaine Palmer <erpalmer@us.ibm.com>,
Eric Ricther <erichte@linux.ibm.com>,
Oliver O'Halloran <oohall@gmail.com>
Subject: Re: [PATCH v5 1/4] powerpc/powernv: Add OPAL API interface to access secure variable
Date: Fri, 25 Oct 2019 08:48:36 -0700 [thread overview]
Message-ID: <6ccea081-12a5-302f-331b-29ac06f3b228@linux.microsoft.com> (raw)
In-Reply-To: <20191025004729.4452-2-nayna@linux.ibm.com>
On 10/24/19 5:47 PM, Nayna Jain wrote:
>
> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
> index 378e3997845a..c1f25a760eb1 100644
> --- a/arch/powerpc/include/asm/opal-api.h
> +++ b/arch/powerpc/include/asm/opal-api.h
> @@ -211,7 +211,10 @@
> #define OPAL_MPIPL_UPDATE 173
> #define OPAL_MPIPL_REGISTER_TAG 174
> #define OPAL_MPIPL_QUERY_TAG 175
> -#define OPAL_LAST 175
> +#define OPAL_SECVAR_GET 176
> +#define OPAL_SECVAR_GET_NEXT 177
> +#define OPAL_SECVAR_ENQUEUE_UPDATE 178
> +#define OPAL_LAST 178
Adjust indentation in the above #defines.
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index a0cf8fba4d12..9986ac34b8e2 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -298,6 +298,13 @@ int opal_sensor_group_clear(u32 group_hndl, int token);
> int opal_sensor_group_enable(u32 group_hndl, int token, bool enable);
> int opal_nx_coproc_init(uint32_t chip_id, uint32_t ct);
>
> +int opal_secvar_get(const char *key, uint64_t key_len, u8 *data,
> + uint64_t *data_size);
> +int opal_secvar_get_next(const char *key, uint64_t *key_len,
> + uint64_t key_buf_size);
> +int opal_secvar_enqueue_update(const char *key, uint64_t key_len, u8 *data,
> + uint64_t data_size);
> +
Fix alignment of the parameters in the 2nd line.
Same comment in a few other files in this change set.
> +
> +static int opal_get_variable(const char *key, uint64_t ksize,
> + u8 *data, uint64_t *dsize)
> +{
> + int rc;
> +
> + if (!key || !dsize)
> + return -EINVAL;
> +
> + *dsize = cpu_to_be64(*dsize);
> +
> + rc = opal_secvar_get(key, ksize, data, dsize);
> +
> + *dsize = be64_to_cpu(*dsize);
Is it ok to update dsize even if return code (rc) from opal_secvar_get
is an error? Just wanted to confirm.
> +
> + *keylen = cpu_to_be64(*keylen);
> +
> + rc = opal_secvar_get_next(key, keylen, keybufsize);
> +
> + *keylen = be64_to_cpu(*keylen);
Same comment as above.
> +
> + set_secvar_ops(&opal_secvar_ops);
Does this set function return status?
> +
> + return 0;
> +}
WARNING: multiple messages have this Message-ID (diff)
From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: Nayna Jain <nayna@linux.ibm.com>,
linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org,
linux-integrity@vger.kernel.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Eric Ricther <erichte@linux.ibm.com>,
linux-kernel@vger.kernel.org, Mimi Zohar <zohar@linux.ibm.com>,
Claudio Carvalho <cclaudio@linux.ibm.com>,
Matthew Garret <matthew.garret@nebula.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Paul Mackerras <paulus@samba.org>, Jeremy Kerr <jk@ozlabs.org>,
Elaine Palmer <erpalmer@us.ibm.com>,
Oliver O'Halloran <oohall@gmail.com>,
George Wilson <gcwilson@linux.ibm.com>
Subject: Re: [PATCH v5 1/4] powerpc/powernv: Add OPAL API interface to access secure variable
Date: Fri, 25 Oct 2019 08:48:36 -0700 [thread overview]
Message-ID: <6ccea081-12a5-302f-331b-29ac06f3b228@linux.microsoft.com> (raw)
In-Reply-To: <20191025004729.4452-2-nayna@linux.ibm.com>
On 10/24/19 5:47 PM, Nayna Jain wrote:
>
> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
> index 378e3997845a..c1f25a760eb1 100644
> --- a/arch/powerpc/include/asm/opal-api.h
> +++ b/arch/powerpc/include/asm/opal-api.h
> @@ -211,7 +211,10 @@
> #define OPAL_MPIPL_UPDATE 173
> #define OPAL_MPIPL_REGISTER_TAG 174
> #define OPAL_MPIPL_QUERY_TAG 175
> -#define OPAL_LAST 175
> +#define OPAL_SECVAR_GET 176
> +#define OPAL_SECVAR_GET_NEXT 177
> +#define OPAL_SECVAR_ENQUEUE_UPDATE 178
> +#define OPAL_LAST 178
Adjust indentation in the above #defines.
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index a0cf8fba4d12..9986ac34b8e2 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -298,6 +298,13 @@ int opal_sensor_group_clear(u32 group_hndl, int token);
> int opal_sensor_group_enable(u32 group_hndl, int token, bool enable);
> int opal_nx_coproc_init(uint32_t chip_id, uint32_t ct);
>
> +int opal_secvar_get(const char *key, uint64_t key_len, u8 *data,
> + uint64_t *data_size);
> +int opal_secvar_get_next(const char *key, uint64_t *key_len,
> + uint64_t key_buf_size);
> +int opal_secvar_enqueue_update(const char *key, uint64_t key_len, u8 *data,
> + uint64_t data_size);
> +
Fix alignment of the parameters in the 2nd line.
Same comment in a few other files in this change set.
> +
> +static int opal_get_variable(const char *key, uint64_t ksize,
> + u8 *data, uint64_t *dsize)
> +{
> + int rc;
> +
> + if (!key || !dsize)
> + return -EINVAL;
> +
> + *dsize = cpu_to_be64(*dsize);
> +
> + rc = opal_secvar_get(key, ksize, data, dsize);
> +
> + *dsize = be64_to_cpu(*dsize);
Is it ok to update dsize even if return code (rc) from opal_secvar_get
is an error? Just wanted to confirm.
> +
> + *keylen = cpu_to_be64(*keylen);
> +
> + rc = opal_secvar_get_next(key, keylen, keybufsize);
> +
> + *keylen = be64_to_cpu(*keylen);
Same comment as above.
> +
> + set_secvar_ops(&opal_secvar_ops);
Does this set function return status?
> +
> + return 0;
> +}
next prev parent reply other threads:[~2019-10-25 15:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-25 0:47 [PATCH v5 0/4] powerpc: expose secure variables to the kernel and userspace Nayna Jain
2019-10-25 0:47 ` Nayna Jain
2019-10-25 0:47 ` [PATCH v5 1/4] powerpc/powernv: Add OPAL API interface to access secure variable Nayna Jain
2019-10-25 0:47 ` Nayna Jain
2019-10-25 15:48 ` Lakshmi Ramasubramanian [this message]
2019-10-25 15:48 ` Lakshmi Ramasubramanian
2019-10-25 0:47 ` [PATCH v5 2/4] powerpc: expose secure variables to userspace via sysfs Nayna Jain
2019-10-25 0:47 ` Nayna Jain
2019-10-25 15:58 ` Lakshmi Ramasubramanian
2019-10-25 15:58 ` Lakshmi Ramasubramanian
2019-10-25 0:47 ` [PATCH v5 3/4] x86/efi: move common keyring handler functions to new file Nayna Jain
2019-10-25 0:47 ` Nayna Jain
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=6ccea081-12a5-302f-331b-29ac06f3b228@linux.microsoft.com \
--to=nramas@linux.microsoft.com \
--cc=ard.biesheuvel@linaro.org \
--cc=benh@kernel.crashing.org \
--cc=cclaudio@linux.ibm.com \
--cc=erichte@linux.ibm.com \
--cc=erpalmer@us.ibm.com \
--cc=gcwilson@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jk@ozlabs.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=matthew.garret@nebula.com \
--cc=mpe@ellerman.id.au \
--cc=nayna@linux.ibm.com \
--cc=oohall@gmail.com \
--cc=paulus@samba.org \
--cc=zohar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.