Skip to content

Commit 738d5fa

Browse files
committed
Merge branch 'parisc-5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "Just trivial small updates: An assembler register optimization in the inlined networking checksum functions, a compiler warning fix and don't unneccesary print a runtime warning on machines which wouldn't be affected anyway" * 'parisc-5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Avoid spurious inequivalent alias kernel error messages kexec: Fix pointer-to-int-cast warnings parisc: Do not hardcode registers in checksum functions
2 parents 7794b1d + e9c837c commit 738d5fa

File tree

3 files changed

+55
-52
lines changed

3 files changed

+55
-52
lines changed

arch/parisc/include/asm/checksum.h

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,32 @@ extern __wsum csum_partial_copy_from_user(const void __user *src,
4242
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
4343
{
4444
unsigned int sum;
45+
unsigned long t0, t1, t2;
4546

4647
__asm__ __volatile__ (
4748
" ldws,ma 4(%1), %0\n"
4849
" addib,<= -4, %2, 2f\n"
4950
"\n"
50-
" ldws 4(%1), %%r20\n"
51-
" ldws 8(%1), %%r21\n"
52-
" add %0, %%r20, %0\n"
53-
" ldws,ma 12(%1), %%r19\n"
54-
" addc %0, %%r21, %0\n"
55-
" addc %0, %%r19, %0\n"
56-
"1: ldws,ma 4(%1), %%r19\n"
51+
" ldws 4(%1), %4\n"
52+
" ldws 8(%1), %5\n"
53+
" add %0, %4, %0\n"
54+
" ldws,ma 12(%1), %3\n"
55+
" addc %0, %5, %0\n"
56+
" addc %0, %3, %0\n"
57+
"1: ldws,ma 4(%1), %3\n"
5758
" addib,< 0, %2, 1b\n"
58-
" addc %0, %%r19, %0\n"
59+
" addc %0, %3, %0\n"
5960
"\n"
60-
" extru %0, 31, 16, %%r20\n"
61-
" extru %0, 15, 16, %%r21\n"
62-
" addc %%r20, %%r21, %0\n"
63-
" extru %0, 15, 16, %%r21\n"
64-
" add %0, %%r21, %0\n"
61+
" extru %0, 31, 16, %4\n"
62+
" extru %0, 15, 16, %5\n"
63+
" addc %4, %5, %0\n"
64+
" extru %0, 15, 16, %5\n"
65+
" add %0, %5, %0\n"
6566
" subi -1, %0, %0\n"
6667
"2:\n"
67-
: "=r" (sum), "=r" (iph), "=r" (ihl)
68+
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (t0), "=r" (t1), "=r" (t2)
6869
: "1" (iph), "2" (ihl)
69-
: "r19", "r20", "r21", "memory");
70+
: "memory");
7071

7172
return (__force __sum16)sum;
7273
}
@@ -126,6 +127,10 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
126127
__u32 len, __u8 proto,
127128
__wsum sum)
128129
{
130+
unsigned long t0, t1, t2, t3;
131+
132+
len += proto; /* add 16-bit proto + len */
133+
129134
__asm__ __volatile__ (
130135

131136
#if BITS_PER_LONG > 32
@@ -136,20 +141,19 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
136141
** Try to keep 4 registers with "live" values ahead of the ALU.
137142
*/
138143

139-
" ldd,ma 8(%1), %%r19\n" /* get 1st saddr word */
140-
" ldd,ma 8(%2), %%r20\n" /* get 1st daddr word */
141-
" add %8, %3, %3\n"/* add 16-bit proto + len */
142-
" add %%r19, %0, %0\n"
143-
" ldd,ma 8(%1), %%r21\n" /* 2cd saddr */
144-
" ldd,ma 8(%2), %%r22\n" /* 2cd daddr */
145-
" add,dc %%r20, %0, %0\n"
146-
" add,dc %%r21, %0, %0\n"
147-
" add,dc %%r22, %0, %0\n"
144+
" ldd,ma 8(%1), %4\n" /* get 1st saddr word */
145+
" ldd,ma 8(%2), %5\n" /* get 1st daddr word */
146+
" add %4, %0, %0\n"
147+
" ldd,ma 8(%1), %6\n" /* 2nd saddr */
148+
" ldd,ma 8(%2), %7\n" /* 2nd daddr */
149+
" add,dc %5, %0, %0\n"
150+
" add,dc %6, %0, %0\n"
151+
" add,dc %7, %0, %0\n"
148152
" add,dc %3, %0, %0\n" /* fold in proto+len | carry bit */
149-
" extrd,u %0, 31, 32, %%r19\n" /* copy upper half down */
150-
" depdi 0, 31, 32, %0\n" /* clear upper half */
151-
" add %%r19, %0, %0\n" /* fold into 32-bits */
152-
" addc 0, %0, %0\n" /* add carry */
153+
" extrd,u %0, 31, 32, %4\n"/* copy upper half down */
154+
" depdi 0, 31, 32, %0\n"/* clear upper half */
155+
" add %4, %0, %0\n" /* fold into 32-bits */
156+
" addc 0, %0, %0\n" /* add carry */
153157

154158
#else
155159

@@ -158,30 +162,29 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
158162
** Insn stream is serialized on the carry bit here too.
159163
** result from the previous operation (eg r0 + x)
160164
*/
161-
162-
" ldw,ma 4(%1), %%r19\n" /* get 1st saddr word */
163-
" ldw,ma 4(%2), %%r20\n" /* get 1st daddr word */
164-
" add %8, %3, %3\n" /* add 16-bit proto + len */
165-
" add %%r19, %0, %0\n"
166-
" ldw,ma 4(%1), %%r21\n" /* 2cd saddr */
167-
" addc %%r20, %0, %0\n"
168-
" ldw,ma 4(%2), %%r22\n" /* 2cd daddr */
169-
" addc %%r21, %0, %0\n"
170-
" ldw,ma 4(%1), %%r19\n" /* 3rd saddr */
171-
" addc %%r22, %0, %0\n"
172-
" ldw,ma 4(%2), %%r20\n" /* 3rd daddr */
173-
" addc %%r19, %0, %0\n"
174-
" ldw,ma 4(%1), %%r21\n" /* 4th saddr */
175-
" addc %%r20, %0, %0\n"
176-
" ldw,ma 4(%2), %%r22\n" /* 4th daddr */
177-
" addc %%r21, %0, %0\n"
178-
" addc %%r22, %0, %0\n"
165+
" ldw,ma 4(%1), %4\n" /* get 1st saddr word */
166+
" ldw,ma 4(%2), %5\n" /* get 1st daddr word */
167+
" add %4, %0, %0\n"
168+
" ldw,ma 4(%1), %6\n" /* 2nd saddr */
169+
" addc %5, %0, %0\n"
170+
" ldw,ma 4(%2), %7\n" /* 2nd daddr */
171+
" addc %6, %0, %0\n"
172+
" ldw,ma 4(%1), %4\n" /* 3rd saddr */
173+
" addc %7, %0, %0\n"
174+
" ldw,ma 4(%2), %5\n" /* 3rd daddr */
175+
" addc %4, %0, %0\n"
176+
" ldw,ma 4(%1), %6\n" /* 4th saddr */
177+
" addc %5, %0, %0\n"
178+
" ldw,ma 4(%2), %7\n" /* 4th daddr */
179+
" addc %6, %0, %0\n"
180+
" addc %7, %0, %0\n"
179181
" addc %3, %0, %0\n" /* fold in proto+len, catch carry */
180182

181183
#endif
182-
: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len)
183-
: "0" (sum), "1" (saddr), "2" (daddr), "3" (len), "r" (proto)
184-
: "r19", "r20", "r21", "r22", "memory");
184+
: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len),
185+
"=r" (t0), "=r" (t1), "=r" (t2), "=r" (t3)
186+
: "0" (sum), "1" (saddr), "2" (daddr), "3" (len)
187+
: "memory");
185188
return csum_fold(sum);
186189
}
187190

arch/parisc/kernel/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ void flush_dcache_page(struct page *page)
365365
if (old_addr == 0 || (old_addr & (SHM_COLOUR - 1))
366366
!= (addr & (SHM_COLOUR - 1))) {
367367
__flush_cache_page(mpnt, addr, page_to_phys(page));
368-
if (old_addr)
368+
if (parisc_requires_coherency() && old_addr)
369369
printk(KERN_ERR "INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %pD\n", old_addr, addr, mpnt->vm_file);
370370
old_addr = addr;
371371
}

kernel/kexec_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map,
13041304
if (kernel_map) {
13051305
phdr->p_type = PT_LOAD;
13061306
phdr->p_flags = PF_R|PF_W|PF_X;
1307-
phdr->p_vaddr = (Elf64_Addr)_text;
1307+
phdr->p_vaddr = (unsigned long) _text;
13081308
phdr->p_filesz = phdr->p_memsz = _end - _text;
13091309
phdr->p_offset = phdr->p_paddr = __pa_symbol(_text);
13101310
ehdr->e_phnum++;
@@ -1321,7 +1321,7 @@ int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map,
13211321
phdr->p_offset = mstart;
13221322

13231323
phdr->p_paddr = mstart;
1324-
phdr->p_vaddr = (unsigned long long) __va(mstart);
1324+
phdr->p_vaddr = (unsigned long) __va(mstart);
13251325
phdr->p_filesz = phdr->p_memsz = mend - mstart + 1;
13261326
phdr->p_align = 0;
13271327
ehdr->e_phnum++;

0 commit comments

Comments
 (0)