Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3001553rwd; Fri, 2 Jun 2023 19:16:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MSrFY7zr8+SmVTL3KJgDAwrqyjk6IBk1FbWqlk7i2KM9KCmzFSnOiQ3A2fyNmOOnkE6Zt X-Received: by 2002:a05:6a00:1a53:b0:64d:f5a:3fd2 with SMTP id h19-20020a056a001a5300b0064d0f5a3fd2mr14595511pfv.28.1685758607225; Fri, 02 Jun 2023 19:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685758607; cv=none; d=google.com; s=arc-20160816; b=T2t8BT9rCSQG9hl4CfNv2D2A0CkpBhjsAn0otQfR8/bIc6cmXyUdDobg71CZN1np3+ Q9t3jTdRVYNMHwn9l8muFb3rAFkioAjKUSjGr2U3j1KLwWKzRH94dicgyPuXMYKRzvsW X6SuBg96gdOo6IVAAAUHayLM6oxvdGQQ9qQZJHcB6HWbQoiZ4GJ4Zw27mODII7P57q4y AeIQ3ztUgihvgREwLhgwEcvAT+pM3469NkeOJQtkNixuhaS8Ig44caJTax0rmueB9/qG S711kZ9MLzno44xILiv/jQYA1DE5ZuUWzO8zfHabD0FPzREdz3JtjRd1ep+FGcp8bUdy cEWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=k2QY3V+DjOa1lLOd/sZQ/SDm1OEZM21Kn9iJy+7AJvE=; b=U/Q9m6w+9FwNnIhFudVvEZRvESlAgk616tVcm7BhICdsj/vo2k3DMAdo5bfQzlFlnP rbTehWGyFNbAO9Kx5/oddXKPWUqMZZtsAbkIgY1mnE6x9zBgfg7XTf32dLvPSuMxnyaZ rBfiONLgjssToMq8DmRtnMyHL0L4WAjTQCMy9gKlaAlNjKjSh1Tn+6aXuTYva06XUGlN bECzoVmjTGaRxHT0i7cqFJ5bo4XKoy8RDmSrPOQP8FnXiN5fCBsT+8CPRcrnNlgkWYgl eOWHDypuy9FSUOmb7K0iokJ/ZTPR9lVzKnXnlDbgsgGWdI6jq2jAmpulbLv6rCt/3N1C RhDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m64-20020a625843000000b0064d22da9421si1660721pfb.254.2023.06.02.19.16.33; Fri, 02 Jun 2023 19:16:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236871AbjFCCHz (ORCPT + 99 others); Fri, 2 Jun 2023 22:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbjFCCHy (ORCPT ); Fri, 2 Jun 2023 22:07:54 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B10DE4D for ; Fri, 2 Jun 2023 19:07:52 -0700 (PDT) Received: from loongson.cn (unknown [192.168.100.1]) by gateway (Coremail) with SMTP id _____8Dx9fB3oHpkQNMDAA--.8409S3; Sat, 03 Jun 2023 10:07:51 +0800 (CST) Received: from [0.0.0.0] (unknown [192.168.100.1]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxXrN2oHpkEbyGAA--.22083S3; Sat, 03 Jun 2023 10:07:50 +0800 (CST) Subject: Re: [PATCH v3] LoongArch: Add support to clone a time namespace To: Tiezhu Yang References: <1685519761-20425-1-git-send-email-yangtiezhu@loongson.cn> <87bki0hn4y.ffs@tglx> Cc: Thomas Gleixner , Huacai Chen , WANG Xuerui , Christian Brauner , Andy Lutomirski , Vincenzo Frascino , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn From: Youling Tang Message-ID: Date: Sat, 3 Jun 2023 10:07:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf8DxXrN2oHpkEbyGAA--.22083S3 X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Kr1UCFWfAryUuFWxJF4UXFb_yoW8Cw47pF 97Wan8Kw4kWF15tF9rt3WDXFyrKws3ZFWUWryYv348CasY9wn5Jr48t3y8uFyrJr1kJ34I v348trWa934UAaDanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bDkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUJVWUCwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwA2z4 x0Y4vEx4A2jsIE14v26r4j6F4UM28EF7xvwVC2z280aVCY1x0267AKxVW8JVW8Jr1ln4kS 14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07 AlzVAYIcxG8wCY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE 7xkEbVWUJVW8JwCFI7km07C267AKxVWUXVWUAwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcV CF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIE c7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU89iSPUUUUU== X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Tiezhu On 05/31/2023 06:04 PM, Tiezhu Yang wrote: > > > 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 >> With this patch, we should also modify the stack_top() implementation, because the vvar size is not PAGE_SIZE at this time. 'maps' before the patch, # sudo cat /proc/1/maps ... 7ffffbec8000-7ffffbeec000 rw-p 00000000 00:00 0 [stack] 7ffffc7d8000-7ffffc7dc000 r--p 00000000 00:00 0 [vvar] 7ffffc7dc000-7ffffc7e0000 r-xp 00000000 00:00 0 [vdso] STACK_TOP = TASK_SIZE - PAGE_ALIGN(current->thread.vdso->size) - VVAR_SIZE Thanks, Youling. > > > Thanks for your reply and detailed suggestions, > I will do it in the next version. > > Thanks, > Tiezhu >