aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-05-23 10:24:51 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-05-24 04:10:10 -0400
commitf4815ac6c935b8e441fe12504d62e0e8ff7f7ce5 (patch)
tree32b78252b6b155e7a218c571d9e994c78da1aee0 /arch/s390
parentda477737c5ec99d37cb78dab909aa0402a0ebf18 (diff)
s390/headers: replace __s390x__ with CONFIG_64BIT where possible
Replace __s390x__ with CONFIG_64BIT in all places that are not exported to userspace or guarded with #ifdef __KERNEL__. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/bitops.h16
-rw-r--r--arch/s390/include/asm/cputime.h10
-rw-r--r--arch/s390/include/asm/ctl_reg.h6
-rw-r--r--arch/s390/include/asm/elf.h12
-rw-r--r--arch/s390/include/asm/idals.h10
-rw-r--r--arch/s390/include/asm/mmu_context.h2
-rw-r--r--arch/s390/include/asm/module.h2
-rw-r--r--arch/s390/include/asm/percpu.h2
-rw-r--r--arch/s390/include/asm/pgalloc.h6
-rw-r--r--arch/s390/include/asm/pgtable.h44
-rw-r--r--arch/s390/include/asm/processor.h30
-rw-r--r--arch/s390/include/asm/rwsem.h60
-rw-r--r--arch/s390/include/asm/setup.h18
-rw-r--r--arch/s390/include/asm/sfp-util.h2
-rw-r--r--arch/s390/include/asm/thread_info.h6
-rw-r--r--arch/s390/include/asm/tlb.h4
-rw-r--r--arch/s390/include/asm/tlbflush.h4
-rw-r--r--arch/s390/include/asm/types.h4
-rw-r--r--arch/s390/lib/uaccess_mvcos.c2
-rw-r--r--arch/s390/lib/uaccess_std.c2
-rw-r--r--arch/s390/mm/vmem.c2
21 files changed, 122 insertions, 122 deletions
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index 8a503b1acd63..a6ff5a83e227 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -61,7 +61,7 @@ extern const char _ni_bitmap[];
61extern const char _zb_findmap[]; 61extern const char _zb_findmap[];
62extern const char _sb_findmap[]; 62extern const char _sb_findmap[];
63 63
64#ifndef __s390x__ 64#ifndef CONFIG_64BIT
65 65
66#define __BITOPS_ALIGN 3 66#define __BITOPS_ALIGN 3
67#define __BITOPS_WORDSIZE 32 67#define __BITOPS_WORDSIZE 32
@@ -81,7 +81,7 @@ extern const char _sb_findmap[];
81 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 81 : "d" (__val), "Q" (*(unsigned long *) __addr) \
82 : "cc"); 82 : "cc");
83 83
84#else /* __s390x__ */ 84#else /* CONFIG_64BIT */
85 85
86#define __BITOPS_ALIGN 7 86#define __BITOPS_ALIGN 7
87#define __BITOPS_WORDSIZE 64 87#define __BITOPS_WORDSIZE 64
@@ -101,7 +101,7 @@ extern const char _sb_findmap[];
101 : "d" (__val), "Q" (*(unsigned long *) __addr) \ 101 : "d" (__val), "Q" (*(unsigned long *) __addr) \
102 : "cc"); 102 : "cc");
103 103
104#endif /* __s390x__ */ 104#endif /* CONFIG_64BIT */
105 105
106#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) 106#define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE)
107#define __BITOPS_BARRIER() asm volatile("" : : : "memory") 107#define __BITOPS_BARRIER() asm volatile("" : : : "memory")
@@ -410,7 +410,7 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr,
410 unsigned long bytes = 0; 410 unsigned long bytes = 0;
411 411
412 asm volatile( 412 asm volatile(
413#ifndef __s390x__ 413#ifndef CONFIG_64BIT
414 " ahi %1,-1\n" 414 " ahi %1,-1\n"
415 " sra %1,5\n" 415 " sra %1,5\n"
416 " jz 1f\n" 416 " jz 1f\n"
@@ -447,7 +447,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
447 unsigned long bytes = 0; 447 unsigned long bytes = 0;
448 448
449 asm volatile( 449 asm volatile(
450#ifndef __s390x__ 450#ifndef CONFIG_64BIT
451 " ahi %1,-1\n" 451 " ahi %1,-1\n"
452 " sra %1,5\n" 452 " sra %1,5\n"
453 " jz 1f\n" 453 " jz 1f\n"
@@ -479,7 +479,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr,
479 */ 479 */
480static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) 480static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
481{ 481{
482#ifdef __s390x__ 482#ifdef CONFIG_64BIT
483 if ((word & 0xffffffff) == 0xffffffff) { 483 if ((word & 0xffffffff) == 0xffffffff) {
484 word >>= 32; 484 word >>= 32;
485 nr += 32; 485 nr += 32;
@@ -503,7 +503,7 @@ static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
503 */ 503 */
504static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) 504static inline unsigned long __ffs_word(unsigned long nr, unsigned long word)
505{ 505{
506#ifdef __s390x__ 506#ifdef CONFIG_64BIT
507 if ((word & 0xffffffff) == 0) { 507 if ((word & 0xffffffff) == 0) {
508 word >>= 32; 508 word >>= 32;
509 nr += 32; 509 nr += 32;
@@ -544,7 +544,7 @@ static inline unsigned long __load_ulong_le(const unsigned long *p,
544 unsigned long word; 544 unsigned long word;
545 545
546 p = (unsigned long *)((unsigned long) p + offset); 546 p = (unsigned long *)((unsigned long) p + offset);
547#ifndef __s390x__ 547#ifndef CONFIG_64BIT
548 asm volatile( 548 asm volatile(
549 " ic %0,%O1(%R1)\n" 549 " ic %0,%O1(%R1)\n"
550 " icm %0,2,%O1+1(%R1)\n" 550 " icm %0,2,%O1+1(%R1)\n"
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 24ef186a1c4f..718374de9c7f 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -21,15 +21,15 @@ typedef unsigned long long __nocast cputime64_t;
21 21
22static inline unsigned long __div(unsigned long long n, unsigned long base) 22static inline unsigned long __div(unsigned long long n, unsigned long base)
23{ 23{
24#ifndef __s390x__ 24#ifndef CONFIG_64BIT
25 register_pair rp; 25 register_pair rp;
26 26
27 rp.pair = n >> 1; 27 rp.pair = n >> 1;
28 asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1)); 28 asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1));
29 return rp.subreg.odd; 29 return rp.subreg.odd;
30#else /* __s390x__ */ 30#else /* CONFIG_64BIT */
31 return n / base; 31 return n / base;
32#endif /* __s390x__ */ 32#endif /* CONFIG_64BIT */
33} 33}
34 34
35#define cputime_one_jiffy jiffies_to_cputime(1) 35#define cputime_one_jiffy jiffies_to_cputime(1)
@@ -100,7 +100,7 @@ static inline void cputime_to_timespec(const cputime_t cputime,
100 struct timespec *value) 100 struct timespec *value)
101{ 101{
102 unsigned long long __cputime = (__force unsigned long long) cputime; 102 unsigned long long __cputime = (__force unsigned long long) cputime;
103#ifndef __s390x__ 103#ifndef CONFIG_64BIT
104 register_pair rp; 104 register_pair rp;
105 105
106 rp.pair = __cputime >> 1; 106 rp.pair = __cputime >> 1;
@@ -128,7 +128,7 @@ static inline void cputime_to_timeval(const cputime_t cputime,
128 struct timeval *value) 128 struct timeval *value)
129{ 129{
130 unsigned long long __cputime = (__force unsigned long long) cputime; 130 unsigned long long __cputime = (__force unsigned long long) cputime;
131#ifndef __s390x__ 131#ifndef CONFIG_64BIT
132 register_pair rp; 132 register_pair rp;
133 133
134 rp.pair = __cputime >> 1; 134 rp.pair = __cputime >> 1;
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
index ecde9417d669..debfda33d1f8 100644
--- a/arch/s390/include/asm/ctl_reg.h
+++ b/arch/s390/include/asm/ctl_reg.h
@@ -7,7 +7,7 @@
7#ifndef __ASM_CTL_REG_H 7#ifndef __ASM_CTL_REG_H
8#define __ASM_CTL_REG_H 8#define __ASM_CTL_REG_H
9 9
10#ifdef __s390x__ 10#ifdef CONFIG_64BIT
11 11
12#define __ctl_load(array, low, high) ({ \ 12#define __ctl_load(array, low, high) ({ \
13 typedef struct { char _[sizeof(array)]; } addrtype; \ 13 typedef struct { char _[sizeof(array)]; } addrtype; \
@@ -25,7 +25,7 @@
25 : "i" (low), "i" (high)); \ 25 : "i" (low), "i" (high)); \
26 }) 26 })
27 27
28#else /* __s390x__ */ 28#else /* CONFIG_64BIT */
29 29
30#define __ctl_load(array, low, high) ({ \ 30#define __ctl_load(array, low, high) ({ \
31 typedef struct { char _[sizeof(array)]; } addrtype; \ 31 typedef struct { char _[sizeof(array)]; } addrtype; \
@@ -43,7 +43,7 @@
43 : "i" (low), "i" (high)); \ 43 : "i" (low), "i" (high)); \
44 }) 44 })
45 45
46#endif /* __s390x__ */ 46#endif /* CONFIG_64BIT */
47 47
48#define __ctl_set_bit(cr, bit) ({ \ 48#define __ctl_set_bit(cr, bit) ({ \
49 unsigned long __dummy; \ 49 unsigned long __dummy; \
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index c4ee39f7a4d6..06151e6a3098 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -107,11 +107,11 @@
107/* 107/*
108 * These are used to set parameters in the core dumps. 108 * These are used to set parameters in the core dumps.
109 */ 109 */
110#ifndef __s390x__ 110#ifndef CONFIG_64BIT
111#define ELF_CLASS ELFCLASS32 111#define ELF_CLASS ELFCLASS32
112#else /* __s390x__ */ 112#else /* CONFIG_64BIT */
113#define ELF_CLASS ELFCLASS64 113#define ELF_CLASS ELFCLASS64
114#endif /* __s390x__ */ 114#endif /* CONFIG_64BIT */
115#define ELF_DATA ELFDATA2MSB 115#define ELF_DATA ELFDATA2MSB
116#define ELF_ARCH EM_S390 116#define ELF_ARCH EM_S390
117 117
@@ -181,9 +181,9 @@ extern unsigned long elf_hwcap;
181extern char elf_platform[]; 181extern char elf_platform[];
182#define ELF_PLATFORM (elf_platform) 182#define ELF_PLATFORM (elf_platform)
183 183
184#ifndef __s390x__ 184#ifndef CONFIG_64BIT
185#define SET_PERSONALITY(ex) set_personality(PER_LINUX) 185#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
186#else /* __s390x__ */ 186#else /* CONFIG_64BIT */
187#define SET_PERSONALITY(ex) \ 187#define SET_PERSONALITY(ex) \
188do { \ 188do { \
189 if (personality(current->personality) != PER_LINUX32) \ 189 if (personality(current->personality) != PER_LINUX32) \
@@ -194,7 +194,7 @@ do { \
194 else \ 194 else \
195 clear_thread_flag(TIF_31BIT); \ 195 clear_thread_flag(TIF_31BIT); \
196} while (0) 196} while (0)
197#endif /* __s390x__ */ 197#endif /* CONFIG_64BIT */
198 198
199#define STACK_RND_MASK 0x7ffUL 199#define STACK_RND_MASK 0x7ffUL
200 200
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h
index aae276d00383..aef0dde340d1 100644
--- a/arch/s390/include/asm/idals.h
+++ b/arch/s390/include/asm/idals.h
@@ -20,7 +20,7 @@
20#include <asm/cio.h> 20#include <asm/cio.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22 22
23#ifdef __s390x__ 23#ifdef CONFIG_64BIT
24#define IDA_SIZE_LOG 12 /* 11 for 2k , 12 for 4k */ 24#define IDA_SIZE_LOG 12 /* 11 for 2k , 12 for 4k */
25#else 25#else
26#define IDA_SIZE_LOG 11 /* 11 for 2k , 12 for 4k */ 26#define IDA_SIZE_LOG 11 /* 11 for 2k , 12 for 4k */
@@ -33,7 +33,7 @@
33static inline int 33static inline int
34idal_is_needed(void *vaddr, unsigned int length) 34idal_is_needed(void *vaddr, unsigned int length)
35{ 35{
36#ifdef __s390x__ 36#ifdef CONFIG_64BIT
37 return ((__pa(vaddr) + length - 1) >> 31) != 0; 37 return ((__pa(vaddr) + length - 1) >> 31) != 0;
38#else 38#else
39 return 0; 39 return 0;
@@ -78,7 +78,7 @@ static inline unsigned long *idal_create_words(unsigned long *idaws,
78static inline int 78static inline int
79set_normalized_cda(struct ccw1 * ccw, void *vaddr) 79set_normalized_cda(struct ccw1 * ccw, void *vaddr)
80{ 80{
81#ifdef __s390x__ 81#ifdef CONFIG_64BIT
82 unsigned int nridaws; 82 unsigned int nridaws;
83 unsigned long *idal; 83 unsigned long *idal;
84 84
@@ -105,7 +105,7 @@ set_normalized_cda(struct ccw1 * ccw, void *vaddr)
105static inline void 105static inline void
106clear_normalized_cda(struct ccw1 * ccw) 106clear_normalized_cda(struct ccw1 * ccw)
107{ 107{
108#ifdef __s390x__ 108#ifdef CONFIG_64BIT
109 if (ccw->flags & CCW_FLAG_IDA) { 109 if (ccw->flags & CCW_FLAG_IDA) {
110 kfree((void *)(unsigned long) ccw->cda); 110 kfree((void *)(unsigned long) ccw->cda);
111 ccw->flags &= ~CCW_FLAG_IDA; 111 ccw->flags &= ~CCW_FLAG_IDA;
@@ -182,7 +182,7 @@ idal_buffer_free(struct idal_buffer *ib)
182static inline int 182static inline int
183__idal_buffer_is_needed(struct idal_buffer *ib) 183__idal_buffer_is_needed(struct idal_buffer *ib)
184{ 184{
185#ifdef __s390x__ 185#ifdef CONFIG_64BIT
186 return ib->size > (4096ul << ib->page_order) || 186 return ib->size > (4096ul << ib->page_order) ||
187 idal_is_needed(ib->data[0], ib->size); 187 idal_is_needed(ib->data[0], ib->size);
188#else 188#else
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index 5d09e405c54d..69bdf72e95ec 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -49,7 +49,7 @@ static inline int init_new_context(struct task_struct *tsk,
49 49
50#define destroy_context(mm) do { } while (0) 50#define destroy_context(mm) do { } while (0)
51 51
52#ifndef __s390x__ 52#ifndef CONFIG_64BIT
53#define LCTL_OPCODE "lctl" 53#define LCTL_OPCODE "lctl"
54#else 54#else
55#define LCTL_OPCODE "lctlg" 55#define LCTL_OPCODE "lctlg"
diff --git a/arch/s390/include/asm/module.h b/arch/s390/include/asm/module.h
index 1cc1c5af705a..f0b6b26b6e59 100644
--- a/arch/s390/include/asm/module.h
+++ b/arch/s390/include/asm/module.h
@@ -28,7 +28,7 @@ struct mod_arch_specific
28 struct mod_arch_syminfo *syminfo; 28 struct mod_arch_syminfo *syminfo;
29}; 29};
30 30
31#ifdef __s390x__ 31#ifdef CONFIG_64BIT
32#define ElfW(x) Elf64_ ## x 32#define ElfW(x) Elf64_ ## x
33#define ELFW(x) ELF64_ ## x 33#define ELFW(x) ELF64_ ## x
34#else 34#else
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
index 0fbd1899c7b0..6537e72e0853 100644
--- a/arch/s390/include/asm/percpu.h
+++ b/arch/s390/include/asm/percpu.h
@@ -15,7 +15,7 @@
15 * per cpu area, use weak definitions to force the compiler to 15 * per cpu area, use weak definitions to force the compiler to
16 * generate external references. 16 * generate external references.
17 */ 17 */
18#if defined(CONFIG_SMP) && defined(__s390x__) && defined(MODULE) 18#if defined(CONFIG_SMP) && defined(CONFIG_64BIT) && defined(MODULE)
19#define ARCH_NEEDS_WEAK_PER_CPU 19#define ARCH_NEEDS_WEAK_PER_CPU
20#endif 20#endif
21 21
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index 78e3041919de..43078c194394 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -48,7 +48,7 @@ static inline void crst_table_init(unsigned long *crst, unsigned long entry)
48 clear_table(crst, entry, sizeof(unsigned long)*2048); 48 clear_table(crst, entry, sizeof(unsigned long)*2048);
49} 49}
50 50
51#ifndef __s390x__ 51#ifndef CONFIG_64BIT
52 52
53static inline unsigned long pgd_entry_type(struct mm_struct *mm) 53static inline unsigned long pgd_entry_type(struct mm_struct *mm)
54{ 54{
@@ -64,7 +64,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm)
64#define pgd_populate(mm, pgd, pud) BUG() 64#define pgd_populate(mm, pgd, pud) BUG()
65#define pud_populate(mm, pud, pmd) BUG() 65#define pud_populate(mm, pud, pmd) BUG()
66 66
67#else /* __s390x__ */ 67#else /* CONFIG_64BIT */
68 68
69static inline unsigned long pgd_entry_type(struct mm_struct *mm) 69static inline unsigned long pgd_entry_type(struct mm_struct *mm)
70{ 70{
@@ -106,7 +106,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
106 pud_val(*pud) = _REGION3_ENTRY | __pa(pmd); 106 pud_val(*pud) = _REGION3_ENTRY | __pa(pmd);
107} 107}
108 108
109#endif /* __s390x__ */ 109#endif /* CONFIG_64BIT */
110 110
111static inline pgd_t *pgd_alloc(struct mm_struct *mm) 111static inline pgd_t *pgd_alloc(struct mm_struct *mm)
112{ 112{
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 011358c1b18e..b3227415abda 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -74,15 +74,15 @@ static inline int is_zero_pfn(unsigned long pfn)
74 * table can map 74 * table can map
75 * PGDIR_SHIFT determines what a third-level page table entry can map 75 * PGDIR_SHIFT determines what a third-level page table entry can map
76 */ 76 */
77#ifndef __s390x__ 77#ifndef CONFIG_64BIT
78# define PMD_SHIFT 20 78# define PMD_SHIFT 20
79# define PUD_SHIFT 20 79# define PUD_SHIFT 20
80# define PGDIR_SHIFT 20 80# define PGDIR_SHIFT 20
81#else /* __s390x__ */ 81#else /* CONFIG_64BIT */
82# define PMD_SHIFT 20 82# define PMD_SHIFT 20
83# define PUD_SHIFT 31 83# define PUD_SHIFT 31
84# define PGDIR_SHIFT 42 84# define PGDIR_SHIFT 42
85#endif /* __s390x__ */ 85#endif /* CONFIG_64BIT */
86 86
87#define PMD_SIZE (1UL << PMD_SHIFT) 87#define PMD_SIZE (1UL << PMD_SHIFT)
88#define PMD_MASK (~(PMD_SIZE-1)) 88#define PMD_MASK (~(PMD_SIZE-1))
@@ -98,13 +98,13 @@ static inline int is_zero_pfn(unsigned long pfn)
98 * that leads to 1024 pte per pgd 98 * that leads to 1024 pte per pgd
99 */ 99 */
100#define PTRS_PER_PTE 256 100#define PTRS_PER_PTE 256
101#ifndef __s390x__ 101#ifndef CONFIG_64BIT
102#define PTRS_PER_PMD 1 102#define PTRS_PER_PMD 1
103#define PTRS_PER_PUD 1 103#define PTRS_PER_PUD 1
104#else /* __s390x__ */ 104#else /* CONFIG_64BIT */
105#define PTRS_PER_PMD 2048 105#define PTRS_PER_PMD 2048
106#define PTRS_PER_PUD 2048 106#define PTRS_PER_PUD 2048
107#endif /* __s390x__ */ 107#endif /* CONFIG_64BIT */
108#define PTRS_PER_PGD 2048 108#define PTRS_PER_PGD 2048
109 109
110#define FIRST_USER_ADDRESS 0 110#define FIRST_USER_ADDRESS 0
@@ -276,7 +276,7 @@ extern struct page *vmemmap;
276 * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid. 276 * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid.
277 */ 277 */
278 278
279#ifndef __s390x__ 279#ifndef CONFIG_64BIT
280 280
281/* Bits in the segment table address-space-control-element */ 281/* Bits in the segment table address-space-control-element */
282#define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */ 282#define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */
@@ -308,7 +308,7 @@ extern struct page *vmemmap;
308#define KVM_UR_BIT 0x00008000UL 308#define KVM_UR_BIT 0x00008000UL
309#define KVM_UC_BIT 0x00004000UL 309#define KVM_UC_BIT 0x00004000UL
310 310
311#else /* __s390x__ */ 311#else /* CONFIG_64BIT */
312 312
313/* Bits in the segment/region table address-space-control-element */ 313/* Bits in the segment/region table address-space-control-element */
314#define _ASCE_ORIGIN ~0xfffUL/* segment table origin */ 314#define _ASCE_ORIGIN ~0xfffUL/* segment table origin */
@@ -363,7 +363,7 @@ extern struct page *vmemmap;
363#define KVM_UR_BIT 0x0000800000000000UL 363#define KVM_UR_BIT 0x0000800000000000UL
364#define KVM_UC_BIT 0x0000400000000000UL 364#define KVM_UC_BIT 0x0000400000000000UL
365 365
366#endif /* __s390x__ */ 366#endif /* CONFIG_64BIT */
367 367
368/* 368/*
369 * A user page table pointer has the space-switch-event bit, the 369 * A user page table pointer has the space-switch-event bit, the
@@ -424,7 +424,7 @@ static inline int mm_has_pgste(struct mm_struct *mm)
424/* 424/*
425 * pgd/pmd/pte query functions 425 * pgd/pmd/pte query functions
426 */ 426 */
427#ifndef __s390x__ 427#ifndef CONFIG_64BIT
428 428
429static inline int pgd_present(pgd_t pgd) { return 1; } 429static inline int pgd_present(pgd_t pgd) { return 1; }
430static inline int pgd_none(pgd_t pgd) { return 0; } 430static inline int pgd_none(pgd_t pgd) { return 0; }
@@ -434,7 +434,7 @@ static inline int pud_present(pud_t pud) { return 1; }
434static inline int pud_none(pud_t pud) { return 0; } 434static inline int pud_none(pud_t pud) { return 0; }
435static inline int pud_bad(pud_t pud) { return 0; } 435static inline int pud_bad(pud_t pud) { return 0; }
436 436
437#else /* __s390x__ */ 437#else /* CONFIG_64BIT */
438 438
439static inline int pgd_present(pgd_t pgd) 439static inline int pgd_present(pgd_t pgd)
440{ 440{
@@ -490,7 +490,7 @@ static inline int pud_bad(pud_t pud)
490 return (pud_val(pud) & mask) != 0; 490 return (pud_val(pud) & mask) != 0;
491} 491}
492 492
493#endif /* __s390x__ */ 493#endif /* CONFIG_64BIT */
494 494
495static inline int pmd_present(pmd_t pmd) 495static inline int pmd_present(pmd_t pmd)
496{ 496{
@@ -741,7 +741,7 @@ static inline int pte_young(pte_t pte)
741 741
742static inline void pgd_clear(pgd_t *pgd) 742static inline void pgd_clear(pgd_t *pgd)
743{ 743{
744#ifdef __s390x__ 744#ifdef CONFIG_64BIT
745 if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2) 745 if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2)
746 pgd_val(*pgd) = _REGION2_ENTRY_EMPTY; 746 pgd_val(*pgd) = _REGION2_ENTRY_EMPTY;
747#endif 747#endif
@@ -749,7 +749,7 @@ static inline void pgd_clear(pgd_t *pgd)
749 749
750static inline void pud_clear(pud_t *pud) 750static inline void pud_clear(pud_t *pud)
751{ 751{
752#ifdef __s390x__ 752#ifdef CONFIG_64BIT
753 if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) 753 if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3)
754 pud_val(*pud) = _REGION3_ENTRY_EMPTY; 754 pud_val(*pud) = _REGION3_ENTRY_EMPTY;
755#endif 755#endif
@@ -921,7 +921,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
921static inline void __ptep_ipte(unsigned long address, pte_t *ptep) 921static inline void __ptep_ipte(unsigned long address, pte_t *ptep)
922{ 922{
923 if (!(pte_val(*ptep) & _PAGE_INVALID)) { 923 if (!(pte_val(*ptep) & _PAGE_INVALID)) {
924#ifndef __s390x__ 924#ifndef CONFIG_64BIT
925 /* pto must point to the start of the segment table */ 925 /* pto must point to the start of the segment table */
926 pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); 926 pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00);
927#else 927#else
@@ -1116,7 +1116,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
1116#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) 1116#define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address))
1117#define pgd_offset_k(address) pgd_offset(&init_mm, address) 1117#define pgd_offset_k(address) pgd_offset(&init_mm, address)
1118 1118
1119#ifndef __s390x__ 1119#ifndef CONFIG_64BIT
1120 1120
1121#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) 1121#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
1122#define pud_deref(pmd) ({ BUG(); 0UL; }) 1122#define pud_deref(pmd) ({ BUG(); 0UL; })
@@ -1125,7 +1125,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
1125#define pud_offset(pgd, address) ((pud_t *) pgd) 1125#define pud_offset(pgd, address) ((pud_t *) pgd)
1126#define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address)) 1126#define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address))
1127 1127
1128#else /* __s390x__ */ 1128#else /* CONFIG_64BIT */
1129 1129
1130#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) 1130#define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN)
1131#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN) 1131#define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN)
@@ -1147,7 +1147,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
1147 return pmd + pmd_index(address); 1147 return pmd + pmd_index(address);
1148} 1148}
1149 1149
1150#endif /* __s390x__ */ 1150#endif /* CONFIG_64BIT */
1151 1151
1152#define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot)) 1152#define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot))
1153#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 1153#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
@@ -1196,7 +1196,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
1196 * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 1196 * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66
1197 * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 1197 * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23
1198 */ 1198 */
1199#ifndef __s390x__ 1199#ifndef CONFIG_64BIT
1200#define __SWP_OFFSET_MASK (~0UL >> 12) 1200#define __SWP_OFFSET_MASK (~0UL >> 12)
1201#else 1201#else
1202#define __SWP_OFFSET_MASK (~0UL >> 11) 1202#define __SWP_OFFSET_MASK (~0UL >> 11)
@@ -1217,11 +1217,11 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
1217#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 1217#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
1218#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 1218#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
1219 1219
1220#ifndef __s390x__ 1220#ifndef CONFIG_64BIT
1221# define PTE_FILE_MAX_BITS 26 1221# define PTE_FILE_MAX_BITS 26
1222#else /* __s390x__ */ 1222#else /* CONFIG_64BIT */
1223# define PTE_FILE_MAX_BITS 59 1223# define PTE_FILE_MAX_BITS 59
1224#endif /* __s390x__ */ 1224#endif /* CONFIG_64BIT */
1225 1225
1226#define pte_to_pgoff(__pte) \ 1226#define pte_to_pgoff(__pte) \
1227 ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f)) 1227 ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f))
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 0aa04f9bc624..62e0d9f9a29a 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -39,27 +39,27 @@ extern int sysctl_ieee_emulation_warnings;
39/* 39/*
40 * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit. 40 * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
41 */ 41 */
42#ifndef __s390x__ 42#ifndef CONFIG_64BIT
43 43
44#define TASK_SIZE (1UL << 31) 44#define TASK_SIZE (1UL << 31)
45#define TASK_UNMAPPED_BASE (1UL << 30) 45#define TASK_UNMAPPED_BASE (1UL << 30)
46 46
47#else /* __s390x__ */ 47#else /* CONFIG_64BIT */
48 48
49#define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit) 49#define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit)
50#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ 50#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
51 (1UL << 30) : (1UL << 41)) 51 (1UL << 30) : (1UL << 41))
52#define TASK_SIZE TASK_SIZE_OF(current) 52#define TASK_SIZE TASK_SIZE_OF(current)
53 53
54#endif /* __s390x__ */ 54#endif /* CONFIG_64BIT */
55 55
56#ifndef __s390x__ 56#ifndef CONFIG_64BIT
57#define STACK_TOP (1UL << 31) 57#define STACK_TOP (1UL << 31)
58#define STACK_TOP_MAX (1UL << 31) 58#define STACK_TOP_MAX (1UL << 31)
59#else /* __s390x__ */ 59#else /* CONFIG_64BIT */
60#define STACK_TOP (1UL << (test_thread_flag(TIF_31BIT) ? 31:42)) 60#define STACK_TOP (1UL << (test_thread_flag(TIF_31BIT) ? 31:42))
61#define STACK_TOP_MAX (1UL << 42) 61#define STACK_TOP_MAX (1UL << 42)
62#endif /* __s390x__ */ 62#endif /* CONFIG_64BIT */
63 63
64#define HAVE_ARCH_PICK_MMAP_LAYOUT 64#define HAVE_ARCH_PICK_MMAP_LAYOUT
65 65
@@ -179,7 +179,7 @@ static inline void psw_set_key(unsigned int key)
179 */ 179 */
180static inline void __load_psw(psw_t psw) 180static inline void __load_psw(psw_t psw)
181{ 181{
182#ifndef __s390x__ 182#ifndef CONFIG_64BIT
183 asm volatile("lpsw %0" : : "Q" (psw) : "cc"); 183 asm volatile("lpsw %0" : : "Q" (psw) : "cc");
184#else 184#else
185 asm volatile("lpswe %0" : : "Q" (psw) : "cc"); 185 asm volatile("lpswe %0" : : "Q" (psw) : "cc");
@@ -197,7 +197,7 @@ static inline void __load_psw_mask (unsigned long mask)
197 197
198 psw.mask = mask; 198 psw.mask = mask;
199 199
200#ifndef __s390x__ 200#ifndef CONFIG_64BIT
201 asm volatile( 201 asm volatile(
202 " basr %0,0\n" 202 " basr %0,0\n"
203 "0: ahi %0,1f-0b\n" 203 "0: ahi %0,1f-0b\n"
@@ -205,14 +205,14 @@ static inline void __load_psw_mask (unsigned long mask)
205 " lpsw %1\n" 205 " lpsw %1\n"
206 "1:" 206 "1:"
207 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); 207 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
208#else /* __s390x__ */ 208#else /* CONFIG_64BIT */
209 asm volatile( 209 asm volatile(
210 " larl %0,1f\n" 210 " larl %0,1f\n"
211 " stg %0,%O1+8(%R1)\n" 211 " stg %0,%O1+8(%R1)\n"
212 " lpswe %1\n" 212 " lpswe %1\n"
213 "1:" 213 "1:"
214 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); 214 : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc");
215#endif /* __s390x__ */ 215#endif /* CONFIG_64BIT */
216} 216}
217 217
218/* 218/*
@@ -220,7 +220,7 @@ static inline void __load_psw_mask (unsigned long mask)
220 */ 220 */
221static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc) 221static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
222{ 222{
223#ifndef __s390x__ 223#ifndef CONFIG_64BIT
224 if (psw.addr & PSW_ADDR_AMODE) 224 if (psw.addr & PSW_ADDR_AMODE)
225 /* 31 bit mode */ 225 /* 31 bit mode */
226 return (psw.addr - ilc) | PSW_ADDR_AMODE; 226 return (psw.addr - ilc) | PSW_ADDR_AMODE;
@@ -250,7 +250,7 @@ static inline void __noreturn disabled_wait(unsigned long code)
250 * Store status and then load disabled wait psw, 250 * Store status and then load disabled wait psw,
251 * the processor is dead afterwards 251 * the processor is dead afterwards
252 */ 252 */
253#ifndef __s390x__ 253#ifndef CONFIG_64BIT
254 asm volatile( 254 asm volatile(
255 " stctl 0,0,0(%2)\n" 255 " stctl 0,0,0(%2)\n"
256 " ni 0(%2),0xef\n" /* switch off protection */ 256 " ni 0(%2),0xef\n" /* switch off protection */
@@ -269,7 +269,7 @@ static inline void __noreturn disabled_wait(unsigned long code)
269 " lpsw 0(%1)" 269 " lpsw 0(%1)"
270 : "=m" (ctl_buf) 270 : "=m" (ctl_buf)
271 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc"); 271 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc");
272#else /* __s390x__ */ 272#else /* CONFIG_64BIT */
273 asm volatile( 273 asm volatile(
274 " stctg 0,0,0(%2)\n" 274 " stctg 0,0,0(%2)\n"
275 " ni 4(%2),0xef\n" /* switch off protection */ 275 " ni 4(%2),0xef\n" /* switch off protection */
@@ -302,7 +302,7 @@ static inline void __noreturn disabled_wait(unsigned long code)
302 " lpswe 0(%1)" 302 " lpswe 0(%1)"
303 : "=m" (ctl_buf) 303 : "=m" (ctl_buf)
304 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0", "1"); 304 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0", "1");
305#endif /* __s390x__ */ 305#endif /* CONFIG_64BIT */
306 while (1); 306 while (1);
307} 307}
308 308
@@ -338,7 +338,7 @@ extern void (*s390_base_ext_handler_fn)(void);
338/* 338/*
339 * Helper macro for exception table entries 339 * Helper macro for exception table entries
340 */ 340 */
341#ifndef __s390x__ 341#ifndef CONFIG_64BIT
342#define EX_TABLE(_fault,_target) \ 342#define EX_TABLE(_fault,_target) \
343 ".section __ex_table,\"a\"\n" \ 343 ".section __ex_table,\"a\"\n" \
344 " .align 4\n" \ 344 " .align 4\n" \
diff --git a/arch/s390/include/asm/rwsem.h b/arch/s390/include/asm/rwsem.h
index 5a2f731ce128..1ceee10264c3 100644
--- a/arch/s390/include/asm/rwsem.h
+++ b/arch/s390/include/asm/rwsem.h
@@ -41,17 +41,17 @@
41#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" 41#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
42#endif 42#endif
43 43
44#ifndef __s390x__ 44#ifndef CONFIG_64BIT
45#define RWSEM_UNLOCKED_VALUE 0x00000000 45#define RWSEM_UNLOCKED_VALUE 0x00000000
46#define RWSEM_ACTIVE_BIAS 0x00000001 46#define RWSEM_ACTIVE_BIAS 0x00000001
47#define RWSEM_ACTIVE_MASK 0x0000ffff 47#define RWSEM_ACTIVE_MASK 0x0000ffff
48#define RWSEM_WAITING_BIAS (-0x00010000) 48#define RWSEM_WAITING_BIAS (-0x00010000)
49#else /* __s390x__ */ 49#else /* CONFIG_64BIT */
50#define RWSEM_UNLOCKED_VALUE 0x0000000000000000L 50#define RWSEM_UNLOCKED_VALUE 0x0000000000000000L
51#define RWSEM_ACTIVE_BIAS 0x0000000000000001L 51#define RWSEM_ACTIVE_BIAS 0x0000000000000001L
52#define RWSEM_ACTIVE_MASK 0x00000000ffffffffL 52#define RWSEM_ACTIVE_MASK 0x00000000ffffffffL
53#define RWSEM_WAITING_BIAS (-0x0000000100000000L) 53#define RWSEM_WAITING_BIAS (-0x0000000100000000L)
54#endif /* __s390x__ */ 54#endif /* CONFIG_64BIT */
55#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS 55#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
56#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) 56#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
57 57
@@ -63,19 +63,19 @@ static inline void __down_read(struct rw_semaphore *sem)
63 signed long old, new; 63 signed long old, new;
64 64
65 asm volatile( 65 asm volatile(
66#ifndef __s390x__ 66#ifndef CONFIG_64BIT
67 " l %0,%2\n" 67 " l %0,%2\n"
68 "0: lr %1,%0\n" 68 "0: lr %1,%0\n"
69 " ahi %1,%4\n" 69 " ahi %1,%4\n"
70 " cs %0,%1,%2\n" 70 " cs %0,%1,%2\n"
71 " jl 0b" 71 " jl 0b"
72#else /* __s390x__ */ 72#else /* CONFIG_64BIT */
73 " lg %0,%2\n" 73 " lg %0,%2\n"
74 "0: lgr %1,%0\n" 74 "0: lgr %1,%0\n"
75 " aghi %1,%4\n" 75 " aghi %1,%4\n"
76 " csg %0,%1,%2\n" 76 " csg %0,%1,%2\n"
77 " jl 0b" 77 " jl 0b"
78#endif /* __s390x__ */ 78#endif /* CONFIG_64BIT */
79 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 79 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
80 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) 80 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
81 : "cc", "memory"); 81 : "cc", "memory");
@@ -91,7 +91,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
91 signed long old, new; 91 signed long old, new;
92 92
93 asm volatile( 93 asm volatile(
94#ifndef __s390x__ 94#ifndef CONFIG_64BIT
95 " l %0,%2\n" 95 " l %0,%2\n"
96 "0: ltr %1,%0\n" 96 "0: ltr %1,%0\n"
97 " jm 1f\n" 97 " jm 1f\n"
@@ -99,7 +99,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
99 " cs %0,%1,%2\n" 99 " cs %0,%1,%2\n"
100 " jl 0b\n" 100 " jl 0b\n"
101 "1:" 101 "1:"
102#else /* __s390x__ */ 102#else /* CONFIG_64BIT */
103 " lg %0,%2\n" 103 " lg %0,%2\n"
104 "0: ltgr %1,%0\n" 104 "0: ltgr %1,%0\n"
105 " jm 1f\n" 105 " jm 1f\n"
@@ -107,7 +107,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem)
107 " csg %0,%1,%2\n" 107 " csg %0,%1,%2\n"
108 " jl 0b\n" 108 " jl 0b\n"
109 "1:" 109 "1:"
110#endif /* __s390x__ */ 110#endif /* CONFIG_64BIT */
111 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 111 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
112 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) 112 : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS)
113 : "cc", "memory"); 113 : "cc", "memory");
@@ -123,19 +123,19 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
123 123
124 tmp = RWSEM_ACTIVE_WRITE_BIAS; 124 tmp = RWSEM_ACTIVE_WRITE_BIAS;
125 asm volatile( 125 asm volatile(
126#ifndef __s390x__ 126#ifndef CONFIG_64BIT
127 " l %0,%2\n" 127 " l %0,%2\n"
128 "0: lr %1,%0\n" 128 "0: lr %1,%0\n"
129 " a %1,%4\n" 129 " a %1,%4\n"
130 " cs %0,%1,%2\n" 130 " cs %0,%1,%2\n"
131 " jl 0b" 131 " jl 0b"
132#else /* __s390x__ */ 132#else /* CONFIG_64BIT */
133 " lg %0,%2\n" 133 " lg %0,%2\n"
134 "0: lgr %1,%0\n" 134 "0: lgr %1,%0\n"
135 " ag %1,%4\n" 135 " ag %1,%4\n"
136 " csg %0,%1,%2\n" 136 " csg %0,%1,%2\n"
137 " jl 0b" 137 " jl 0b"
138#endif /* __s390x__ */ 138#endif /* CONFIG_64BIT */
139 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 139 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
140 : "Q" (sem->count), "m" (tmp) 140 : "Q" (sem->count), "m" (tmp)
141 : "cc", "memory"); 141 : "cc", "memory");
@@ -156,19 +156,19 @@ static inline int __down_write_trylock(struct rw_semaphore *sem)
156 signed long old; 156 signed long old;
157 157
158 asm volatile( 158 asm volatile(
159#ifndef __s390x__ 159#ifndef CONFIG_64BIT
160 " l %0,%1\n" 160 " l %0,%1\n"
161 "0: ltr %0,%0\n" 161 "0: ltr %0,%0\n"
162 " jnz 1f\n" 162 " jnz 1f\n"
163 " cs %0,%3,%1\n" 163 " cs %0,%3,%1\n"
164 " jl 0b\n" 164 " jl 0b\n"
165#else /* __s390x__ */ 165#else /* CONFIG_64BIT */
166 " lg %0,%1\n" 166 " lg %0,%1\n"
167 "0: ltgr %0,%0\n" 167 "0: ltgr %0,%0\n"
168 " jnz 1f\n" 168 " jnz 1f\n"
169 " csg %0,%3,%1\n" 169 " csg %0,%3,%1\n"
170 " jl 0b\n" 170 " jl 0b\n"
171#endif /* __s390x__ */ 171#endif /* CONFIG_64BIT */
172 "1:" 172 "1:"
173 : "=&d" (old), "=Q" (sem->count) 173 : "=&d" (old), "=Q" (sem->count)
174 : "Q" (sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS) 174 : "Q" (sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS)
@@ -184,19 +184,19 @@ static inline void __up_read(struct rw_semaphore *sem)
184 signed long old, new; 184 signed long old, new;
185 185
186 asm volatile( 186 asm volatile(
187#ifndef __s390x__ 187#ifndef CONFIG_64BIT
188 " l %0,%2\n" 188 " l %0,%2\n"
189 "0: lr %1,%0\n" 189 "0: lr %1,%0\n"
190 " ahi %1,%4\n" 190 " ahi %1,%4\n"
191 " cs %0,%1,%2\n" 191 " cs %0,%1,%2\n"
192 " jl 0b" 192 " jl 0b"
193#else /* __s390x__ */ 193#else /* CONFIG_64BIT */
194 " lg %0,%2\n" 194 " lg %0,%2\n"
195 "0: lgr %1,%0\n" 195 "0: lgr %1,%0\n"
196 " aghi %1,%4\n" 196 " aghi %1,%4\n"
197 " csg %0,%1,%2\n" 197 " csg %0,%1,%2\n"
198 " jl 0b" 198 " jl 0b"
199#endif /* __s390x__ */ 199#endif /* CONFIG_64BIT */
200 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 200 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
201 : "Q" (sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS) 201 : "Q" (sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS)
202 : "cc", "memory"); 202 : "cc", "memory");
@@ -214,19 +214,19 @@ static inline void __up_write(struct rw_semaphore *sem)
214 214
215 tmp = -RWSEM_ACTIVE_WRITE_BIAS; 215 tmp = -RWSEM_ACTIVE_WRITE_BIAS;
216 asm volatile( 216 asm volatile(
217#ifndef __s390x__ 217#ifndef CONFIG_64BIT
218 " l %0,%2\n" 218 " l %0,%2\n"
219 "0: lr %1,%0\n" 219 "0: lr %1,%0\n"
220 " a %1,%4\n" 220 " a %1,%4\n"
221 " cs %0,%1,%2\n" 221 " cs %0,%1,%2\n"
222 " jl 0b" 222 " jl 0b"
223#else /* __s390x__ */ 223#else /* CONFIG_64BIT */
224 " lg %0,%2\n" 224 " lg %0,%2\n"
225 "0: lgr %1,%0\n" 225 "0: lgr %1,%0\n"
226 " ag %1,%4\n" 226 " ag %1,%4\n"
227 " csg %0,%1,%2\n" 227 " csg %0,%1,%2\n"
228 " jl 0b" 228 " jl 0b"
229#endif /* __s390x__ */ 229#endif /* CONFIG_64BIT */
230 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 230 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
231 : "Q" (sem->count), "m" (tmp) 231 : "Q" (sem->count), "m" (tmp)
232 : "cc", "memory"); 232 : "cc", "memory");
@@ -244,19 +244,19 @@ static inline void __downgrade_write(struct rw_semaphore *sem)
244 244
245 tmp = -RWSEM_WAITING_BIAS; 245 tmp = -RWSEM_WAITING_BIAS;
246 asm volatile( 246 asm volatile(
247#ifndef __s390x__ 247#ifndef CONFIG_64BIT
248 " l %0,%2\n" 248 " l %0,%2\n"
249 "0: lr %1,%0\n" 249 "0: lr %1,%0\n"
250 " a %1,%4\n" 250 " a %1,%4\n"
251 " cs %0,%1,%2\n" 251 " cs %0,%1,%2\n"
252 " jl 0b" 252 " jl 0b"
253#else /* __s390x__ */ 253#else /* CONFIG_64BIT */
254 " lg %0,%2\n" 254 " lg %0,%2\n"
255 "0: lgr %1,%0\n" 255 "0: lgr %1,%0\n"
256 " ag %1,%4\n" 256 " ag %1,%4\n"
257 " csg %0,%1,%2\n" 257 " csg %0,%1,%2\n"
258 " jl 0b" 258 " jl 0b"
259#endif /* __s390x__ */ 259#endif /* CONFIG_64BIT */
260 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 260 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
261 : "Q" (sem->count), "m" (tmp) 261 : "Q" (sem->count), "m" (tmp)
262 : "cc", "memory"); 262 : "cc", "memory");
@@ -272,19 +272,19 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
272 signed long old, new; 272 signed long old, new;
273 273
274 asm volatile( 274 asm volatile(
275#ifndef __s390x__ 275#ifndef CONFIG_64BIT
276 " l %0,%2\n" 276 " l %0,%2\n"
277 "0: lr %1,%0\n" 277 "0: lr %1,%0\n"
278 " ar %1,%4\n" 278 " ar %1,%4\n"
279 " cs %0,%1,%2\n" 279 " cs %0,%1,%2\n"
280 " jl 0b" 280 " jl 0b"
281#else /* __s390x__ */ 281#else /* CONFIG_64BIT */
282 " lg %0,%2\n" 282 " lg %0,%2\n"
283 "0: lgr %1,%0\n" 283 "0: lgr %1,%0\n"
284 " agr %1,%4\n" 284 " agr %1,%4\n"
285 " csg %0,%1,%2\n" 285 " csg %0,%1,%2\n"
286 " jl 0b" 286 " jl 0b"
287#endif /* __s390x__ */ 287#endif /* CONFIG_64BIT */
288 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 288 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
289 : "Q" (sem->count), "d" (delta) 289 : "Q" (sem->count), "d" (delta)
290 : "cc", "memory"); 290 : "cc", "memory");
@@ -298,19 +298,19 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
298 signed long old, new; 298 signed long old, new;
299 299
300 asm volatile( 300 asm volatile(
301#ifndef __s390x__ 301#ifndef CONFIG_64BIT
302 " l %0,%2\n" 302 " l %0,%2\n"
303 "0: lr %1,%0\n" 303 "0: lr %1,%0\n"
304 " ar %1,%4\n" 304 " ar %1,%4\n"
305 " cs %0,%1,%2\n" 305 " cs %0,%1,%2\n"
306 " jl 0b" 306 " jl 0b"
307#else /* __s390x__ */ 307#else /* CONFIG_64BIT */
308 " lg %0,%2\n" 308 " lg %0,%2\n"
309 "0: lgr %1,%0\n" 309 "0: lgr %1,%0\n"
310 " agr %1,%4\n" 310 " agr %1,%4\n"
311 " csg %0,%1,%2\n" 311 " csg %0,%1,%2\n"
312 " jl 0b" 312 " jl 0b"
313#endif /* __s390x__ */ 313#endif /* CONFIG_64BIT */
314 : "=&d" (old), "=&d" (new), "=Q" (sem->count) 314 : "=&d" (old), "=&d" (new), "=Q" (sem->count)
315 : "Q" (sem->count), "d" (delta) 315 : "Q" (sem->count), "d" (delta)
316 : "cc", "memory"); 316 : "cc", "memory");
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 7244e1f64126..40eb2ff88e9e 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -22,19 +22,19 @@
22#include <asm/lowcore.h> 22#include <asm/lowcore.h>
23#include <asm/types.h> 23#include <asm/types.h>
24 24
25#ifndef __s390x__ 25#ifndef CONFIG_64BIT
26#define IPL_DEVICE (*(unsigned long *) (0x10404)) 26#define IPL_DEVICE (*(unsigned long *) (0x10404))
27#define INITRD_START (*(unsigned long *) (0x1040C)) 27#define INITRD_START (*(unsigned long *) (0x1040C))
28#define INITRD_SIZE (*(unsigned long *) (0x10414)) 28#define INITRD_SIZE (*(unsigned long *) (0x10414))
29#define OLDMEM_BASE (*(unsigned long *) (0x1041C)) 29#define OLDMEM_BASE (*(unsigned long *) (0x1041C))
30#define OLDMEM_SIZE (*(unsigned long *) (0x10424)) 30#define OLDMEM_SIZE (*(unsigned long *) (0x10424))
31#else /* __s390x__ */ 31#else /* CONFIG_64BIT */
32#define IPL_DEVICE (*(unsigned long *) (0x10400)) 32#define IPL_DEVICE (*(unsigned long *) (0x10400))
33#define INITRD_START (*(unsigned long *) (0x10408)) 33#define INITRD_START (*(unsigned long *) (0x10408))
34#define INITRD_SIZE (*(unsigned long *) (0x10410)) 34#define INITRD_SIZE (*(unsigned long *) (0x10410))
35#define OLDMEM_BASE (*(unsigned long *) (0x10418)) 35#define OLDMEM_BASE (*(unsigned long *) (0x10418))
36#define OLDMEM_SIZE (*(unsigned long *) (0x10420)) 36#define OLDMEM_SIZE (*(unsigned long *) (0x10420))
37#endif /* __s390x__ */ 37#endif /* CONFIG_64BIT */
38#define COMMAND_LINE ((char *) (0x10480)) 38#define COMMAND_LINE ((char *) (0x10480))
39 39
40#define CHUNK_READ_WRITE 0 40#define CHUNK_READ_WRITE 0
@@ -89,7 +89,7 @@ extern unsigned int user_mode;
89 89
90#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) 90#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
91 91
92#ifndef __s390x__ 92#ifndef CONFIG_64BIT
93#define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE) 93#define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
94#define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP) 94#define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
95#define MACHINE_HAS_IDTE (0) 95#define MACHINE_HAS_IDTE (0)
@@ -100,7 +100,7 @@ extern unsigned int user_mode;
100#define MACHINE_HAS_PFMF (0) 100#define MACHINE_HAS_PFMF (0)
101#define MACHINE_HAS_SPP (0) 101#define MACHINE_HAS_SPP (0)
102#define MACHINE_HAS_TOPOLOGY (0) 102#define MACHINE_HAS_TOPOLOGY (0)
103#else /* __s390x__ */ 103#else /* CONFIG_64BIT */
104#define MACHINE_HAS_IEEE (1) 104#define MACHINE_HAS_IEEE (1)
105#define MACHINE_HAS_CSP (1) 105#define MACHINE_HAS_CSP (1)
106#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) 106#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
@@ -111,7 +111,7 @@ extern unsigned int user_mode;
111#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) 111#define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
112#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) 112#define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP)
113#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) 113#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
114#endif /* __s390x__ */ 114#endif /* CONFIG_64BIT */
115 115
116#define ZFCPDUMP_HSA_SIZE (32UL<<20) 116#define ZFCPDUMP_HSA_SIZE (32UL<<20)
117#define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20) 117#define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20)
@@ -153,19 +153,19 @@ extern void (*_machine_power_off)(void);
153 153
154#else /* __ASSEMBLY__ */ 154#else /* __ASSEMBLY__ */
155 155
156#ifndef __s390x__ 156#ifndef CONFIG_64BIT
157#define IPL_DEVICE 0x10404 157#define IPL_DEVICE 0x10404
158#define INITRD_START 0x1040C 158#define INITRD_START 0x1040C
159#define INITRD_SIZE 0x10414 159#define INITRD_SIZE 0x10414
160#define OLDMEM_BASE 0x1041C 160#define OLDMEM_BASE 0x1041C
161#define OLDMEM_SIZE 0x10424 161#define OLDMEM_SIZE 0x10424
162#else /* __s390x__ */ 162#else /* CONFIG_64BIT */
163#define IPL_DEVICE 0x10400 163#define IPL_DEVICE 0x10400
164#define INITRD_START 0x10408 164#define INITRD_START 0x10408
165#define INITRD_SIZE 0x10410 165#define INITRD_SIZE 0x10410
166#define OLDMEM_BASE 0x10418 166#define OLDMEM_BASE 0x10418
167#define OLDMEM_SIZE 0x10420 167#define OLDMEM_SIZE 0x10420
168#endif /* __s390x__ */ 168#endif /* CONFIG_64BIT */
169#define COMMAND_LINE 0x10480 169#define COMMAND_LINE 0x10480
170 170
171#endif /* __ASSEMBLY__ */ 171#endif /* __ASSEMBLY__ */
diff --git a/arch/s390/include/asm/sfp-util.h b/arch/s390/include/asm/sfp-util.h
index ca3f8814e361..5959bfb3b693 100644
--- a/arch/s390/include/asm/sfp-util.h
+++ b/arch/s390/include/asm/sfp-util.h
@@ -51,7 +51,7 @@
51 wl = __wl; \ 51 wl = __wl; \
52}) 52})
53 53
54#ifdef __s390x__ 54#ifdef CONFIG_64BIT
55#define udiv_qrnnd(q, r, n1, n0, d) \ 55#define udiv_qrnnd(q, r, n1, n0, d) \
56 do { unsigned long __n; \ 56 do { unsigned long __n; \
57 unsigned int __r, __d; \ 57 unsigned int __r, __d; \
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index ed27145c9ae3..4e40b25cd060 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -12,10 +12,10 @@
12/* 12/*
13 * Size of kernel stack for each process 13 * Size of kernel stack for each process
14 */ 14 */
15#ifndef __s390x__ 15#ifndef CONFIG_64BIT
16#define THREAD_ORDER 1 16#define THREAD_ORDER 1
17#define ASYNC_ORDER 1 17#define ASYNC_ORDER 1
18#else /* __s390x__ */ 18#else /* CONFIG_64BIT */
19#ifndef __SMALL_STACK 19#ifndef __SMALL_STACK
20#define THREAD_ORDER 2 20#define THREAD_ORDER 2
21#define ASYNC_ORDER 2 21#define ASYNC_ORDER 2
@@ -23,7 +23,7 @@
23#define THREAD_ORDER 1 23#define THREAD_ORDER 1
24#define ASYNC_ORDER 1 24#define ASYNC_ORDER 1
25#endif 25#endif
26#endif /* __s390x__ */ 26#endif /* CONFIG_64BIT */
27 27
28#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) 28#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
29#define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER) 29#define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER)
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index 775a5eea8f9e..06e5acbc84bd 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -106,7 +106,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
106static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, 106static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
107 unsigned long address) 107 unsigned long address)
108{ 108{
109#ifdef __s390x__ 109#ifdef CONFIG_64BIT
110 if (tlb->mm->context.asce_limit <= (1UL << 31)) 110 if (tlb->mm->context.asce_limit <= (1UL << 31))
111 return; 111 return;
112 if (!tlb->fullmm) 112 if (!tlb->fullmm)
@@ -125,7 +125,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
125static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, 125static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
126 unsigned long address) 126 unsigned long address)
127{ 127{
128#ifdef __s390x__ 128#ifdef CONFIG_64BIT
129 if (tlb->mm->context.asce_limit <= (1UL << 42)) 129 if (tlb->mm->context.asce_limit <= (1UL << 42))
130 return; 130 return;
131 if (!tlb->fullmm) 131 if (!tlb->fullmm)
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h
index 1d8648cf2fea..9fde315f3a7c 100644
--- a/arch/s390/include/asm/tlbflush.h
+++ b/arch/s390/include/asm/tlbflush.h
@@ -27,12 +27,12 @@ static inline void __tlb_flush_global(void)
27 register unsigned long reg4 asm("4"); 27 register unsigned long reg4 asm("4");
28 long dummy; 28 long dummy;
29 29
30#ifndef __s390x__ 30#ifndef CONFIG_64BIT
31 if (!MACHINE_HAS_CSP) { 31 if (!MACHINE_HAS_CSP) {
32 smp_ptlb_all(); 32 smp_ptlb_all();
33 return; 33 return;
34 } 34 }
35#endif /* __s390x__ */ 35#endif /* CONFIG_64BIT */
36 36
37 dummy = 0; 37 dummy = 0;
38 reg2 = reg3 = 0; 38 reg2 = reg3 = 0;
diff --git a/arch/s390/include/asm/types.h b/arch/s390/include/asm/types.h
index 05ebbcdbbf6b..6c8c35f8df14 100644
--- a/arch/s390/include/asm/types.h
+++ b/arch/s390/include/asm/types.h
@@ -28,7 +28,7 @@ typedef __signed__ long saddr_t;
28 28
29#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
30 30
31#ifndef __s390x__ 31#ifndef CONFIG_64BIT
32typedef union { 32typedef union {
33 unsigned long long pair; 33 unsigned long long pair;
34 struct { 34 struct {
@@ -37,7 +37,7 @@ typedef union {
37 } subreg; 37 } subreg;
38} register_pair; 38} register_pair;
39 39
40#endif /* ! __s390x__ */ 40#endif /* ! CONFIG_64BIT */
41#endif /* __ASSEMBLY__ */ 41#endif /* __ASSEMBLY__ */
42#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
43#endif /* _S390_TYPES_H */ 43#endif /* _S390_TYPES_H */
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c
index 60455f104ea3..58a75a8ae90c 100644
--- a/arch/s390/lib/uaccess_mvcos.c
+++ b/arch/s390/lib/uaccess_mvcos.c
@@ -14,7 +14,7 @@
14#include <asm/futex.h> 14#include <asm/futex.h>
15#include "uaccess.h" 15#include "uaccess.h"
16 16
17#ifndef __s390x__ 17#ifndef CONFIG_64BIT
18#define AHI "ahi" 18#define AHI "ahi"
19#define ALR "alr" 19#define ALR "alr"
20#define CLR "clr" 20#define CLR "clr"
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c
index bb1a7eed42ce..57e94298539b 100644
--- a/arch/s390/lib/uaccess_std.c
+++ b/arch/s390/lib/uaccess_std.c
@@ -15,7 +15,7 @@
15#include <asm/futex.h> 15#include <asm/futex.h>
16#include "uaccess.h" 16#include "uaccess.h"
17 17
18#ifndef __s390x__ 18#ifndef CONFIG_64BIT
19#define AHI "ahi" 19#define AHI "ahi"
20#define ALR "alr" 20#define ALR "alr"
21#define CLR "clr" 21#define CLR "clr"
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 4799383e2df9..71ae20df674e 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -109,7 +109,7 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
109 pte = mk_pte_phys(address, __pgprot(ro ? _PAGE_RO : 0)); 109 pte = mk_pte_phys(address, __pgprot(ro ? _PAGE_RO : 0));
110 pm_dir = pmd_offset(pu_dir, address); 110 pm_dir = pmd_offset(pu_dir, address);
111 111
112#ifdef __s390x__ 112#ifdef CONFIG_64BIT
113 if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) && 113 if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) &&
114 (address + HPAGE_SIZE <= start + size) && 114 (address + HPAGE_SIZE <= start + size) &&
115 (address >= HPAGE_SIZE)) { 115 (address >= HPAGE_SIZE)) {