diff mbox series

[kvm-unit-tests,v2,1/5] s390x: user ctl_set/clear_bit for low address protection

Message ID 20180829154750.12876-2-david@redhat.com (mailing list archive)
State New, archived
Headers show
Series s390x: simple DXC test | expand

Commit Message

David Hildenbrand Aug. 29, 2018, 3:47 p.m. UTC
Use the provided helper functions now.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 lib/s390x/asm/interrupt.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/lib/s390x/asm/interrupt.h b/lib/s390x/asm/interrupt.h
index b3abd63..013709f 100644
--- a/lib/s390x/asm/interrupt.h
+++ b/lib/s390x/asm/interrupt.h
@@ -23,21 +23,13 @@  void check_pgm_int_code(uint16_t code);
 /* Activate low-address protection */
 static inline void low_prot_enable(void)
 {
-	uint64_t cr0;
-
-	asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory");
-	cr0 |= 1ULL << (63-35);
-	asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0));
+	ctl_set_bit(0, 63 - 35);
 }
 
 /* Disable low-address protection */
 static inline void low_prot_disable(void)
 {
-	uint64_t cr0;
-
-	asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory");
-	cr0 &= ~(1ULL << (63-35));
-	asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0));
+	ctl_clear_bit(0, 63 - 35);
 }
 
 #endif