kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/4] s390x: Attestation tests
@ 2022-01-27 14:15 Steffen Eiden
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test Steffen Eiden
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Steffen Eiden @ 2022-01-27 14:15 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

This series adds some test in s390x/uv-guest.c verifying error paths of the
Request Attestation Measurement UVC.
Also adds a test in s390x/uv-host.c to verify that the
Request Attestation Measurement UVC cannot be called in guest1.

Steffen Eiden (4):
  s390x: uv-host: Add attestation test
  s390x: lib: Add QUI getter
  s390x: uv-guest: remove duplicated checks
  s390x: uv-guest: Add attestation tests

 lib/s390x/asm/uv.h |  29 ++++++-
 lib/s390x/uv.c     |  10 ++-
 lib/s390x/uv.h     |   1 +
 s390x/uv-guest.c   | 188 +++++++++++++++++++++++++++++++++++++++++----
 s390x/uv-host.c    |   3 +-
 5 files changed, 211 insertions(+), 20 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test
  2022-01-27 14:15 [kvm-unit-tests PATCH 0/4] s390x: Attestation tests Steffen Eiden
@ 2022-01-27 14:15 ` Steffen Eiden
  2022-01-28  9:00   ` Janosch Frank
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter Steffen Eiden
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Steffen Eiden @ 2022-01-27 14:15 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Adds an invalid command test for attestation in the uv-host.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 lib/s390x/asm/uv.h | 24 +++++++++++++++++++++++-
 s390x/uv-host.c    |  3 ++-
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index 97c90e81..38c322bf 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -1,10 +1,11 @@
 /*
  * s390x Ultravisor related definitions
  *
- * Copyright (c) 2020 IBM Corp
+ * Copyright (c) 2020, 2022 IBM Corp
  *
  * Authors:
  *  Janosch Frank <frankja@linux.ibm.com>
+ *  Steffen Eiden <seiden@linux.ibm.com>
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2.
@@ -47,6 +48,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 +73,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 +181,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 */
+}  __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..0f8ab94a 100644
--- a/s390x/uv-host.c
+++ b/s390x/uv-host.c
@@ -2,7 +2,7 @@
 /*
  * Guest Ultravisor Call tests
  *
- * Copyright (c) 2021 IBM Corp
+ * Copyright (c) 2021, 2022 IBM Corp
  *
  * Authors:
  *  Janosch Frank <frankja@linux.ibm.com>
@@ -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 },
 };
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter
  2022-01-27 14:15 [kvm-unit-tests PATCH 0/4] s390x: Attestation tests Steffen Eiden
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test Steffen Eiden
@ 2022-01-27 14:15 ` Steffen Eiden
  2022-01-28  9:02   ` Janosch Frank
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks Steffen Eiden
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests Steffen Eiden
  3 siblings, 1 reply; 11+ messages in thread
From: Steffen Eiden @ 2022-01-27 14:15 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Some tests need the information provided by the QUI UVC and lib/s390x/uv.c
already has cached the qui result. Let's add a function to avoid
unnecessary  QUI UVCs.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 lib/s390x/uv.c | 10 +++++++++-
 lib/s390x/uv.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/s390x/uv.c b/lib/s390x/uv.c
index 6fe11dff..5625a1ee 100644
--- a/lib/s390x/uv.c
+++ b/lib/s390x/uv.c
@@ -2,7 +2,7 @@
 /*
  * Ultravisor related functionality
  *
- * Copyright 2020 IBM Corp.
+ * Copyright 2020, 2022 IBM Corp.
  *
  * Authors:
  *    Janosch Frank <frankja@linux.ibm.com>
@@ -47,6 +47,14 @@ bool uv_query_test_call(unsigned int nr)
 	return test_bit_inv(nr, uvcb_qui.inst_calls_list);
 }
 
+const struct uv_cb_qui *uv_get_info(void)
+{
+	/* Query needs to be called first */
+	assert(uvcb_qui.header.rc);
+
+	return &uvcb_qui;
+}
+
 int uv_setup(void)
 {
 	if (!test_facility(158))
diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 8175d9c6..e9935fd2 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -8,6 +8,7 @@
 bool uv_os_is_guest(void);
 bool uv_os_is_host(void);
 bool uv_query_test_call(unsigned int nr);
+const struct uv_cb_qui *uv_get_info(void);
 void uv_init(void);
 int uv_setup(void);
 void uv_create_guest(struct vm *vm);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks
  2022-01-27 14:15 [kvm-unit-tests PATCH 0/4] s390x: Attestation tests Steffen Eiden
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test Steffen Eiden
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter Steffen Eiden
@ 2022-01-27 14:15 ` Steffen Eiden
  2022-01-28  9:06   ` Janosch Frank
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests Steffen Eiden
  3 siblings, 1 reply; 11+ messages in thread
From: Steffen Eiden @ 2022-01-27 14:15 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Removing some tests which are done at other points in the code
implicitly.

In lib/s390x/uc.c#setup_uv(void) the rc of the qui result is verified
using asserts.
The whole test is fenced by lib/s390x/uc.c#os_is_guest(void) which
checks if SET and REMOVE SHARED is present.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 s390x/uv-guest.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/s390x/uv-guest.c b/s390x/uv-guest.c
index 44ad2154..909b7256 100644
--- a/s390x/uv-guest.c
+++ b/s390x/uv-guest.c
@@ -2,7 +2,7 @@
 /*
  * Guest Ultravisor Call tests
  *
- * Copyright (c) 2020 IBM Corp
+ * Copyright (c) 2020, 2022 IBM Corp
  *
  * Authors:
  *  Janosch Frank <frankja@linux.ibm.com>
@@ -69,23 +69,15 @@ static void test_query(void)
 	cc = uv_call(0, (u64)&uvcb);
 	report(cc == 1 && uvcb.header.rc == UVC_RC_INV_LEN, "length");
 
-	uvcb.header.len = sizeof(uvcb);
-	cc = uv_call(0, (u64)&uvcb);
-	report((!cc && uvcb.header.rc == UVC_RC_EXECUTED) ||
-	       (cc == 1 && uvcb.header.rc == 0x100),
-		"successful query");
-
 	/*
-	 * These bits have been introduced with the very first
-	 * Ultravisor version and are expected to always be available
-	 * because they are basic building blocks.
+	 * BIT_UVC_CMD_QUI, BIT_UVC_CMD_SET_SHARED_ACCESS and
+	 * BIT_UVC_CMD_SET_SHARED_ACCESS are always present as they
+	 * have been introduced with the first Ultravisor version.
+	 * However, we only need to check for QUI as
+	 * SET/REMOVE SHARED are used to fence this test to be only
+	 * executed by protected guests.
 	 */
-	report(test_bit_inv(BIT_UVC_CMD_QUI, &uvcb.inst_calls_list[0]),
-	       "query indicated");
-	report(test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
-	       "share indicated");
-	report(test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
-	       "unshare indicated");
+	report(uv_query_test_call(BIT_UVC_CMD_QUI), "query indicated");
 	report_prefix_pop();
 }
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests
  2022-01-27 14:15 [kvm-unit-tests PATCH 0/4] s390x: Attestation tests Steffen Eiden
                   ` (2 preceding siblings ...)
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks Steffen Eiden
@ 2022-01-27 14:15 ` Steffen Eiden
  2022-01-28  9:54   ` Janosch Frank
  3 siblings, 1 reply; 11+ messages in thread
From: Steffen Eiden @ 2022-01-27 14:15 UTC (permalink / raw)
  To: Thomas Huth, Janosch Frank, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

Adds several tests to verify correct error paths of attestation.

Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
---
 lib/s390x/asm/uv.h |   5 +-
 s390x/uv-guest.c   | 164 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+), 1 deletion(-)

diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index 38c322bf..e8e1698e 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -109,7 +109,10 @@ struct uv_cb_qui {
 	u8  reserved88[158 - 136];	/* 0x0088 */
 	uint16_t max_guest_cpus;	/* 0x009e */
 	u64 uv_feature_indications;	/* 0x00a0 */
-	u8  reserveda8[200 - 168];	/* 0x00a8 */
+	u8  reserveda8[224 - 168];	/* 0x00a8 */
+	u64 supported_att_hdr_versions;	/* 0x00e0 */
+	u64 supported_paf;		/* 0x00e8 */
+	u8  reservedf0[256 - 240];	/* 0x00f0 */
 }  __attribute__((packed))  __attribute__((aligned(8)));
 
 struct uv_cb_cgc {
diff --git a/s390x/uv-guest.c b/s390x/uv-guest.c
index 909b7256..92b9a53b 100644
--- a/s390x/uv-guest.c
+++ b/s390x/uv-guest.c
@@ -6,6 +6,7 @@
  *
  * Authors:
  *  Janosch Frank <frankja@linux.ibm.com>
+ *  Steffen Eiden <seiden@linux.ibm.com>
  */
 
 #include <libcflat.h>
@@ -53,6 +54,15 @@ static void test_priv(void)
 	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
 	report_prefix_pop();
 
+	report_prefix_push("attest");
+	uvcb.cmd = UVC_CMD_ATTESTATION;
+	uvcb.len = sizeof(struct uv_cb_attest);
+	expect_pgm_int();
+	enter_pstate();
+	uv_call_once(0, (u64)&uvcb);
+	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
+	report_prefix_pop();
+
 	report_prefix_pop();
 }
 
@@ -111,7 +121,160 @@ static void test_sharing(void)
 	cc = uv_call(0, (u64)&uvcb);
 	report(cc == 0 && uvcb.header.rc == UVC_RC_EXECUTED, "unshare");
 	report_prefix_pop();
+}
+
+/* arcb with one key slot and no nonce */
+struct uv_arcb_v1 {
+	uint64_t	reserved0;	/* 0x0000 */
+	uint32_t	arvn;		/* 0x0008 */
+	uint32_t	arl;		/* 0x000c */
+	uint8_t		iv[12];		/* 0x0010 */
+	uint32_t	reserved1c;	/* 0x001c */
+	uint8_t		reserved20[7];	/* 0x0020 */
+	uint8_t		nks;		/* 0x0027 */
+	uint32_t	reserved28;	/* 0x0028 */
+	uint32_t	sea;		/* 0x002c */
+	uint64_t	paf;		/* 0x0030 */
+	uint32_t	mai;		/* 0x0038 */
+	uint32_t	reserved3c;	/* 0x003c */
+	uint8_t		cpk[160];	/* 0x0040 */
+	uint8_t		key_slot[80];	/* 0x00e0 */
+	uint8_t		m_key[64];	/* 0x0130 */
+	uint8_t		tag[16];	/* 0x0170 */
+} __attribute__((packed));
+
+static void test_attest_v1(u64 supported_paf)
+{
+	struct uv_cb_attest uvcb = {
+		.header.cmd = UVC_CMD_ATTESTATION,
+		.header.len = sizeof(uvcb),
+	};
+	struct uv_arcb_v1 *arcb = (void *)page;
+	uint64_t measurement = page + sizeof(*arcb);
+	size_t measurement_size = 64;
+	uint64_t additional = measurement + measurement_size;
+	size_t additional_size = 64;
+	int cc;
+
+	memset((void *) page, 0, PAGE_SIZE);
+
+	/* create a minimal arcb/uvcb such that FW has everything to start unsealing the request. */
+	arcb->arvn = 0x0100;
+	arcb->arl = sizeof(*arcb);
+	arcb->nks = 1;
+	arcb->sea = 64;
+	/* HMAC SHA512 */
+	arcb->mai = 1;
+	uvcb.arcb_addr = page;
+	uvcb.measurement_address = measurement;
+	uvcb.measurement_length = measurement_size;
+	uvcb.add_data_address = additional;
+	uvcb.add_data_length = additional_size;
+
+	uvcb.continuation_token = 0xff;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0101, "invalid continuation token");
+	uvcb.continuation_token = 0;
+
+	uvcb.user_data_length = sizeof(uvcb.user_data) + 1;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0102, "invalid user data size");
+	uvcb.user_data_length = 0;
+
+	uvcb.arcb_addr = 0;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0103, "invalid address arcb");
+	uvcb.arcb_addr = page;
+
+	/* 0104 - 0105 need an unseal-able request */
+
+	/* version 0000 is an illegal version number */
+	arcb->arvn = 0x0000;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0106, "unsupported version");
+	arcb->arvn = 0x0100;
+
+	arcb->arl += 1;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0107, "invalid arcb size 1");
+	arcb->arl -= 1;
+	arcb->nks = 2;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0107, "invalid arcb size 2");
+	arcb->nks = 1;
+
+	arcb->nks = 0;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0108, "invalid num key slots low");
+	arcb->nks = 1;
 
+	/* possible valid size (when using nonce). However, arl to small to host a nonce */
+	arcb->sea = 80;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0109, "invalid encrypted size 1");
+	arcb->sea = 17;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x0109, "invalid encrypted size 2");
+	arcb->sea = 64;
+
+	arcb->paf = supported_paf ^ ((u64) -1);
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x010a, "invalid paf");
+	arcb->paf = 0;
+
+	/* reserved value */
+	arcb->mai = 0;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x010b, "invalid mai");
+	arcb->mai = 1;
+
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x010c, "unable unseal");
+
+	uvcb.measurement_length = 0;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc == 1 && uvcb.header.rc == 0x010d, "invalid measurement size");
+	uvcb.measurement_length = 64;
+}
+
+static void test_attest(void)
+{
+	struct uv_cb_attest uvcb = {
+		.header.cmd = UVC_CMD_ATTESTATION,
+		.header.len = sizeof(uvcb),
+	};
+	const struct uv_cb_qui *uvcb_qui = uv_get_info();
+	int cc;
+
+	report_prefix_push("attest");
+
+	if (!uv_query_test_call(BIT_UVC_CMD_ATTESTATION)) {
+		report_skip("Attestation not supported.");
+		goto done;
+	}
+
+	/* Verify that the uv supports at least one header version */
+	report(uvcb_qui->supported_att_hdr_versions, "has hdr support");
+
+	memset((void *) page, 0, PAGE_SIZE);
+
+	uvcb.header.len -= 1;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc && uvcb.header.rc == UVC_RC_INV_LEN, "invalid uvcb size 1");
+	uvcb.header.len += 1;
+
+	uvcb.header.len += 1;
+	cc = uv_call(0, (u64)&uvcb);
+	report(cc && uvcb.header.rc == UVC_RC_INV_LEN, "invalid uvcb size 2");
+	uvcb.header.len -= 1;
+
+	report_prefix_push("v1");
+	if (test_bit_inv(0, &uvcb_qui->supported_att_hdr_versions))
+		test_attest_v1(uvcb_qui->supported_paf);
+	else
+		report_skip("Attestation version 1 not supported");
+	report_prefix_pop();
+done:
 	report_prefix_pop();
 }
 
@@ -179,6 +342,7 @@ int main(void)
 	test_invalid();
 	test_query();
 	test_sharing();
+	test_attest();
 	free_page((void *)page);
 done:
 	report_prefix_pop();
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test Steffen Eiden
@ 2022-01-28  9:00   ` Janosch Frank
  2022-01-28  9:29     ` Thomas Huth
  0 siblings, 1 reply; 11+ messages in thread
From: Janosch Frank @ 2022-01-28  9:00 UTC (permalink / raw)
  To: Steffen Eiden, Thomas Huth, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

On 1/27/22 15:15, Steffen Eiden 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 | 24 +++++++++++++++++++++++-
>   s390x/uv-host.c    |  3 ++-
>   2 files changed, 25 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> index 97c90e81..38c322bf 100644
> --- a/lib/s390x/asm/uv.h
> +++ b/lib/s390x/asm/uv.h
> @@ -1,10 +1,11 @@
>   /*
>    * s390x Ultravisor related definitions
>    *
> - * Copyright (c) 2020 IBM Corp
> + * Copyright (c) 2020, 2022 IBM Corp

I'm not sure when we actually need/want to update this.

>    *
>    * Authors:
>    *  Janosch Frank <frankja@linux.ibm.com>
> + *  Steffen Eiden <seiden@linux.ibm.com>

I usually add myself to this list once I made significant contributions 
to the file (or if I create the file). If you have a look at the 
kernel's kvm-s390.c you'll see that I'm not yet on the list of its authors.

But, as visible in other discussions we're currently having, I'm not 
aware of a definite guideline for this. Looks like we should find an 
agreement within IBM and write it down.

>    *
>    * This code is free software; you can redistribute it and/or modify it
>    * under the terms of the GNU General Public License version 2.
> @@ -47,6 +48,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 +73,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 +181,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 */
> +}  __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..0f8ab94a 100644
> --- a/s390x/uv-host.c
> +++ b/s390x/uv-host.c
> @@ -2,7 +2,7 @@
>   /*
>    * Guest Ultravisor Call tests
>    *
> - * Copyright (c) 2021 IBM Corp
> + * Copyright (c) 2021, 2022 IBM Corp
>    *
>    * Authors:
>    *  Janosch Frank <frankja@linux.ibm.com>
> @@ -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 },
>   };
>   
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter Steffen Eiden
@ 2022-01-28  9:02   ` Janosch Frank
  0 siblings, 0 replies; 11+ messages in thread
From: Janosch Frank @ 2022-01-28  9:02 UTC (permalink / raw)
  To: Steffen Eiden, Thomas Huth, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

On 1/27/22 15:15, Steffen Eiden wrote:
> Some tests need the information provided by the QUI UVC and lib/s390x/uv.c
> already has cached the qui result. Let's add a function to avoid
> unnecessary  QUI UVCs.

Double space

> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
>   lib/s390x/uv.c | 10 +++++++++-
>   lib/s390x/uv.h |  1 +
>   2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/uv.c b/lib/s390x/uv.c
> index 6fe11dff..5625a1ee 100644
> --- a/lib/s390x/uv.c
> +++ b/lib/s390x/uv.c
> @@ -2,7 +2,7 @@
>   /*
>    * Ultravisor related functionality
>    *
> - * Copyright 2020 IBM Corp.
> + * Copyright 2020, 2022 IBM Corp.
>    *
>    * Authors:
>    *    Janosch Frank <frankja@linux.ibm.com>
> @@ -47,6 +47,14 @@ bool uv_query_test_call(unsigned int nr)
>   	return test_bit_inv(nr, uvcb_qui.inst_calls_list);
>   }
>   
> +const struct uv_cb_qui *uv_get_info(void)

uv_get_query_data?

> +{
> +	/* Query needs to be called first */
> +	assert(uvcb_qui.header.rc);
> +
> +	return &uvcb_qui;
> +}
> +
>   int uv_setup(void)
>   {
>   	if (!test_facility(158))
> diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
> index 8175d9c6..e9935fd2 100644
> --- a/lib/s390x/uv.h
> +++ b/lib/s390x/uv.h
> @@ -8,6 +8,7 @@
>   bool uv_os_is_guest(void);
>   bool uv_os_is_host(void);
>   bool uv_query_test_call(unsigned int nr);
> +const struct uv_cb_qui *uv_get_info(void);
>   void uv_init(void);
>   int uv_setup(void);
>   void uv_create_guest(struct vm *vm);
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks Steffen Eiden
@ 2022-01-28  9:06   ` Janosch Frank
  0 siblings, 0 replies; 11+ messages in thread
From: Janosch Frank @ 2022-01-28  9:06 UTC (permalink / raw)
  To: Steffen Eiden, Thomas Huth, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

On 1/27/22 15:15, Steffen Eiden wrote:
> Removing some tests which are done at other points in the code
> implicitly.
> 
> In lib/s390x/uc.c#setup_uv(void) the rc of the qui result is verified
> using asserts.
> The whole test is fenced by lib/s390x/uc.c#os_is_guest(void) which
> checks if SET and REMOVE SHARED is present.
> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

> ---
>   s390x/uv-guest.c | 24 ++++++++----------------
>   1 file changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/s390x/uv-guest.c b/s390x/uv-guest.c
> index 44ad2154..909b7256 100644
> --- a/s390x/uv-guest.c
> +++ b/s390x/uv-guest.c
> @@ -2,7 +2,7 @@
>   /*
>    * Guest Ultravisor Call tests
>    *
> - * Copyright (c) 2020 IBM Corp
> + * Copyright (c) 2020, 2022 IBM Corp
>    *
>    * Authors:
>    *  Janosch Frank <frankja@linux.ibm.com>
> @@ -69,23 +69,15 @@ static void test_query(void)
>   	cc = uv_call(0, (u64)&uvcb);
>   	report(cc == 1 && uvcb.header.rc == UVC_RC_INV_LEN, "length");
>   
> -	uvcb.header.len = sizeof(uvcb);
> -	cc = uv_call(0, (u64)&uvcb);
> -	report((!cc && uvcb.header.rc == UVC_RC_EXECUTED) ||
> -	       (cc == 1 && uvcb.header.rc == 0x100),
> -		"successful query");
> -
>   	/*
> -	 * These bits have been introduced with the very first
> -	 * Ultravisor version and are expected to always be available
> -	 * because they are basic building blocks.
> +	 * BIT_UVC_CMD_QUI, BIT_UVC_CMD_SET_SHARED_ACCESS and
> +	 * BIT_UVC_CMD_SET_SHARED_ACCESS are always present as they
> +	 * have been introduced with the first Ultravisor version.
> +	 * However, we only need to check for QUI as
> +	 * SET/REMOVE SHARED are used to fence this test to be only
> +	 * executed by protected guests.
>   	 */
> -	report(test_bit_inv(BIT_UVC_CMD_QUI, &uvcb.inst_calls_list[0]),
> -	       "query indicated");
> -	report(test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
> -	       "share indicated");
> -	report(test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, &uvcb.inst_calls_list[0]),
> -	       "unshare indicated");
> +	report(uv_query_test_call(BIT_UVC_CMD_QUI), "query indicated");
>   	report_prefix_pop();
>   }
>   
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test
  2022-01-28  9:00   ` Janosch Frank
@ 2022-01-28  9:29     ` Thomas Huth
  2022-01-28  9:58       ` Claudio Imbrenda
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2022-01-28  9:29 UTC (permalink / raw)
  To: Janosch Frank, Steffen Eiden, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

On 28/01/2022 10.00, Janosch Frank wrote:
> On 1/27/22 15:15, Steffen Eiden 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 | 24 +++++++++++++++++++++++-
>>   s390x/uv-host.c    |  3 ++-
>>   2 files changed, 25 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
>> index 97c90e81..38c322bf 100644
>> --- a/lib/s390x/asm/uv.h
>> +++ b/lib/s390x/asm/uv.h
>> @@ -1,10 +1,11 @@
>>   /*
>>    * s390x Ultravisor related definitions
>>    *
>> - * Copyright (c) 2020 IBM Corp
>> + * Copyright (c) 2020, 2022 IBM Corp
> 
> I'm not sure when we actually need/want to update this.

IANAL, but IIRC you can add/update the second year in the copyright 
statement if there has been a major change to the file in that year, so that 
should be fine. Not sure whether you still need the "(c)" these days, though.

  Thomas


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests
  2022-01-27 14:15 ` [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests Steffen Eiden
@ 2022-01-28  9:54   ` Janosch Frank
  0 siblings, 0 replies; 11+ messages in thread
From: Janosch Frank @ 2022-01-28  9:54 UTC (permalink / raw)
  To: Steffen Eiden, Thomas Huth, Claudio Imbrenda, David Hildenbrand
  Cc: kvm, linux-s390

On 1/27/22 15:15, Steffen Eiden wrote:
> Adds several tests to verify correct error paths of attestation.
> 
> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
>   lib/s390x/asm/uv.h |   5 +-
>   s390x/uv-guest.c   | 164 +++++++++++++++++++++++++++++++++++++++++++++
>   2 files changed, 168 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> index 38c322bf..e8e1698e 100644
> --- a/lib/s390x/asm/uv.h
> +++ b/lib/s390x/asm/uv.h
> @@ -109,7 +109,10 @@ struct uv_cb_qui {
>   	u8  reserved88[158 - 136];	/* 0x0088 */
>   	uint16_t max_guest_cpus;	/* 0x009e */
>   	u64 uv_feature_indications;	/* 0x00a0 */
> -	u8  reserveda8[200 - 168];	/* 0x00a8 */
> +	u8  reserveda8[224 - 168];	/* 0x00a8 */
> +	u64 supported_att_hdr_versions;	/* 0x00e0 */
> +	u64 supported_paf;		/* 0x00e8 */
> +	u8  reservedf0[256 - 240];	/* 0x00f0 */
>   }  __attribute__((packed))  __attribute__((aligned(8)));
>   
>   struct uv_cb_cgc {
> diff --git a/s390x/uv-guest.c b/s390x/uv-guest.c
> index 909b7256..92b9a53b 100644
> --- a/s390x/uv-guest.c
> +++ b/s390x/uv-guest.c
> @@ -6,6 +6,7 @@
>    *
>    * Authors:
>    *  Janosch Frank <frankja@linux.ibm.com>
> + *  Steffen Eiden <seiden@linux.ibm.com>
>    */
>   
>   #include <libcflat.h>
> @@ -53,6 +54,15 @@ static void test_priv(void)
>   	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
>   	report_prefix_pop();
>   
> +	report_prefix_push("attest");
> +	uvcb.cmd = UVC_CMD_ATTESTATION;
> +	uvcb.len = sizeof(struct uv_cb_attest);
> +	expect_pgm_int();
> +	enter_pstate();
> +	uv_call_once(0, (u64)&uvcb);
> +	check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION);
> +	report_prefix_pop();
> +
>   	report_prefix_pop();
>   }
>   
> @@ -111,7 +121,160 @@ static void test_sharing(void)
>   	cc = uv_call(0, (u64)&uvcb);
>   	report(cc == 0 && uvcb.header.rc == UVC_RC_EXECUTED, "unshare");
>   	report_prefix_pop();
> +}
> +
> +/* arcb with one key slot and no nonce */
> +struct uv_arcb_v1 {
> +	uint64_t	reserved0;	/* 0x0000 */
> +	uint32_t	arvn;		/* 0x0008 */
> +	uint32_t	arl;		/* 0x000c */

req_ver and req_len ?

> +	uint8_t		iv[12];		/* 0x0010 */
> +	uint32_t	reserved1c;	/* 0x001c */
> +	uint8_t		reserved20[7];	/* 0x0020 */
> +	uint8_t		nks;		/* 0x0027 */
> +	uint32_t	reserved28;	/* 0x0028 */
> +	uint32_t	sea;		/* 0x002c */

sea and nks are also used elsewhere so I'm mostly fine with them.

> +	uint64_t	paf;		/* 0x0030 */

plaint_att_flags

> +	uint32_t	mai;		/* 0x0038 */

meass_alg_id

> +	uint32_t	reserved3c;	/* 0x003c */
> +	uint8_t		cpk[160];	/* 0x0040 */
> +	uint8_t		key_slot[80];	/* 0x00e0 */
> +	uint8_t		m_key[64];	/* 0x0130 */

meass_key

Although, to be honest I don't like the "meass" prefix

> +	uint8_t		tag[16];	/* 0x0170 */
> +} __attribute__((packed));

The amount of three letter abbreviations is too high in this struct.

> +
> +static void test_attest_v1(u64 supported_paf)
> +{
> +	struct uv_cb_attest uvcb = {
> +		.header.cmd = UVC_CMD_ATTESTATION,
> +		.header.len = sizeof(uvcb),
> +	};
> +	struct uv_arcb_v1 *arcb = (void *)page;
> +	uint64_t measurement = page + sizeof(*arcb);
> +	size_t measurement_size = 64;
> +	uint64_t additional = measurement + measurement_size;
> +	size_t additional_size = 64;
> +	int cc;
> +
> +	memset((void *) page, 0, PAGE_SIZE);
> +
> +	/* create a minimal arcb/uvcb such that FW has everything to start unsealing the request. */
> +	arcb->arvn = 0x0100;

Magic numbers

> +	arcb->arl = sizeof(*arcb);
> +	arcb->nks = 1;
> +	arcb->sea = 64;

sizeof(arcb->m_key) ?

It's sizeof(arcb->m_key) + sizeof(arcb->nonce_opt) (which doesn't exist 
in our struct above) for everyone wondering what's in sea.


> +	/* HMAC SHA512 */
> +	arcb->mai = 1;

Add a constant then you won't need the comment anymore.

> +	uvcb.arcb_addr = page;
> +	uvcb.measurement_address = measurement;
> +	uvcb.measurement_length = measurement_size;
> +	uvcb.add_data_address = additional;
> +	uvcb.add_data_length = additional_size;
> +
> +	uvcb.continuation_token = 0xff;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0101, "invalid continuation token");
> +	uvcb.continuation_token = 0;
> +
> +	uvcb.user_data_length = sizeof(uvcb.user_data) + 1;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0102, "invalid user data size");
> +	uvcb.user_data_length = 0;
> +
> +	uvcb.arcb_addr = 0;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0103, "invalid address arcb");
> +	uvcb.arcb_addr = page;
> +
> +	/* 0104 - 0105 need an unseal-able request */
> +
> +	/* version 0000 is an illegal version number */
> +	arcb->arvn = 0x0000;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0106, "unsupported version");
> +	arcb->arvn = 0x0100;
> +
> +	arcb->arl += 1;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0107, "invalid arcb size 1");
> +	arcb->arl -= 1;
> +	arcb->nks = 2;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0107, "invalid arcb size 2");
> +	arcb->nks = 1;
> +
> +	arcb->nks = 0;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0108, "invalid num key slots low");
> +	arcb->nks = 1;
>   
> +	/* possible valid size (when using nonce). However, arl to small to host a nonce */

s/to/too/

> +	arcb->sea = 80;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0109, "invalid encrypted size 1");
> +	arcb->sea = 17;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x0109, "invalid encrypted size 2");
> +	arcb->sea = 64;
> +
> +	arcb->paf = supported_paf ^ ((u64) -1);
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x010a, "invalid paf");
> +	arcb->paf = 0;
> +
> +	/* reserved value */
> +	arcb->mai = 0;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x010b, "invalid mai");
> +	arcb->mai = 1;
> +
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x010c, "unable unseal");
> +
> +	uvcb.measurement_length = 0;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc == 1 && uvcb.header.rc == 0x010d, "invalid measurement size");
> +	uvcb.measurement_length = 64;
> +}
> +
> +static void test_attest(void)
> +{
> +	struct uv_cb_attest uvcb = {
> +		.header.cmd = UVC_CMD_ATTESTATION,
> +		.header.len = sizeof(uvcb),
> +	};
> +	const struct uv_cb_qui *uvcb_qui = uv_get_info();
> +	int cc;
> +
> +	report_prefix_push("attest");
> +
> +	if (!uv_query_test_call(BIT_UVC_CMD_ATTESTATION)) {
> +		report_skip("Attestation not supported.");
> +		goto done;
> +	}
> +
> +	/* Verify that the uv supports at least one header version */
> +	report(uvcb_qui->supported_att_hdr_versions, "has hdr support");
> +
> +	memset((void *) page, 0, PAGE_SIZE);
> +
> +	uvcb.header.len -= 1;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc && uvcb.header.rc == UVC_RC_INV_LEN, "invalid uvcb size 1");
> +	uvcb.header.len += 1;
> +
> +	uvcb.header.len += 1;
> +	cc = uv_call(0, (u64)&uvcb);
> +	report(cc && uvcb.header.rc == UVC_RC_INV_LEN, "invalid uvcb size 2");
> +	uvcb.header.len -= 1;
> +
> +	report_prefix_push("v1");
> +	if (test_bit_inv(0, &uvcb_qui->supported_att_hdr_versions))
> +		test_attest_v1(uvcb_qui->supported_paf);
> +	else
> +		report_skip("Attestation version 1 not supported");
> +	report_prefix_pop();
> +done:
>   	report_prefix_pop();
>   }
>   
> @@ -179,6 +342,7 @@ int main(void)
>   	test_invalid();
>   	test_query();
>   	test_sharing();
> +	test_attest();
>   	free_page((void *)page);
>   done:
>   	report_prefix_pop();
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test
  2022-01-28  9:29     ` Thomas Huth
@ 2022-01-28  9:58       ` Claudio Imbrenda
  0 siblings, 0 replies; 11+ messages in thread
From: Claudio Imbrenda @ 2022-01-28  9:58 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Janosch Frank, Steffen Eiden, David Hildenbrand, kvm, linux-s390

On Fri, 28 Jan 2022 10:29:42 +0100
Thomas Huth <thuth@redhat.com> wrote:

> On 28/01/2022 10.00, Janosch Frank wrote:
> > On 1/27/22 15:15, Steffen Eiden 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 | 24 +++++++++++++++++++++++-
> >>   s390x/uv-host.c    |  3 ++-
> >>   2 files changed, 25 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
> >> index 97c90e81..38c322bf 100644
> >> --- a/lib/s390x/asm/uv.h
> >> +++ b/lib/s390x/asm/uv.h
> >> @@ -1,10 +1,11 @@
> >>   /*
> >>    * s390x Ultravisor related definitions
> >>    *
> >> - * Copyright (c) 2020 IBM Corp
> >> + * Copyright (c) 2020, 2022 IBM Corp  
> > 
> > I'm not sure when we actually need/want to update this.  
> 
> IANAL, but IIRC you can add/update the second year in the copyright 
> statement if there has been a major change to the file in that year, so that 
> should be fine. Not sure whether you still need the "(c)" these days, though.
> 
>   Thomas
> 

I think the format IBM wants is:

Copyright IBM Corp. 2020, 2022


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-28  9:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 14:15 [kvm-unit-tests PATCH 0/4] s390x: Attestation tests Steffen Eiden
2022-01-27 14:15 ` [kvm-unit-tests PATCH 1/4] s390x: uv-host: Add attestation test Steffen Eiden
2022-01-28  9:00   ` Janosch Frank
2022-01-28  9:29     ` Thomas Huth
2022-01-28  9:58       ` Claudio Imbrenda
2022-01-27 14:15 ` [kvm-unit-tests PATCH 2/4] s390x: lib: Add QUI getter Steffen Eiden
2022-01-28  9:02   ` Janosch Frank
2022-01-27 14:15 ` [kvm-unit-tests PATCH 3/4] s390x: uv-guest: remove duplicated checks Steffen Eiden
2022-01-28  9:06   ` Janosch Frank
2022-01-27 14:15 ` [kvm-unit-tests PATCH 4/4] s390x: uv-guest: Add attestation tests Steffen Eiden
2022-01-28  9:54   ` Janosch Frank

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).