diff mbox series

[kvm-unit-tests,GIT,PULL,10/17] lib: s390x: Add access key argument to tprot

Message ID 20211018122635.53614-11-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,GIT,PULL,01/17] s390x: uv-host: Explain why we set up the home space and remove the space change | expand

Commit Message

Janosch Frank Oct. 18, 2021, 12:26 p.m. UTC
From: Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Currently there is only one callee passing a non zero key,
but having the argument will be useful in the future.

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/kvm/20211007085027.13050-1-frankja@linux.ibm.com/T/#md3064e13e876e0418a16f0d5a5bd9a6f2adebfd9
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/asm/arch_def.h | 6 +++---
 lib/s390x/sclp.c         | 2 +-
 s390x/skrf.c             | 3 +--
 3 files changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
index c8d2722a..b34aa792 100644
--- a/lib/s390x/asm/arch_def.h
+++ b/lib/s390x/asm/arch_def.h
@@ -233,15 +233,15 @@  static inline uint16_t get_machine_id(void)
 	return cpuid;
 }
 
-static inline int tprot(unsigned long addr)
+static inline int tprot(unsigned long addr, char access_key)
 {
 	int cc;
 
 	asm volatile(
-		"	tprot	0(%1),0\n"
+		"	tprot	0(%1),0(%2)\n"
 		"	ipm	%0\n"
 		"	srl	%0,28\n"
-		: "=d" (cc) : "a" (addr) : "cc");
+		: "=d" (cc) : "a" (addr), "a" (access_key << 4) : "cc");
 	return cc;
 }
 
diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c
index 9502d161..02722498 100644
--- a/lib/s390x/sclp.c
+++ b/lib/s390x/sclp.c
@@ -217,7 +217,7 @@  void sclp_memory_setup(void)
 	/* probe for r/w memory up to max memory size */
 	while (ram_size < max_ram_size) {
 		expect_pgm_int();
-		cc = tprot(ram_size + storage_increment_size - 1);
+		cc = tprot(ram_size + storage_increment_size - 1, 0);
 		/* stop once we receive an exception or have protected memory */
 		if (clear_pgm_int() || cc != 0)
 			break;
diff --git a/s390x/skrf.c b/s390x/skrf.c
index 8ca7588c..ca4efbf1 100644
--- a/s390x/skrf.c
+++ b/s390x/skrf.c
@@ -103,8 +103,7 @@  static void test_tprot(void)
 {
 	report_prefix_push("tprot");
 	expect_pgm_int();
-	asm volatile("tprot	%[addr],0xf0(0)\n"
-		     : : [addr] "a" (pagebuf) : );
+	tprot((unsigned long)pagebuf, 0xf);
 	check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION);
 	report_prefix_pop();
 }