Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp516475ybg; Fri, 18 Oct 2019 03:22:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmumpgOGdJhj1cd2ICSYVWsw/0dYzBQbFdeasSFf0/QxXzYZ4RdXVA+eRTimRMoEK2GmIJ X-Received: by 2002:a17:906:58d:: with SMTP id 13mr7828695ejn.293.1571394158303; Fri, 18 Oct 2019 03:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571394158; cv=none; d=google.com; s=arc-20160816; b=Z/sehB/vBLHvS7YJ9K2lz0b2QSJEdayIOhGWeCX7uJjPxNyfZiRM9ydD9GHPHHW+UZ oSeuxGEIlzajbPJI1wCJJBmyI1bE3uBNMlvgfDJZt/Rf0aWCVwgu+GGy7OIm4aiWAJ3n F8HouHzySAS/OVcZeNAwxphIhRacCjOIYRJUQ5Eu6BG3l6FcpkkxsLA5zwOlKvwmXqiK vTRA1cS6nrJ0XoBXlqXcKTzm8S6MJyOFsFfEPZLATuHA62WguaP3P3fG0NNv9k92YgxT 6pIXgFUAgo0wSwLWYaJ5lGrVdpm7YPjH6U7s6P1qWEdW2Dmu+bbh25HM6qMxyj5qiS7V p2Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NAlK7wpGBJDp9h5ArUgz0s02BIB5iryeRkGxEMHMyWs=; b=tFmG47LfU4E4axK5br+kIrl1uDivXFC+4WwEEGfHf1mQp7VNWsLrSU4Y8lawCgzBob wslE5vPBkWY1w1oo2iFgHanesdR6N6t3r5U7T2yGJ+sMKndVU2j+U3NGlFT90Uq9YLHF 699GgyMJ+vWAMXV9gLFsCnIl1eaCiBFHA1uvMJBrAxWnbONFHjdFxlkbAJE9zvJyVRju lA5GMrOOa6iW3L0Np0SwxE6pHxP6xUf47znyrktffk3bqEQjVhNe8dHB2ht0sS3y8AmN HGiQK+RBjZrG0ZJI6rPGon0pCfwo9WsavOl0y4JflggRpxr2mAon0mHj26OPIIyuVGuW 4TAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si3432522edc.321.2019.10.18.03.22.15; Fri, 18 Oct 2019 03:22:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439412AbfJQJW0 (ORCPT + 99 others); Thu, 17 Oct 2019 05:22:26 -0400 Received: from [217.140.110.172] ([217.140.110.172]:36512 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1731152AbfJQJWZ (ORCPT ); Thu, 17 Oct 2019 05:22:25 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 803C3168F; Thu, 17 Oct 2019 02:21:58 -0700 (PDT) Received: from [192.168.1.103] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 094333F718; Thu, 17 Oct 2019 02:21:49 -0700 (PDT) Subject: Re: [PATCHv7 01/33] ns: Introduce Time Namespace To: Andrei Vagin , Thomas Gleixner Cc: Dmitry Safonov , linux-kernel@vger.kernel.org, Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Adrian Reber , Andy Lutomirski , Arnd Bergmann , Christian Brauner , Cyrill Gorcunov , "Eric W. Biederman" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Jeff Dike , Oleg Nesterov , Pavel Emelyanov , Shuah Khan , containers@lists.linux-foundation.org, criu@openvz.org, linux-api@vger.kernel.org, x86@kernel.org References: <20191011012341.846266-1-dima@arista.com> <20191011012341.846266-2-dima@arista.com> <80af93da-d497-81de-2a2a-179bb3bc852d@arm.com> <20191016233342.GA3075@gmail.com> From: Vincenzo Frascino Message-ID: Date: Thu, 17 Oct 2019 10:23:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191016233342.GA3075@gmail.com> Content-Type: text/plain; charset=koi8-r Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrei, On 10/17/19 12:33 AM, Andrei Vagin wrote: >>> Having CONFIG_TIME_NS "default y" makes so that the option is selected even on >>> the architectures that have no support for time namespaces. >>> The direct consequence is that the fallbacks defined in this patch are never >>> selected and this ends up in kernel compilation errors due to missing symbols. >>> >>> The error below shows what happens on arm64 (similar behavior on other >>> architectures): >>> >>> aarch64-linux-gnu-ld: kernel/time/namespace.o: in function `timens_on_fork': >>> kernel/time/namespace.c:321: undefined reference to `vdso_join_timens' >>> >>> My proposal is to keep TIME_NS "default n" (just remove "default y"), let the >>> architectures that enable time namespaces select it and make CONFIG_TIME_NS >>> select GENERIC_VDSO_TIME_NS if arch has HAVE_GENERIC_VDSO. >> Nah. >> >> config TIME_NS >> bool "TIME namespace" >> depends on GENERIC_VDSO_TIME_NS > I was thinking to fix this by the same way with a small difference. > > If GENERIC_GETTIMEOFDAY isn't set, it should be safe to allow enabling > TIME_NS. In this case, clock_gettime works via system call and we don't > have arch-specific code in this case. Does this sound reasonable? > > depends on (!GENERIC_GETTIMEOFDAY || GENERIC_VDSO_TIME_NS) This option would not work because not all the architectures have been converted to the unified vdso approach. For example if you try to build ppc64 that does not set GENERIC_GETTIMEOFDAY but has vdso support you would get: powerpc64-linux-ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'. kernel/time/namespace.o: In function `.timens_set_vvar_page.isra.2.part.3': namespace.c:(.text+0x178): undefined reference to `.arch_get_vdso_data' kernel/time/namespace.o: In function `.timens_install': namespace.c:(.text+0x798): undefined reference to `.vdso_join_timens' kernel/time/namespace.o: In function `.timens_on_fork': namespace.c:(.text+0x90c): undefined reference to `.vdso_join_timens' /home/vinfra01/Projects/linux/Makefile:1074: recipe for target 'vmlinux' failed make[1]: *** [vmlinux] Error 1 make[1]: Leaving directory '/home/vinfra01/Projects/linux-out' Makefile:179: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 -- Regards, Vincenzo