Skip to contentSkip to conversation

s390x: pv: Add test for large host pages backing

PATCH Superseded Claudio Imbrenda 3 participants 5 messages Nov 11, 2024 – Nov 20, 2024

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390x: pv: Add test for large host pages backing

Add a new test to check that the host can use 1M large pages to back protected guests when the corresponding feature is present.

---
 s390x/Makefile               |   2 +
 lib/s390x/asm/arch_def.h     |   1 +
 lib/s390x/asm/uv.h           |  18 ++
 s390x/pv-edat1.c             | 463 +++++++++++++++++++++++++++++++++++
 s390x/snippets/c/pv-memhog.c |  59 +++++
 5 files changed, 543 insertions(+)
 create mode 100644 s390x/pv-edat1.c
 create mode 100644 s390x/snippets/c/pv-memhog.c
s390x/Makefile +2 -0
index 23342bd6..c5c6f92c 100644
@@ -48,6 +48,7 @@ tests += $(TEST_DIR)/sie-dat.elf
 pv-tests += $(TEST_DIR)/pv-diags.elf
 pv-tests += $(TEST_DIR)/pv-icptcode.elf
 pv-tests += $(TEST_DIR)/pv-ipl.elf
+pv-tests += $(TEST_DIR)/pv-edat1.elf
 
 ifneq ($(HOST_KEY_DOCUMENT),)
 ifneq ($(GEN_SE_HEADER),)
@@ -137,6 +138,7 @@ $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/icpt-loop.gbin
 $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/loop.gbin
 $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-vir-timing.gbin
 $(TEST_DIR)/pv-ipl.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-308.gbin
+$(TEST_DIR)/pv-edat1.elf: pv-snippets += $(SNIPPET_DIR)/c/pv-memhog.gbin
 
 ifneq ($(GEN_SE_HEADER),)
 snippets += $(pv-snippets)
lib/s390x/asm/arch_def.h +1 -0
index 745a3387..481ede8f 100644
@@ -249,6 +249,7 @@ extern struct lowcore lowcore;
 #define PGM_INT_CODE_REGION_FIRST_TRANS		0x39
 #define PGM_INT_CODE_REGION_SECOND_TRANS	0x3a
 #define PGM_INT_CODE_REGION_THIRD_TRANS		0x3b
+#define PGM_INT_CODE_SECURE_PAGE_SIZE		0x3c
 #define PGM_INT_CODE_SECURE_STOR_ACCESS		0x3d
 #define PGM_INT_CODE_NON_SECURE_STOR_ACCESS	0x3e
 #define PGM_INT_CODE_SECURE_STOR_VIOLATION	0x3f
lib/s390x/asm/uv.h +18 -0
index 611dcd3f..7527be48 100644
@@ -35,6 +35,7 @@
 #define UVC_CMD_CONV_TO_SEC_STOR	0x0200
 #define UVC_CMD_CONV_FROM_SEC_STOR	0x0201
 #define UVC_CMD_DESTR_SEC_STOR		0x0202
+#define UVC_CMD_VERIFY_LARGE_FRAME	0x0203
 #define UVC_CMD_SET_SEC_CONF_PARAMS	0x0300
 #define UVC_CMD_UNPACK_IMG		0x0301
 #define UVC_CMD_VERIFY_IMG		0x0302
@@ -74,6 +75,11 @@ enum uv_cmds_inst {
 	BIT_UVC_CMD_PIN_PAGE_SHARED = 21,
 	BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22,
 	BIT_UVC_CMD_ATTESTATION = 28,
+	BIT_UVC_CMD_VERIFY_LARGE_FRAME = 32,
+};
+
+enum uv_features {
+	BIT_UV_1M_BACKING = 6,
 };
 
 struct uv_cb_header {
@@ -312,6 +318,18 @@ static inline int uv_import(uint64_t handle, unsigned long gaddr)
 	return uv_call(0, (uint64_t)&uvcb);
 }
 
+static inline int uv_merge(uint64_t handle, unsigned long gaddr)
+{
+	struct uv_cb_cts uvcb = {
+		.header.cmd = UVC_CMD_VERIFY_LARGE_FRAME,
+		.header.len = sizeof(uvcb),
+		.guest_handle = handle,
+		.gaddr = gaddr,
+	};
+
+	return uv_call(0, (uint64_t)&uvcb);
+}
+
 static inline int uv_export(unsigned long paddr)
 {
 	struct uv_cb_cfs uvcb = {
s390x/pv-edat1.c new file +463 -0

463 lines not on this page · raw message

s390x/snippets/c/pv-memhog.c new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.47.0
#1 lore raw

Sorry for not seeing this on the first review, but there still is something.

Quoted 13 lines · Claudio Imbrenda

Add a new test to check that the host can use 1M large pages to back protected guests when the corresponding feature is present.

---
 s390x/Makefile               |   2 +
 lib/s390x/asm/arch_def.h     |   1 +
 lib/s390x/asm/uv.h           |  18 ++
 s390x/pv-edat1.c             | 463 +++++++++++++++++++++++++++++++++++
 s390x/snippets/c/pv-memhog.c |  59 +++++
 5 files changed, 543 insertions(+)
 create mode 100644 s390x/pv-edat1.c
 create mode 100644 s390x/snippets/c/pv-memhog.c

[...]

s390x/pv-edat1.c line 194

Quoted 3 lines
s390x/pv-edat1.c new file +3 -0
+static void timings(void)
+{
+	const uint64_t seqs[] = { 0, 1, 3, 7, 17, 27, 63, 127};

Missing space in the end

Quoted 25 lines
s390x/pv-edat1.c new file +25 -0
+	unsigned int purge, map1m, seq;
+
+	report_prefix_push("timings");
+
+	report_info("Averages over %u iterations, in us (best/average/worst)", N_ITER);
+	for (purge = 0; purge < 2; purge++) {
+		report_prefix_pushf("ptlb %s", purge ? "always" : "  once");
+		for (seq = 0; seq < ARRAY_SIZE(seqs); seq++) {
+			if (seqs[seq])
+				report_prefix_pushf("seq step %3lu", seqs[seq]);
+			else
+				report_prefix_push("pseudorandom");
+			for (map1m = 0; map1m < 2; map1m++) {
+				report_prefix_pushf("%s", STR(map1m));
+				run_iterations(&vm, seqs[seq], purge, map1m);
+				report_prefix_pop();
+			}
+			report_prefix_pop();
+		}
+		report_prefix_pop();
+	}
+
+	report_pass("Timing tests successful");
+	report_prefix_pop();
+}

[...]

Quoted 18 lines
s390x/pv-edat1.c new file +18 -0
+static void test_one_export(struct vm *vm, int pre1m, bool exportfirst, int page, bool post1m)
+{
+	uint64_t addr = SZ_1M + page * PAGE_SIZE;
+	int expected = FIRST;
+
+	report_prefix_pushf("page %d", page);
+
+	map_identity_all(vm, pre1m == 1);
+	init_snippet(vm);
+	import_all(vm);
+	merge_all(vm);
+
+	if (pre1m != -1) {
+		sie(vm);
+		assert_diag500_val(vm, expected);
+		vm->save_area.guest.grs[2] = PARAM(4, 256 + 42);
+		expected = SECOND;
+	}

s390x/pv-edat1.c line 364

Quoted 10 lines
s390x/pv-edat1.c new file +10 -0
+
+	if (exportfirst) {
+		export_range(vm, addr, addr + PAGE_SIZE);
+		if (pre1m != 1)
+			map_identity_all(vm, true);
+	} else {
+		if (pre1m != 1)
+			map_identity_all(vm, true);
+		export_range(vm, addr, addr + PAGE_SIZE);
+	}

The tree checks here "pre1m == 1" and "pre1m != 1" do not quite add up. pre1m is only ever called with pre1m = -1 and pre1m = 0.
With this the first of the three map_identity_all calls here will always map normal pages and the next two calls will never happen.

Quoted 41 lines
s390x/pv-edat1.c new file +41 -0
+	expect_pgm_int();
+	sie(vm);
+	assert(pgm_3c_addr_is(vm, MAGIC_ADDRESS));
+
+	import_range(vm, addr, addr + PAGE_SIZE);
+	if (post1m) {
+		merge_range(vm, SZ_1M, 2 * SZ_1M);
+	} else {
+		map_identity_all(vm, false);
+	}
+	sie(vm);
+	assert_diag500_val(vm, expected);
+	report_pass("Successful");
+
+	uv_destroy_guest(vm);
+	report_prefix_pop();
+}
+
+static void test_export(void)
+{
+	int pre1m, post1m, exportfirst;
+
+	report_prefix_push("export");
+
+	for (pre1m = -1; pre1m < 1; pre1m++) {
+		for (post1m = 0; post1m < 2; post1m++) {
+			for (exportfirst = 0; exportfirst < 2; exportfirst++) {
+				report_prefix_pushf("%s pre-run, %s post-run, export %s remap",
+						    STR3(pre1m), STR(post1m), exportfirst ? "before" : "after");
+
+				test_one_export(&vm, pre1m, exportfirst, 0, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 1, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 42, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 128, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 254, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 255, post1m);
+
+				report_prefix_pop();
+			}
+		}
+	}

s390x/pv-edat1.c line 415

Quoted 10 lines
s390x/pv-edat1.c new file +10 -0
+
+	report_prefix_pop();
+}
+
+static bool check_facilities(void)
+{
+	if (!uv_host_requirement_checks())
+		return false;
+	if (!test_facility(8) || !test_facility(78)) {
+		report_skip("EDAT1 and EDAT2 not available in the host.");

s/and/or/

Quoted 12 lines
s390x/pv-edat1.c new file +12 -0
+		return false;
+	}
+	if (!uv_query_test_call(BIT_UVC_CMD_VERIFY_LARGE_FRAME)) {
+		report_skip("Verify Large Frame UVC not supported.");
+		return false;
+	}
+	if (!uv_query_test_feature(BIT_UV_1M_BACKING)) {
+		report_skip("Large frames not supported for Secure Execution.");
+		return false;
+	}
+	return true;
+}

[...]

#2 lore raw
Quoted 17 lines · On Tue, 19 Nov 2024 16:48:37 +0100 "Christoph Schlameuss"…

Sorry for not seeing this on the first review, but there still is something.

Quoted 4 lines · Claudio Imbrenda

Add a new test to check that the host can use 1M large pages to back protected guests when the corresponding feature is present.

Quoted 9 lines
---
 s390x/Makefile               |   2 +
 lib/s390x/asm/arch_def.h     |   1 +
 lib/s390x/asm/uv.h           |  18 ++
 s390x/pv-edat1.c             | 463 +++++++++++++++++++++++++++++++++++
 s390x/snippets/c/pv-memhog.c |  59 +++++
 5 files changed, 543 insertions(+)
 create mode 100644 s390x/pv-edat1.c
 create mode 100644 s390x/snippets/c/pv-memhog.c  
Quoted 7 lines

[...]

s390x/pv-edat1.c line 194

Quoted 3 lines
s390x/pv-edat1.c new file +3 -0
+static void timings(void)
+{
+	const uint64_t seqs[] = { 0, 1, 3, 7, 17, 27, 63, 127};  

Missing space in the end

will fix

Quoted 27 lines

[...]

Quoted 25 lines
s390x/pv-edat1.c new file +25 -0
+static void test_one_export(struct vm *vm, int pre1m, bool exportfirst, int page, bool post1m)
+{
+	uint64_t addr = SZ_1M + page * PAGE_SIZE;
+	int expected = FIRST;
+
+	report_prefix_pushf("page %d", page);
+
+	map_identity_all(vm, pre1m == 1);
+	init_snippet(vm);
+	import_all(vm);
+	merge_all(vm);
+
+	if (pre1m != -1) {
+		sie(vm);
+		assert_diag500_val(vm, expected);
+		vm->save_area.guest.grs[2] = PARAM(4, 256 + 42);
+		expected = SECOND;
+	}
+
+	if (exportfirst) {
+		export_range(vm, addr, addr + PAGE_SIZE);
+		if (pre1m != 1)
+			map_identity_all(vm, true);
+	} else {
+		if (pre1m != 1)
Quoted 8 lines

s390x/pv-edat1.c line 364

Quoted 3 lines
s390x/pv-edat1.c new file +3 -0
+			map_identity_all(vm, true);
+		export_range(vm, addr, addr + PAGE_SIZE);
+	}  

The tree checks here "pre1m == 1" and "pre1m != 1" do not quite add up. pre1m is only ever called with pre1m = -1 and pre1m = 0.
With this the first of the three map_identity_all calls here will always map normal pages and the next two calls will never happen.

yeah, because the loop used to go to 1, and I don't remember why I changed it... maybe it should actually go all the way to 1 again...

Quoted 46 lines
Quoted 46 lines
s390x/pv-edat1.c new file +45 -0
+	expect_pgm_int();
+	sie(vm);
+	assert(pgm_3c_addr_is(vm, MAGIC_ADDRESS));
+
+	import_range(vm, addr, addr + PAGE_SIZE);
+	if (post1m) {
+		merge_range(vm, SZ_1M, 2 * SZ_1M);
+	} else {
+		map_identity_all(vm, false);
+	}
+	sie(vm);
+	assert_diag500_val(vm, expected);
+	report_pass("Successful");
+
+	uv_destroy_guest(vm);
+	report_prefix_pop();
+}
+
+static void test_export(void)
+{
+	int pre1m, post1m, exportfirst;
+
+	report_prefix_push("export");
+
+	for (pre1m = -1; pre1m < 1; pre1m++) {
+		for (post1m = 0; post1m < 2; post1m++) {
+			for (exportfirst = 0; exportfirst < 2; exportfirst++) {
+				report_prefix_pushf("%s pre-run, %s post-run, export %s remap",
+						    STR3(pre1m), STR(post1m), exportfirst ? "before" : "after");
+
+				test_one_export(&vm, pre1m, exportfirst, 0, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 1, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 42, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 128, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 254, post1m);
+				test_one_export(&vm, pre1m, exportfirst, 255, post1m);
+
+				report_prefix_pop();
+			}
+		}
+	}
+
+	report_prefix_pop();
+}
+
Quoted 8 lines

s390x/pv-edat1.c line 415

Quoted 6 lines
s390x/pv-edat1.c new file +6 -0
+static bool check_facilities(void)
+{
+	if (!uv_host_requirement_checks())
+		return false;
+	if (!test_facility(8) || !test_facility(78)) {
+		report_skip("EDAT1 and EDAT2 not available in the host.");  

s/and/or/

will fix differently

Quoted 16 lines
Quoted 13 lines
s390x/pv-edat1.c new file +12 -0
+		return false;
+	}
+	if (!uv_query_test_call(BIT_UVC_CMD_VERIFY_LARGE_FRAME)) {
+		report_skip("Verify Large Frame UVC not supported.");
+		return false;
+	}
+	if (!uv_query_test_feature(BIT_UV_1M_BACKING)) {
+		report_skip("Large frames not supported for Secure Execution.");
+		return false;
+	}
+	return true;
+}  

[...]

#3 lore raw
In reply to Claudio Imbrenda
Quoted 75 lines · Claudio Imbrenda

Add a new test to check that the host can use 1M large pages to back protected guests when the corresponding feature is present.

---
  s390x/Makefile               |   2 +
  lib/s390x/asm/arch_def.h     |   1 +
  lib/s390x/asm/uv.h           |  18 ++
  s390x/pv-edat1.c             | 463 +++++++++++++++++++++++++++++++++++
  s390x/snippets/c/pv-memhog.c |  59 +++++
  5 files changed, 543 insertions(+)

create mode 100644 s390x/pv-edat1.c
create mode 100644 s390x/snippets/c/pv-memhog.c

s390x/Makefile +2 -0
index 23342bd6..c5c6f92c 100644
@@ -48,6 +48,7 @@ tests += $(TEST_DIR)/sie-dat.elf
  pv-tests += $(TEST_DIR)/pv-diags.elf
  pv-tests += $(TEST_DIR)/pv-icptcode.elf
  pv-tests += $(TEST_DIR)/pv-ipl.elf
+pv-tests += $(TEST_DIR)/pv-edat1.elf
 
  ifneq ($(HOST_KEY_DOCUMENT),)
  ifneq ($(GEN_SE_HEADER),)
@@ -137,6 +138,7 @@ $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/icpt-loop.gbin
  $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/loop.gbin
  $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-vir-timing.gbin
  $(TEST_DIR)/pv-ipl.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-308.gbin
+$(TEST_DIR)/pv-edat1.elf: pv-snippets += $(SNIPPET_DIR)/c/pv-memhog.gbin
 
  ifneq ($(GEN_SE_HEADER),)
  snippets += $(pv-snippets)
lib/s390x/asm/arch_def.h +1 -0
index 745a3387..481ede8f 100644
@@ -249,6 +249,7 @@ extern struct lowcore lowcore;
  #define PGM_INT_CODE_REGION_FIRST_TRANS		0x39
  #define PGM_INT_CODE_REGION_SECOND_TRANS	0x3a
  #define PGM_INT_CODE_REGION_THIRD_TRANS		0x3b
+#define PGM_INT_CODE_SECURE_PAGE_SIZE		0x3c
  #define PGM_INT_CODE_SECURE_STOR_ACCESS		0x3d
  #define PGM_INT_CODE_NON_SECURE_STOR_ACCESS	0x3e
  #define PGM_INT_CODE_SECURE_STOR_VIOLATION	0x3f
lib/s390x/asm/uv.h +7 -0
index 611dcd3f..7527be48 100644
@@ -35,6 +35,7 @@
  #define UVC_CMD_CONV_TO_SEC_STOR	0x0200
  #define UVC_CMD_CONV_FROM_SEC_STOR	0x0201
  #define UVC_CMD_DESTR_SEC_STOR		0x0202
+#define UVC_CMD_VERIFY_LARGE_FRAME	0x0203
  #define UVC_CMD_SET_SEC_CONF_PARAMS	0x0300
  #define UVC_CMD_UNPACK_IMG		0x0301
  #define UVC_CMD_VERIFY_IMG		0x0302
@@ -74,6 +75,11 @@ enum uv_cmds_inst {
  	BIT_UVC_CMD_PIN_PAGE_SHARED = 21,
  	BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22,
  	BIT_UVC_CMD_ATTESTATION = 28,
+	BIT_UVC_CMD_VERIFY_LARGE_FRAME = 32,
+};
+
+enum uv_features {
+	BIT_UV_1M_BACKING = 6,
  };
 
  struct uv_cb_header {
@@ -312,6 +318,18 @@ static inline int uv_import(uint64_t handle, unsigned long gaddr)
  	return uv_call(0, (uint64_t)&uvcb);
  }
 
+static inline int uv_merge(uint64_t handle, unsigned long gaddr)

lib/s390x/asm/uv.h static inline int uv_import(uint64_t handle, unsigned long gaddr) · line 331

Quoted 10 lines
lib/s390x/asm/uv.h +10 -0
+{
+	struct uv_cb_cts uvcb = {
+		.header.cmd = UVC_CMD_VERIFY_LARGE_FRAME,
+		.header.len = sizeof(uvcb),
+		.guest_handle = handle,
+		.gaddr = gaddr,
+	};
+
+	return uv_call(0, (uint64_t)&uvcb);
+}

I don't understand why you added this to the lib if you're not using it even once since you have your own function that returns more data.

Are you expecting other tests to regularly need this UVC?
The attestation test for instance added the constants but no function since the call is basically only used for one test.

#4 lore raw
Quoted 75 lines · On Wed, 20 Nov 2024 17:33:48 +0100 Janosch Frank <[email protected]> wrote:
Quoted 74 lines · Claudio Imbrenda

Add a new test to check that the host can use 1M large pages to back protected guests when the corresponding feature is present.

---
  s390x/Makefile               |   2 +
  lib/s390x/asm/arch_def.h     |   1 +
  lib/s390x/asm/uv.h           |  18 ++
  s390x/pv-edat1.c             | 463 +++++++++++++++++++++++++++++++++++
  s390x/snippets/c/pv-memhog.c |  59 +++++
  5 files changed, 543 insertions(+)

create mode 100644 s390x/pv-edat1.c
create mode 100644 s390x/snippets/c/pv-memhog.c

s390x/Makefile +2 -0
index 23342bd6..c5c6f92c 100644
@@ -48,6 +48,7 @@ tests += $(TEST_DIR)/sie-dat.elf
  pv-tests += $(TEST_DIR)/pv-diags.elf
  pv-tests += $(TEST_DIR)/pv-icptcode.elf
  pv-tests += $(TEST_DIR)/pv-ipl.elf
+pv-tests += $(TEST_DIR)/pv-edat1.elf
 
  ifneq ($(HOST_KEY_DOCUMENT),)
  ifneq ($(GEN_SE_HEADER),)
@@ -137,6 +138,7 @@ $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/icpt-loop.gbin
  $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/loop.gbin
  $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-vir-timing.gbin
  $(TEST_DIR)/pv-ipl.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-308.gbin
+$(TEST_DIR)/pv-edat1.elf: pv-snippets += $(SNIPPET_DIR)/c/pv-memhog.gbin
 
  ifneq ($(GEN_SE_HEADER),)
  snippets += $(pv-snippets)
lib/s390x/asm/arch_def.h +1 -0
index 745a3387..481ede8f 100644
@@ -249,6 +249,7 @@ extern struct lowcore lowcore;
  #define PGM_INT_CODE_REGION_FIRST_TRANS		0x39
  #define PGM_INT_CODE_REGION_SECOND_TRANS	0x3a
  #define PGM_INT_CODE_REGION_THIRD_TRANS		0x3b
+#define PGM_INT_CODE_SECURE_PAGE_SIZE		0x3c
  #define PGM_INT_CODE_SECURE_STOR_ACCESS		0x3d
  #define PGM_INT_CODE_NON_SECURE_STOR_ACCESS	0x3e
  #define PGM_INT_CODE_SECURE_STOR_VIOLATION	0x3f
lib/s390x/asm/uv.h +6 -0
index 611dcd3f..7527be48 100644
@@ -35,6 +35,7 @@
  #define UVC_CMD_CONV_TO_SEC_STOR	0x0200
  #define UVC_CMD_CONV_FROM_SEC_STOR	0x0201
  #define UVC_CMD_DESTR_SEC_STOR		0x0202
+#define UVC_CMD_VERIFY_LARGE_FRAME	0x0203
  #define UVC_CMD_SET_SEC_CONF_PARAMS	0x0300
  #define UVC_CMD_UNPACK_IMG		0x0301
  #define UVC_CMD_VERIFY_IMG		0x0302
@@ -74,6 +75,11 @@ enum uv_cmds_inst {
  	BIT_UVC_CMD_PIN_PAGE_SHARED = 21,
  	BIT_UVC_CMD_UNPIN_PAGE_SHARED = 22,
  	BIT_UVC_CMD_ATTESTATION = 28,
+	BIT_UVC_CMD_VERIFY_LARGE_FRAME = 32,
+};
+
+enum uv_features {
+	BIT_UV_1M_BACKING = 6,
  };
 
  struct uv_cb_header {
@@ -312,6 +318,18 @@ static inline int uv_import(uint64_t handle, unsigned long gaddr)
  	return uv_call(0, (uint64_t)&uvcb);
  }
 
Quoted 14 lines

lib/s390x/asm/uv.h static inline int uv_import(uint64_t handle, unsigned long gaddr) · line 331

Quoted 11 lines
lib/s390x/asm/uv.h +11 -0
+static inline int uv_merge(uint64_t handle, unsigned long gaddr)
+{
+	struct uv_cb_cts uvcb = {
+		.header.cmd = UVC_CMD_VERIFY_LARGE_FRAME,
+		.header.len = sizeof(uvcb),
+		.guest_handle = handle,
+		.gaddr = gaddr,
+	};
+
+	return uv_call(0, (uint64_t)&uvcb);
+}  

I don't understand why you added this to the lib if you're not using it even once since you have your own function that returns more data.

I don't remember :D
I'll have a closer look

Quoted 7 lines

Are you expecting other tests to regularly need this UVC? The attestation test for instance added the constants but no function since the call is basically only used for one test.