um: Use the x86 checksum implementation on 32-bit
authorDavid Gow <davidgow@google.com>
Tue, 4 Jul 2023 08:30:22 +0000 (16:30 +0800)
committerRichard Weinberger <richard@nod.at>
Sat, 26 Aug 2023 20:39:24 +0000 (22:39 +0200)
commitff3f78607998274460f1742a7dfd853c6124d34a
treedf7c62f0e4529104e980064d782ae63def0cb6f0
parent760ee8f83825f6b6ee711bb50b61a2e9a89209a0
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>
arch/x86/um/Makefile
arch/x86/um/checksum_32.S [deleted file]