From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 541FDC433DF for ; Wed, 15 Jul 2020 15:41:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 206D720663 for ; Wed, 15 Jul 2020 15:41:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SK8/CmV8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="js8lpNnl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 206D720663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8StshD/McMW3qz63DWX33Eynl8ZI5oxRfzvGKwdy5A0=; b=SK8/CmV8JOHFPNzW0TW3fMj2V sHTBSdR0glj6nI3TPzYq0XoAIpK3uQEZGhYnqdsa1IH155O6np7RdZKM1qjD8yeGK2rlQMxizRg/7 KeY31KyG+cMUnGfyA0c6ot0tSqY2VmcP1+p2yC9kSEg3M4QZ2vtfRBxmA8Zoe7bUnvWSejmIRLK9d mEUSJaRVJdafKH8DyOxqrp6W80jsu9HjZ9B8i0xBHlMSBddaLcvZ3/gcIkDc+mHkXIG+juJvhOVwa bgE9wZc/wY9FSxFaZbdfkr6oEgm5kjIScTgijUwwSSP01uKm0pJS6c2c7pgsXQzuP5aC/heY0+44H 5Xl31AtdQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvjVy-0005Tg-53; Wed, 15 Jul 2020 15:40:10 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvjVv-0005Se-Mw for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2020 15:40:08 +0000 Received: by mail-pf1-x444.google.com with SMTP id z3so2246474pfn.12 for ; Wed, 15 Jul 2020 08:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jQe4iE2lEc8KbaoXcjCkGmCXRZkns9DplK1eRb6FSaA=; b=js8lpNnl+5nO5894nRPVPli8gj7zwFSYMGTbKYzwwRzRwRR6RhGtsAv44ZFYoFdvhg ucdpTndZA4z0g/UA/cq/TfS0UQqyUNWVgz9H9w3oenT8YTUK1Lk5VHT678VJBPUp9ddn k1H57IMdMtO2aHdrASaJLGWhbIG/eOAjCJtAjaeeLM4VJPoK2Oh+w2ZVsMft8hM+j5V9 rOikWy4kn1V6pssmTyYFSRNqrBdISRStPY85fPPbFDlJOzQUEF6dDQuYb4YHY2p/N12g rtwdvmu7yxcCxM2qd9kt3AdX6j4jsp4al16GFera2iO+m8jJdsUolOZ7Cw3Wr/5UkuZY fcCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jQe4iE2lEc8KbaoXcjCkGmCXRZkns9DplK1eRb6FSaA=; b=OGcaKUixu6eG64O+AfGCFr5EwHEHPVsVzSufX2eGQ1T2ervyaQm+ZGca/yZ0IrGGF3 zZcet+EuyufZ8oNi5Jm9mZdfT0bjgmGDsxAvuv4uNjnoahuCAe13d7NQqKBIwlFbW+D8 UoSzwGgC6cwokSBsAy37wrZ+5aAW3Qdw6y4gf2FJ7PzPVf+vT65SFwoKA+qbnQqPFHF+ r6vXCpCkFzRhwUcXk9YWFmxK10SNimyTJPEYifXkB3cOtTrYS2jgX53O/BinKuEvjkmJ wFZhvHoEIVFI6yPTSJS8muGHzsZ5feb2IeH/lqc7RUU8V86XhT2qZAor2SRownFWD0iS cYRw== X-Gm-Message-State: AOAM531oiWfTOLwTShLUwnT2pQ0ll+QS7wnWH77gG9tuCBV7crHLQc1H 1FH5rPvF+ulkMa0iHbcNrhycgA== X-Google-Smtp-Source: ABdhPJwh3QJDYfjYI9PLfUXPUsptAlEnjHLf87evFd3jK1SkvSxwb05NBa0xwKxaAgKooeETzkqq6g== X-Received: by 2002:a63:d44e:: with SMTP id i14mr283502pgj.280.1594827604920; Wed, 15 Jul 2020 08:40:04 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([2600:3c01::f03c:91ff:fe8a:bb03]) by smtp.gmail.com with ESMTPSA id m16sm2565384pfd.101.2020.07.15.08.39.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Jul 2020 08:40:04 -0700 (PDT) Date: Wed, 15 Jul 2020 23:39:58 +0800 From: Leo Yan To: Peter Zijlstra Subject: Re: [PATCH v2 2/6] arm64: perf: Implement correct cap_user_time Message-ID: <20200715153958.GB16686@leoy-ThinkPad-X240s> References: <20200715020512.20991-1-leo.yan@linaro.org> <20200715020512.20991-3-leo.yan@linaro.org> <20200715083800.GC10769@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200715083800.GC10769@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200715_114007_780835_FF69F7CB X-CRM114-Status: GOOD ( 12.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alexander Shishkin , Will Deacon , "Ahmed S. Darwish" , Adrian Hunter , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Paul Cercueil , Ingo Molnar , Catalin Marinas , Namhyung Kim , Thomas Gleixner , Jiri Olsa , "Ben Dooks \(Codethink\)" , linux-arm-kernel@lists.infradead.org, Kan Liang Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Peter, On Wed, Jul 15, 2020 at 10:38:00AM +0200, Peter Zijlstra wrote: > On Wed, Jul 15, 2020 at 10:05:08AM +0800, Leo Yan wrote: > > > [leoyan: Use quot/rem to convert cyc to ns to avoid overflow] > > > + quot = rd->epoch_cyc >> rd->shift; > > + rem = rd->epoch_cyc & (((u64)1 << rd->shift) - 1); > > + ns = quot * rd->mult + ((rem * rd->mult) >> rd->shift); > > + userpg->time_zero -= ns; > > I think we have mul_u64_u32_shr() for that. Will fix it in next spin. Thanks for suggestion, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel