Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1647084ybb; Thu, 9 Apr 2020 06:26:12 -0700 (PDT) X-Google-Smtp-Source: APiQypLz4SYGHxaXbkdV08bEUkYOBc0yVXUKaUqnj7uBzUm6qZXBRb0sjPlS3OWkW+ogqitgOwAQ X-Received: by 2002:a37:4d56:: with SMTP id a83mr5064620qkb.40.1586438772270; Thu, 09 Apr 2020 06:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586438772; cv=none; d=google.com; s=arc-20160816; b=hpTfvEfclWHhD1vuYGp8S5g0BH4HBfouatG4jCdR0EylrCfrMQy10APYwuEoRFM/aP yOBQWjUcg9ASUevgkIFgkliqGWTbS3C3tdnrAwU5E5rHm+AKAB2/BLd4eHA29LAQMdoy pDHxUKFGBFs/5nO9498txNdTpGEH7/9sRd2dYqb1aY2HAB8Xg8N4qvrJYuluUjoi5lGO QJ6zkaDrVe1mELPC8WWq2DJ5GCU1DfXM0maV0ryeIZitGQFUY7Wz7hbAK1qVxIffC+LJ YaDlXu4gMQllNvINQZE4lEO0/svyrBC5BRj9ytXQf5181Ef/+/ugVvhD7x22Vhd3lwhY BJkw== 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=PrkhRxFbn4FnzJbssbBajBWCX18vHrewK2Kdh6ZuPxU=; b=0SI6qOlNHXcaLjtH5x0m2sFLG4uyvXTpi28UrExTgks1IKgwgPER+4Rt/ZUasK4h/Y pyVaXjmii0Zz9xoHKb9rOUd+9Hbme/qulqa5gUcX/xr07aFJLSyceB0ejYS2WHwklZQV f4vAfXOVVXHECyv8wVNAT+6FDv7cPVzkTe+4UXXH2XqdNi0AW/dbdfrhpZvkmc5xYXFF sHNXy/1lEF0iDwJQUV13xUDkXieOiBdprlEfm0yCkUVxzaWjPUi8peclB9GLctL0OoMA 2WZ1w3wqCOI4nEF1Ip4RXgiMlhwlr8EAgQLo91b1H73MfTuWQ71SkrtPWCRzPLq65ovy mt+g== 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 190si5707678qkh.271.2020.04.09.06.25.55; Thu, 09 Apr 2020 06:26:12 -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 S1726765AbgDINXz (ORCPT + 99 others); Thu, 9 Apr 2020 09:23:55 -0400 Received: from foss.arm.com ([217.140.110.172]:50104 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbgDINXz (ORCPT ); Thu, 9 Apr 2020 09:23:55 -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 8A3A130E; Thu, 9 Apr 2020 06:23:55 -0700 (PDT) Received: from [10.37.8.193] (unknown [10.37.8.193]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F2233F73D; Thu, 9 Apr 2020 06:23:54 -0700 (PDT) Subject: Re: [PATCH v2 0/6] arm64: add the time namespace support To: Andrei Vagin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Dmitry Safonov References: <20200225073731.465270-1-avagin@gmail.com> From: Vincenzo Frascino Message-ID: <1c1ab662-5475-9d8b-038b-8411b060202a@arm.com> Date: Thu, 9 Apr 2020 14:24:39 +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: <20200225073731.465270-1-avagin@gmail.com> Content-Type: text/plain; charset=utf-8 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 2/25/20 7:37 AM, Andrei Vagin wrote: > Allocate the time namespace page among VVAR pages and add the logic > to handle faults on VVAR properly. > > If a task belongs to a time namespace then the VVAR page which contains > the system wide VDSO data is replaced with a namespace specific page > which has the same layout as the VVAR page. That page has vdso_data->seq > set to 1 to enforce the slow path and vdso_data->clock_mode set to > VCLOCK_TIMENS to enforce the time namespace handling path. > > The extra check in the case that vdso_data->seq is odd, e.g. a concurrent > update of the VDSO data is in progress, is not really affecting regular > tasks which are not part of a time namespace as the task is spin waiting > for the update to finish and vdso_data->seq to become even again. > > If a time namespace task hits that code path, it invokes the corresponding > time getter function which retrieves the real VVAR page, reads host time > and then adds the offset for the requested clock which is stored in the > special VVAR page. > > v2: Code cleanups suggested by Vincenzo. > Sorry for the delay, I completed this morning the review of your patches and I do not have anymore comments on them. Thank you for making the effort and bringing the time namespace support to arm64. I have though a question on something I encountered during the testing of the patches: I noticed that all the tests related to CLOCK_BOOTTIME_ALARM fail on arm64 (please find the results below the scissors). Is this expected? --->8--- 1..4 ok 1 clockid: 1 abs:0 ok 2 clockid: 1 abs:1 not ok 3 # error clock_gettime: Invalid argument not ok 4 # error clock_gettime: Invalid argument Bail out! # Pass 2 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 2 1..1 ok 1 exec # Pass 1 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 1..8 not ok 1 # error Warning: failed to find clock_gettime in vDSO ./timens.sh: line 5: 15382 Segmentation fault (core dumped) ./gettime_perf 1..1 ok 1 Passed for /proc/uptime # Pass 1 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 1..10 ok 1 Passed for CLOCK_BOOTTIME (syscall) ok 2 Passed for CLOCK_BOOTTIME (vdso) not ok 3 # error syscall(SYS_clock_gettime(9)): Invalid argument not ok 4 # error clock_gettime(9): Invalid argument ok 5 Passed for CLOCK_MONOTONIC (syscall) ok 6 Passed for CLOCK_MONOTONIC (vdso) ok 7 Passed for CLOCK_MONOTONIC_COARSE (syscall) ok 8 Passed for CLOCK_MONOTONIC_COARSE (vdso) ok 9 Passed for CLOCK_MONOTONIC_RAW (syscall) ok 10 Passed for CLOCK_MONOTONIC_RAW (vdso) Bail out! # Pass 8 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 2 1..3 ok 1 clockid=7 ok 2 clockid=1 not ok 3 # error timerfd_create: Operation not supported Bail out! # Pass 2 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 1 1..3 ok 1 clockid=7 ok 2 clockid=1 ok 3 clockid=9 # Pass 3 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 [...] -- Regards, Vincenzo