Message ID | 20180824115059.1517-2-david@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | s390x: simple DXC test | expand |
On 2018-08-24 13:50, David Hildenbrand wrote: > User the provided helper functions now. > > Signed-off-by: David Hildenbrand <david@redhat.com> > --- > lib/s390x/asm/interrupt.h | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > 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 Reviewed-by: Thomas Huth <thuth@redhat.com>
On 24.08.2018 13:50, David Hildenbrand wrote: > User the provided helper functions now. > > Signed-off-by: David Hildenbrand <david@redhat.com> s/User/Use/ Reviewed-by: Janosch Frank <frankja@linux.ibm.com> > --- > lib/s390x/asm/interrupt.h | 12 ++---------- > 1 file changed, 2 insertions(+), 10 deletions(-) > > 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 >
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
User the provided helper functions now. Signed-off-by: David Hildenbrand <david@redhat.com> --- lib/s390x/asm/interrupt.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)