Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3507081ybl; Fri, 20 Dec 2019 10:25:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzicrKkDcGsoAS/g7S2yVUVRtaHr0QbKZw+VXYGLDW3u+Th6kvof6a8I8gCRpCmtgp8M01K X-Received: by 2002:a9d:600e:: with SMTP id h14mr15801619otj.113.1576866331601; Fri, 20 Dec 2019 10:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576866331; cv=none; d=google.com; s=arc-20160816; b=Q1elZIlWJt3YWmpMCQ3Izvrjacd0OzuPRH+p0VcEN1lJ0T7ULDb/kdd3UkQ6sApaEQ vqGYVSxrKTrkIwqA0LhVEdF5fY3IqqeEythbt3m2gT3CkyAFcSM9PS2fQe7Fkq4BkzGQ g+MM1SLziKMzkX2R+1GG5ilBO0oojJMMo6VFniN3M6RxXaSSxJ9+lLSn3i0+70oBisuI jX67rU4dXHp5+zwItWETLqhXcLrujTmGmdq54ciOMnpDRObkE6Tqp8ndmQJs2QhFiEyi QP0JyjvKpwxOtIB8k0dIKv5Xn5xwGvyVUdmctdhY4Vp6fJYo1S9CgXQv10YPZTeASBZu eEWw== 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:dkim-signature; bh=Su70azpqiUzym4+ORB2ehXEC+XGge58TLbE3wNLj9xE=; b=qqcqTzunTSJwArCgdSZnfWLnWDm0Hxn5D3dRRkvMWzabPuTCTUnNKYxbOVMGqBuhCy 6oMEqoT/uImQEf4uA7ZsAjdeUWu/XOer9qB34o/Wrf6UgM8nI0kW1gWVmDMkjohFbEA4 El2g+6jKCLX8Wov9vrRjqoLMMG1eviXTaLmWDDrFpCGV4d4os6ffCnCTbzOht0euQePk whwVKjd8IOAqHhYXmFud0c/cLu5FHmKIxqsf5WBL03ZXjLP820FQ9e4+is5n4vlHImV4 JKzll1/9Qmumf5BUA1UO/l2hZWYnF69OSLDuiK2Q11qXVIqk981dkUVn+r9rnwNcnXqH 2wDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=UQSAR4p4; 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 t15si1646087oth.160.2019.12.20.10.25.18; Fri, 20 Dec 2019 10:25:31 -0800 (PST) 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; dkim=pass header.i=@c-s.fr header.s=mail header.b=UQSAR4p4; 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 S1727425AbfLTSYZ (ORCPT + 99 others); Fri, 20 Dec 2019 13:24:25 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:22095 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727390AbfLTSYZ (ORCPT ); Fri, 20 Dec 2019 13:24:25 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47fcb93TxXz9vBmy; Fri, 20 Dec 2019 19:24:21 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=UQSAR4p4; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id G_xgQVgyxqbB; Fri, 20 Dec 2019 19:24:21 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47fcb929LGz9vBmw; Fri, 20 Dec 2019 19:24:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1576866261; bh=Su70azpqiUzym4+ORB2ehXEC+XGge58TLbE3wNLj9xE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=UQSAR4p4lj9J1aElN4XaeC8Kx1TiV3+fqtZN9BKoJ2Yy5ch6j7vTrDbySzVT8JBAI /Z5ayLabksz0vi+B534APGY/Ks6HTT+CyIjuGmTRBnLXjGstp2lQilEGIuQpRDqMbz fCAyiU3rdzQw5Q6q+E1FxMWa1j07voEda/3v0SIo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0B49F8B86D; Fri, 20 Dec 2019 19:24:23 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Txi8Jrl5ZLDO; Fri, 20 Dec 2019 19:24:22 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 633C38B867; Fri, 20 Dec 2019 19:24:22 +0100 (CET) Subject: Re: [RFC PATCH] powerpc/32: Switch VDSO to C implementation. To: Thomas Gleixner Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , vincenzo.frascino@arm.com, luto@kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <8ce3582f7f7da9ff0286ced857e5aa2e5ae6746e.1571662378.git.christophe.leroy@c-s.fr> <95bd2367-8edc-29db-faa3-7729661e05f2@c-s.fr> <439bce37-9c2c-2afe-9c9e-2f500472f9f8@c-s.fr> From: Christophe Leroy Message-ID: <207cef10-3da8-6a52-139c-0620b21b64af@c-s.fr> Date: Fri, 20 Dec 2019 19:24:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, In do_hres(), I see: cycles = __arch_get_hw_counter(vd->clock_mode); ns = vdso_ts->nsec; last = vd->cycle_last; if (unlikely((s64)cycles < 0)) return -1; __arch_get_hw_counter() returns a u64 values. On the PPC, this is read from the timebase which is a 64 bits counter. Why returning -1 if (s64)cycles < 0 ? Does it means we have to mask out the most significant bit when reading the HW counter ? Christophe