Skip to content

Commit ff3f786

Browse files
sulixrichardweinberger
authored andcommitted
um: Use the x86 checksum implementation on 32-bit
When UML is compiled under 32-bit x86, it uses its own copy of checksum_32.S, which is terribly out-of-date and doesn't support checksumming unaligned data. This causes the new "checksum" KUnit test to fail: ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_64BIT=n --cross_compile i686-linux-gnu- checksum KTAP version 1 # Subtest: checksum 1..3 # test_csum_fixed_random_inputs: ASSERTION FAILED at lib/checksum_kunit.c:243 Expected result == expec, but result == 33316 (0x8224) expec == 33488 (0x82d0) not ok 1 test_csum_fixed_random_inputs # test_csum_all_carry_inputs: ASSERTION FAILED at lib/checksum_kunit.c:267 Expected result == expec, but result == 65280 (0xff00) expec == 0 (0x0) not ok 2 test_csum_all_carry_inputs # test_csum_no_carry_inputs: ASSERTION FAILED at lib/checksum_kunit.c:306 Expected result == expec, but result == 65531 (0xfffb) expec == 0 (0x0) not ok 3 test_csum_no_carry_inputs Sharing the normal implementation in arch/x86/lib both fixes all of these issues and means any further fixes only need to be done once. x86_64 already seems to share the same implementation between UML and "normal" x86. Signed-off-by: David Gow <davidgow@google.com> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 760ee8f commit ff3f786

File tree

2 files changed

+2
-215
lines changed

2 files changed

+2
-215
lines changed

arch/x86/um/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ obj-y = bugs_$(BITS).o delay.o fault.o ldt.o \
1717

1818
ifeq ($(CONFIG_X86_32),y)
1919

20-
obj-y += checksum_32.o syscalls_32.o
20+
obj-y += syscalls_32.o
2121
obj-$(CONFIG_ELF_CORE) += elfcore.o
2222

2323
subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
2424
subarch-y += ../lib/cmpxchg8b_emu.o ../lib/atomic64_386_32.o
25+
subarch-y += ../lib/checksum_32.o
2526
subarch-y += ../kernel/sys_ia32.o
2627

2728
else

arch/x86/um/checksum_32.S

Lines changed: 0 additions & 214 deletions
This file was deleted.

0 commit comments

Comments
 (0)