uml/x86: use x86 load_unaligned_zeropad()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 31 Jan 2022 02:25:53 +0000 (21:25 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 31 Jan 2022 02:26:39 +0000 (21:26 -0500)
allows, among other things, to drop !DCACHE_WORD_ACCESS mess in
x86 csum-partial_64.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/um/include/asm/Kbuild
arch/x86/lib/csum-partial_64.c
arch/x86/um/Kconfig

index e5a7b55..a58b67e 100644 (file)
@@ -23,7 +23,6 @@ generic-y += softirq_stack.h
 generic-y += switch_to.h
 generic-y += topology.h
 generic-y += trace_clock.h
-generic-y += word-at-a-time.h
 generic-y += kprobes.h
 generic-y += mm_hooks.h
 generic-y += vga.h
index 1f8a8f8..50734a2 100644 (file)
@@ -93,7 +93,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
                buff += 8;
        }
        if (len & 7) {
-#ifdef CONFIG_DCACHE_WORD_ACCESS
                unsigned int shift = (8 - (len & 7)) * 8;
                unsigned long trail;
 
@@ -103,31 +102,6 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
                    "adcq $0,%[res]"
                        : [res] "+r" (temp64)
                        : [trail] "r" (trail));
-#else
-               if (len & 4) {
-                       asm("addq %[val],%[res]\n\t"
-                           "adcq $0,%[res]"
-                               : [res] "+r" (temp64)
-                               : [val] "r" ((u64)*(u32 *)buff)
-                               : "memory");
-                       buff += 4;
-               }
-               if (len & 2) {
-                       asm("addq %[val],%[res]\n\t"
-                           "adcq $0,%[res]"
-                               : [res] "+r" (temp64)
-                               : [val] "r" ((u64)*(u16 *)buff)
-                               : "memory");
-                       buff += 2;
-               }
-               if (len & 1) {
-                       asm("addq %[val],%[res]\n\t"
-                           "adcq $0,%[res]"
-                               : [res] "+r" (temp64)
-                               : [val] "r" ((u64)*(u8 *)buff)
-                               : "memory");
-               }
-#endif
        }
        result = add32_with_carry(temp64 >> 32, temp64 & 0xffffffff);
        if (unlikely(odd)) {
index 40d6a06..4eb47d3 100644 (file)
@@ -8,6 +8,7 @@ endmenu
 
 config UML_X86
        def_bool y
+       select DCACHE_WORD_ACCESS
 
 config 64BIT
        bool "64-bit kernel" if "$(SUBARCH)" = "x86"