linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Steffen Eiden <seiden@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 1/4] s390x: uv-host: Add attestation test
Date: Thu, 3 Feb 2022 17:37:39 +0100	[thread overview]
Message-ID: <20220203173739.2b3b7d1e@p-imbrenda> (raw)
In-Reply-To: <20220203091935.2716-2-seiden@linux.ibm.com>

On Thu,  3 Feb 2022 09:19:32 +0000
Steffen Eiden <seiden@linux.ibm.com> wrote:

> Adds an invalid command test for attestation in the uv-host.
> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
>
> ---
>  lib/s390x/asm/uv.h | 23 ++++++++++++++++++++++-
>  s390x/uv-host.c    |  1 +
>  2 files changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> index 97c90e81..7afbcffd 100644
> --- a/lib/s390x/asm/uv.h
> +++ b/lib/s390x/asm/uv.h
> @@ -1,7 +1,7 @@
>  /*
>   * s390x Ultravisor related definitions
>   *
> - * Copyright (c) 2020 IBM Corp
> + * Copyright IBM Corp. 2020, 2022
>   *
>   * Authors:
>   *  Janosch Frank <frankja@linux.ibm.com>
> @@ -47,6 +47,7 @@
>  #define UVC_CMD_UNPIN_PAGE_SHARED	0x0342
>  #define UVC_CMD_SET_SHARED_ACCESS	0x1000
>  #define UVC_CMD_REMOVE_SHARED_ACCESS	0x1001
> +#define UVC_CMD_ATTESTATION		0x1020
>  
>  /* Bits in installed uv calls */
>  enum uv_cmds_inst {
> @@ -71,6 +72,7 @@ enum uv_cmds_inst {
>  	BIT_UVC_CMD_UNSHARE_ALL = 20,
>  	BIT_UVC_CMD_PIN_PAGE_SHARED = 21,
>  	BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22,
> +	BIT_UVC_CMD_ATTESTATION = 28,
>  };
>  
>  struct uv_cb_header {
> @@ -178,6 +180,25 @@ struct uv_cb_cfs {
>  	u64 paddr;
>  }  __attribute__((packed))  __attribute__((aligned(8)));
>  
> +/* Retrieve Attestation Measurement */
> +struct uv_cb_attest {
> +	struct uv_cb_header header;	/* 0x0000 */
> +	u64 reserved08[2];		/* 0x0008 */
> +	u64 arcb_addr;			/* 0x0018 */
> +	u64 continuation_token;		/* 0x0020 */
> +	u8  reserved28[6];		/* 0x0028 */
> +	u16 user_data_length;		/* 0x002e */
> +	u8  user_data[256];		/* 0x0030 */
> +	u32 reserved130[3];		/* 0x0130 */
> +	u32 measurement_length;		/* 0x013c */
> +	u64 measurement_address;	/* 0x0140 */
> +	u8 config_uid[16];		/* 0x0148 */
> +	u32 reserved158;		/* 0x0158 */
> +	u32 add_data_length;		/* 0x015c */
> +	u64 add_data_address;		/* 0x0160 */
> +	u64 reserved168[4];		/* 0x0168 */

please use uint*_t types!

with that fixed: 

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> +}  __attribute__((packed))  __attribute__((aligned(8)));
> +
>  /* Set Secure Config Parameter */
>  struct uv_cb_ssc {
>  	struct uv_cb_header header;
> diff --git a/s390x/uv-host.c b/s390x/uv-host.c
> index 92a41069..946f031e 100644
> --- a/s390x/uv-host.c
> +++ b/s390x/uv-host.c
> @@ -418,6 +418,7 @@ static struct cmd_list invalid_cmds[] = {
>  	{ "bogus", 0x4242, sizeof(struct uv_cb_header), -1},
>  	{ "share", UVC_CMD_SET_SHARED_ACCESS, sizeof(struct uv_cb_share), BIT_UVC_CMD_SET_SHARED_ACCESS },
>  	{ "unshare", UVC_CMD_REMOVE_SHARED_ACCESS, sizeof(struct uv_cb_share), BIT_UVC_CMD_REMOVE_SHARED_ACCESS },
> +	{ "attest", UVC_CMD_ATTESTATION, sizeof(struct uv_cb_attest), BIT_UVC_CMD_ATTESTATION },
>  	{ NULL, 0, 0 },
>  };
>  


  reply	other threads:[~2022-02-03 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  9:19 [kvm-unit-tests PATCH v2 0/4] s390x: Attestation tests Steffen Eiden
2022-02-03  9:19 ` [kvm-unit-tests PATCH v2 1/4] s390x: uv-host: Add attestation test Steffen Eiden
2022-02-03 16:37   ` Claudio Imbrenda [this message]
2022-02-03  9:19 ` [kvm-unit-tests PATCH v2 2/4] s390x: lib: Add QUI getter Steffen Eiden
2022-02-03 16:12   ` Claudio Imbrenda
2022-02-04  8:18     ` Janosch Frank
2022-02-03  9:19 ` [kvm-unit-tests PATCH v2 3/4] s390x: uv-guest: remove duplicated checks Steffen Eiden
2022-02-03 16:31   ` Claudio Imbrenda
2022-02-08 14:57     ` Steffen Eiden
2022-02-03  9:19 ` [kvm-unit-tests PATCH v2 4/4] s390x: uv-guest: Add attestation tests Steffen Eiden
2022-02-03 17:37   ` Claudio Imbrenda

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=20220203173739.2b3b7d1e@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=thuth@redhat.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).