Skip to content

Commit 6692531

Browse files
author
Al Viro
committed
uml/x86: use x86 load_unaligned_zeropad()
allows, among other things, to drop !DCACHE_WORD_ACCESS mess in x86 csum-partial_64.c Signed-off-by: Al Viro <[email protected]>
1 parent 0c9dceb commit 6692531

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

arch/um/include/asm/Kbuild

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ generic-y += softirq_stack.h
2323
generic-y += switch_to.h
2424
generic-y += topology.h
2525
generic-y += trace_clock.h
26-
generic-y += word-at-a-time.h
2726
generic-y += kprobes.h
2827
generic-y += mm_hooks.h
2928
generic-y += vga.h

arch/x86/lib/csum-partial_64.c

-26
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
9393
buff += 8;
9494
}
9595
if (len & 7) {
96-
#ifdef CONFIG_DCACHE_WORD_ACCESS
9796
unsigned int shift = (8 - (len & 7)) * 8;
9897
unsigned long trail;
9998

@@ -103,31 +102,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
103102
"adcq $0,%[res]"
104103
: [res] "+r" (temp64)
105104
: [trail] "r" (trail));
106-
#else
107-
if (len & 4) {
108-
asm("addq %[val],%[res]\n\t"
109-
"adcq $0,%[res]"
110-
: [res] "+r" (temp64)
111-
: [val] "r" ((u64)*(u32 *)buff)
112-
: "memory");
113-
buff += 4;
114-
}
115-
if (len & 2) {
116-
asm("addq %[val],%[res]\n\t"
117-
"adcq $0,%[res]"
118-
: [res] "+r" (temp64)
119-
: [val] "r" ((u64)*(u16 *)buff)
120-
: "memory");
121-
buff += 2;
122-
}
123-
if (len & 1) {
124-
asm("addq %[val],%[res]\n\t"
125-
"adcq $0,%[res]"
126-
: [res] "+r" (temp64)
127-
: [val] "r" ((u64)*(u8 *)buff)
128-
: "memory");
129-
}
130-
#endif
131105
}
132106
result = add32_with_carry(temp64 >> 32, temp64 & 0xffffffff);
133107
if (unlikely(odd)) {

arch/x86/um/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ endmenu
88

99
config UML_X86
1010
def_bool y
11+
select DCACHE_WORD_ACCESS
1112

1213
config 64BIT
1314
bool "64-bit kernel" if "$(SUBARCH)" = "x86"

0 commit comments

Comments
 (0)