Re: [PATCH v3] LoongArch: Add support to clone a time namespace

From: Tiezhu Yang
Date: Wed May 31 2023 - 06:04:19 EST

On 05/31/2023 05:21 PM, Thomas Gleixner wrote:
On Wed, May 31 2023 at 15:56, Tiezhu Yang wrote:
When execute the following command to test clone3 on LoongArch:

# cd tools/testing/selftests/clone3 && make && ./clone3

we can see the following error info:

# [5719] Trying clone3() with flags 0x80 (size 0)
# Invalid argument - Failed to create new process
# [5719] clone3() with flags says: -22 expected 0
not ok 18 [5719] Result (-22) is different than expected (0)

This is because if CONFIG_TIME_NS is not set, but the flag
CLONE_NEWTIME (0x80) is used to clone a time namespace, it
will return -EINVAL in copy_time_ns().

Which means that test case is broken.

With this patch, the following failed test can be fixed too:

You cannot fix a broken test case by enabling functionality which
is not guaranteed to be available on all platforms.

Adding time name spaces on loongarch is a completely separate issue and
has absolutely nothing to do with broken test cases.

They are still broken when CONFIG_TIME_NS is disabled in Kconfig, no?

So this wants to be two separate things:

1) Fix the broken test cases so they handle CONFIG_TIME_NS=n
situations correctly

2) Add support for TIME_NS to loongarch

Thanks for your reply and detailed suggestions,
I will do it in the next version.