s390/ctlreg: rename ctl_reg.h to ctlreg.h
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 11 Sep 2023 19:39:56 +0000 (21:39 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 19 Sep 2023 11:26:56 +0000 (13:26 +0200)
Rename ctl_reg.h to ctlreg.h so it matches not only ctlreg.c but also
other control register related function, union, and structure names,
which all come with a ctlreg prefix.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
18 files changed:
arch/s390/boot/vmem.c
arch/s390/include/asm/ctl_reg.h [deleted file]
arch/s390/include/asm/ctlreg.h [new file with mode: 0644]
arch/s390/include/asm/mmu_context.h
arch/s390/kernel/ctlreg.c
arch/s390/kernel/nmi.c
arch/s390/kernel/perf_pai_crypto.c
arch/s390/kernel/perf_pai_ext.c
arch/s390/kernel/smp.c
arch/s390/lib/uaccess.c
arch/s390/mm/init.c
arch/s390/mm/maccess.c
arch/s390/mm/vmem.c
drivers/s390/char/diag_ftp.c
drivers/s390/char/sclp_cmd.c
drivers/s390/char/sclp_early.c
drivers/s390/char/sclp_early_core.c
drivers/s390/cio/crw.c

index 36b9086..9ac6d00 100644 (file)
@@ -2,10 +2,10 @@
 #include <linux/sched/task.h>
 #include <linux/pgtable.h>
 #include <linux/kasan.h>
-#include <asm/ctl_reg.h>
 #include <asm/pgalloc.h>
 #include <asm/facility.h>
 #include <asm/sections.h>
+#include <asm/ctlreg.h>
 #include <asm/physmem_info.h>
 #include <asm/maccess.h>
 #include <asm/abs_lowcore.h>
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
deleted file mode 100644 (file)
index f5536fd..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright IBM Corp. 1999, 2009
- *
- * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
- */
-
-#ifndef __ASM_CTL_REG_H
-#define __ASM_CTL_REG_H
-
-#include <linux/bits.h>
-
-#define CR0_CLOCK_COMPARATOR_SIGN      BIT(63 - 10)
-#define CR0_LOW_ADDRESS_PROTECTION     BIT(63 - 35)
-#define CR0_FETCH_PROTECTION_OVERRIDE  BIT(63 - 38)
-#define CR0_STORAGE_PROTECTION_OVERRIDE        BIT(63 - 39)
-#define CR0_EMERGENCY_SIGNAL_SUBMASK   BIT(63 - 49)
-#define CR0_EXTERNAL_CALL_SUBMASK      BIT(63 - 50)
-#define CR0_CLOCK_COMPARATOR_SUBMASK   BIT(63 - 52)
-#define CR0_CPU_TIMER_SUBMASK          BIT(63 - 53)
-#define CR0_SERVICE_SIGNAL_SUBMASK     BIT(63 - 54)
-#define CR0_UNUSED_56                  BIT(63 - 56)
-#define CR0_INTERRUPT_KEY_SUBMASK      BIT(63 - 57)
-#define CR0_MEASUREMENT_ALERT_SUBMASK  BIT(63 - 58)
-
-#define CR14_UNUSED_32                 BIT(63 - 32)
-#define CR14_UNUSED_33                 BIT(63 - 33)
-#define CR14_CHANNEL_REPORT_SUBMASK    BIT(63 - 35)
-#define CR14_RECOVERY_SUBMASK          BIT(63 - 36)
-#define CR14_DEGRADATION_SUBMASK       BIT(63 - 37)
-#define CR14_EXTERNAL_DAMAGE_SUBMASK   BIT(63 - 38)
-#define CR14_WARNING_SUBMASK           BIT(63 - 39)
-
-#ifndef __ASSEMBLY__
-
-#include <linux/bug.h>
-
-#define __ctl_load(array, low, high) do {                              \
-       typedef struct { char _[sizeof(array)]; } addrtype;             \
-                                                                       \
-       BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
-       asm volatile(                                                   \
-               "       lctlg   %1,%2,%0\n"                             \
-               :                                                       \
-               : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high)    \
-               : "memory");                                            \
-} while (0)
-
-#define __ctl_store(array, low, high) do {                             \
-       typedef struct { char _[sizeof(array)]; } addrtype;             \
-                                                                       \
-       BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
-       asm volatile(                                                   \
-               "       stctg   %1,%2,%0\n"                             \
-               : "=Q" (*(addrtype *)(&array))                          \
-               : "i" (low), "i" (high));                               \
-} while (0)
-
-static __always_inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
-{
-       unsigned long reg;
-
-       __ctl_store(reg, cr, cr);
-       reg |= 1UL << bit;
-       __ctl_load(reg, cr, cr);
-}
-
-static __always_inline void __ctl_clear_bit(unsigned int cr, unsigned int bit)
-{
-       unsigned long reg;
-
-       __ctl_store(reg, cr, cr);
-       reg &= ~(1UL << bit);
-       __ctl_load(reg, cr, cr);
-}
-
-void ctlreg_lock(void);
-void ctlreg_unlock(void);
-void ctl_set_clear_bit(int cr, int bit, bool set);
-
-static inline void ctl_set_bit(int cr, int bit)
-{
-       ctl_set_clear_bit(cr, bit, true);
-}
-
-static inline void ctl_clear_bit(int cr, int bit)
-{
-       ctl_set_clear_bit(cr, bit, false);
-}
-
-union ctlreg0 {
-       unsigned long val;
-       struct {
-               unsigned long      : 8;
-               unsigned long tcx  : 1; /* Transactional-Execution control */
-               unsigned long pifo : 1; /* Transactional-Execution Program-
-                                          Interruption-Filtering Override */
-               unsigned long      : 3;
-               unsigned long ccc  : 1; /* Cryptography counter control */
-               unsigned long pec  : 1; /* PAI extension control */
-               unsigned long      : 17;
-               unsigned long      : 3;
-               unsigned long lap  : 1; /* Low-address-protection control */
-               unsigned long      : 4;
-               unsigned long edat : 1; /* Enhanced-DAT-enablement control */
-               unsigned long      : 2;
-               unsigned long iep  : 1; /* Instruction-Execution-Protection */
-               unsigned long      : 1;
-               unsigned long afp  : 1; /* AFP-register control */
-               unsigned long vx   : 1; /* Vector enablement control */
-               unsigned long      : 7;
-               unsigned long sssm : 1; /* Service signal subclass mask */
-               unsigned long      : 9;
-       };
-};
-
-union ctlreg2 {
-       unsigned long val;
-       struct {
-               unsigned long       : 33;
-               unsigned long ducto : 25;
-               unsigned long       : 1;
-               unsigned long gse   : 1;
-               unsigned long       : 1;
-               unsigned long tds   : 1;
-               unsigned long tdc   : 2;
-       };
-};
-
-union ctlreg5 {
-       unsigned long val;
-       struct {
-               unsigned long       : 33;
-               unsigned long pasteo: 25;
-               unsigned long       : 6;
-       };
-};
-
-union ctlreg15 {
-       unsigned long val;
-       struct {
-               unsigned long lsea  : 61;
-               unsigned long       : 3;
-       };
-};
-
-#endif /* __ASSEMBLY__ */
-#endif /* __ASM_CTL_REG_H */
diff --git a/arch/s390/include/asm/ctlreg.h b/arch/s390/include/asm/ctlreg.h
new file mode 100644 (file)
index 0000000..25b955d
--- /dev/null
@@ -0,0 +1,148 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright IBM Corp. 1999, 2009
+ *
+ * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
+ */
+
+#ifndef __ASM_S390_CTLREG_H
+#define __ASM_S390_CTLREG_H
+
+#include <linux/bits.h>
+
+#define CR0_CLOCK_COMPARATOR_SIGN      BIT(63 - 10)
+#define CR0_LOW_ADDRESS_PROTECTION     BIT(63 - 35)
+#define CR0_FETCH_PROTECTION_OVERRIDE  BIT(63 - 38)
+#define CR0_STORAGE_PROTECTION_OVERRIDE        BIT(63 - 39)
+#define CR0_EMERGENCY_SIGNAL_SUBMASK   BIT(63 - 49)
+#define CR0_EXTERNAL_CALL_SUBMASK      BIT(63 - 50)
+#define CR0_CLOCK_COMPARATOR_SUBMASK   BIT(63 - 52)
+#define CR0_CPU_TIMER_SUBMASK          BIT(63 - 53)
+#define CR0_SERVICE_SIGNAL_SUBMASK     BIT(63 - 54)
+#define CR0_UNUSED_56                  BIT(63 - 56)
+#define CR0_INTERRUPT_KEY_SUBMASK      BIT(63 - 57)
+#define CR0_MEASUREMENT_ALERT_SUBMASK  BIT(63 - 58)
+
+#define CR14_UNUSED_32                 BIT(63 - 32)
+#define CR14_UNUSED_33                 BIT(63 - 33)
+#define CR14_CHANNEL_REPORT_SUBMASK    BIT(63 - 35)
+#define CR14_RECOVERY_SUBMASK          BIT(63 - 36)
+#define CR14_DEGRADATION_SUBMASK       BIT(63 - 37)
+#define CR14_EXTERNAL_DAMAGE_SUBMASK   BIT(63 - 38)
+#define CR14_WARNING_SUBMASK           BIT(63 - 39)
+
+#ifndef __ASSEMBLY__
+
+#include <linux/bug.h>
+
+#define __ctl_load(array, low, high) do {                              \
+       typedef struct { char _[sizeof(array)]; } addrtype;             \
+                                                                       \
+       BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
+       asm volatile(                                                   \
+               "       lctlg   %1,%2,%0\n"                             \
+               :                                                       \
+               : "Q" (*(addrtype *)(&array)), "i" (low), "i" (high)    \
+               : "memory");                                            \
+} while (0)
+
+#define __ctl_store(array, low, high) do {                             \
+       typedef struct { char _[sizeof(array)]; } addrtype;             \
+                                                                       \
+       BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
+       asm volatile(                                                   \
+               "       stctg   %1,%2,%0\n"                             \
+               : "=Q" (*(addrtype *)(&array))                          \
+               : "i" (low), "i" (high));                               \
+} while (0)
+
+static __always_inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
+{
+       unsigned long reg;
+
+       __ctl_store(reg, cr, cr);
+       reg |= 1UL << bit;
+       __ctl_load(reg, cr, cr);
+}
+
+static __always_inline void __ctl_clear_bit(unsigned int cr, unsigned int bit)
+{
+       unsigned long reg;
+
+       __ctl_store(reg, cr, cr);
+       reg &= ~(1UL << bit);
+       __ctl_load(reg, cr, cr);
+}
+
+void ctlreg_lock(void);
+void ctlreg_unlock(void);
+void ctl_set_clear_bit(int cr, int bit, bool set);
+
+static inline void ctl_set_bit(int cr, int bit)
+{
+       ctl_set_clear_bit(cr, bit, true);
+}
+
+static inline void ctl_clear_bit(int cr, int bit)
+{
+       ctl_set_clear_bit(cr, bit, false);
+}
+
+union ctlreg0 {
+       unsigned long val;
+       struct {
+               unsigned long      : 8;
+               unsigned long tcx  : 1; /* Transactional-Execution control */
+               unsigned long pifo : 1; /* Transactional-Execution Program-
+                                          Interruption-Filtering Override */
+               unsigned long      : 3;
+               unsigned long ccc  : 1; /* Cryptography counter control */
+               unsigned long pec  : 1; /* PAI extension control */
+               unsigned long      : 17;
+               unsigned long      : 3;
+               unsigned long lap  : 1; /* Low-address-protection control */
+               unsigned long      : 4;
+               unsigned long edat : 1; /* Enhanced-DAT-enablement control */
+               unsigned long      : 2;
+               unsigned long iep  : 1; /* Instruction-Execution-Protection */
+               unsigned long      : 1;
+               unsigned long afp  : 1; /* AFP-register control */
+               unsigned long vx   : 1; /* Vector enablement control */
+               unsigned long      : 7;
+               unsigned long sssm : 1; /* Service signal subclass mask */
+               unsigned long      : 9;
+       };
+};
+
+union ctlreg2 {
+       unsigned long val;
+       struct {
+               unsigned long       : 33;
+               unsigned long ducto : 25;
+               unsigned long       : 1;
+               unsigned long gse   : 1;
+               unsigned long       : 1;
+               unsigned long tds   : 1;
+               unsigned long tdc   : 2;
+       };
+};
+
+union ctlreg5 {
+       unsigned long val;
+       struct {
+               unsigned long       : 33;
+               unsigned long pasteo: 25;
+               unsigned long       : 6;
+       };
+};
+
+union ctlreg15 {
+       unsigned long val;
+       struct {
+               unsigned long lsea  : 61;
+               unsigned long       : 3;
+       };
+};
+
+#endif /* __ASSEMBLY__ */
+#endif /* __ASM_S390_CTLREG_H */
index 2a38af5..50f247e 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/uaccess.h>
 #include <linux/mm_types.h>
 #include <asm/tlbflush.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm-generic/mm_hooks.h>
 
 #define init_new_context init_new_context
index 176ada8..a01b901 100644 (file)
@@ -6,7 +6,7 @@
 #include <linux/spinlock.h>
 #include <linux/smp.h>
 #include <asm/abs_lowcore.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 
 /*
  * ctl_lock guards access to global control register contents which
index 38ec048..b813d9d 100644 (file)
 #include <linux/kvm_host.h>
 #include <linux/export.h>
 #include <asm/lowcore.h>
+#include <asm/ctlreg.h>
 #include <asm/smp.h>
 #include <asm/stp.h>
 #include <asm/cputime.h>
 #include <asm/nmi.h>
 #include <asm/crw.h>
 #include <asm/switch_to.h>
-#include <asm/ctl_reg.h>
 #include <asm/asm-offsets.h>
 #include <asm/pai.h>
 #include <asm/vx-insn.h>
index fe7d177..6280a0e 100644 (file)
@@ -16,8 +16,7 @@
 #include <linux/export.h>
 #include <linux/io.h>
 #include <linux/perf_event.h>
-
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/pai.h>
 #include <asm/debug.h>
 
index c57c1a2..b887749 100644 (file)
@@ -17,8 +17,7 @@
 #include <linux/export.h>
 #include <linux/io.h>
 #include <linux/perf_event.h>
-
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/pai.h>
 #include <asm/debug.h>
 
index d12dbba..204c724 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/crash_dump.h>
 #include <linux/kprobes.h>
 #include <asm/asm-offsets.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/pfault.h>
 #include <asm/diag.h>
 #include <asm/switch_to.h>
index 80b9c2d..478ab4c 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/export.h>
 #include <linux/mm.h>
 #include <asm/asm-extable.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 
 #ifdef CONFIG_DEBUG_ENTRY
 void debug_user_asce(int exit)
index 8b94d22..c6ab6f2 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/processor.h>
 #include <linux/uaccess.h>
 #include <asm/pgalloc.h>
+#include <asm/ctlreg.h>
 #include <asm/kfence.h>
 #include <asm/ptdump.h>
 #include <asm/dma.h>
@@ -42,7 +43,6 @@
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 #include <asm/sections.h>
-#include <asm/ctl_reg.h>
 #include <asm/sclp.h>
 #include <asm/set_memory.h>
 #include <asm/kasan.h>
index c805b3e..632c3a5 100644 (file)
 #include <linux/uio.h>
 #include <linux/io.h>
 #include <asm/asm-extable.h>
-#include <asm/ctl_reg.h>
 #include <asm/abs_lowcore.h>
 #include <asm/stacktrace.h>
 #include <asm/maccess.h>
+#include <asm/ctlreg.h>
 
 unsigned long __bootdata_preserved(__memcpy_real_area);
 pte_t *__bootdata_preserved(memcpy_real_ptep);
index 9d3f9fa..91c1f42 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/sort.h>
 #include <asm/cacheflush.h>
 #include <asm/nospec-branch.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/pgalloc.h>
 #include <asm/setup.h>
 #include <asm/tlbflush.h>
index 65c7f2d..9418a92 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/wait.h>
 #include <linux/string.h>
 #include <asm/asm-extable.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/diag.h>
 
 #include "hmcdrv_ftp.h"
index 8b4575a..b73edf0 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/mmzone.h>
 #include <linux/memory.h>
 #include <linux/module.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/chpid.h>
 #include <asm/setup.h>
 #include <asm/page.h>
index fdc8668..60a247f 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <linux/errno.h>
 #include <linux/memblock.h>
-#include <asm/ctl_reg.h>
+#include <asm/ctlreg.h>
 #include <asm/sclp.h>
 #include <asm/ipl.h>
 #include <asm/setup.h>
index a191d69..f7067a7 100644 (file)
@@ -6,8 +6,8 @@
 
 #include <linux/kernel.h>
 #include <asm/processor.h>
-#include <asm/ctl_reg.h>
 #include <asm/lowcore.h>
+#include <asm/ctlreg.h>
 #include <asm/ebcdic.h>
 #include <asm/irq.h>
 #include <asm/sections.h>
index 7b02a63..58f2227 100644 (file)
@@ -12,8 +12,8 @@
 #include <linux/kthread.h>
 #include <linux/init.h>
 #include <linux/wait.h>
+#include <asm/ctlreg.h>
 #include <asm/crw.h>
-#include <asm/ctl_reg.h>
 #include "ioasm.h"
 
 static DEFINE_MUTEX(crw_handler_mutex);