Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8442526ybl; Thu, 16 Jan 2020 17:00:00 -0800 (PST) X-Google-Smtp-Source: APXvYqxpeXJFY2WsXf3UIFRboka6cSELzNu0FxL//kHKM1zFlbKePE4BJhen9oaTWW/NFsKDXwYS X-Received: by 2002:aca:ed81:: with SMTP id l123mr1585276oih.129.1579222800604; Thu, 16 Jan 2020 17:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579222800; cv=none; d=google.com; s=arc-20160816; b=wRVmxQVVLqBMuv9F60mZyRwM8mjm54ZhaMyfycrYsb7hmr5tyPFq2mCHxD/Z8uoniB dYDvdqv/hqt4J9Y3bNKca1WJ8t+GnanwN7Mj2uohLTF01tD9xZiMx5cw4JoGtAxoOQ1s 1lxtVqNwzTBYy9fPOATXZRUG7tCT17j2/1iqBMIcDeAbWCkq1nBhcoMBhGFhA9MjvKa5 w2oSxPld8NkZ2ppcOShpkZHgRLWClpgPBm7q7FqcIaYP2BPfUma3SjGkpMcvX9pextMD 2tNXRzFOznPqLpYLtTe4YYYf1ObI0litCDMDSBKzVwEyJ3PQti55gabWLdOabRPqriwz AK3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=x/vfLW3q/MkZxvyJSoTHWIBEKbtoywVPFeGmD8Iy8dc=; b=l01lIXMfa/eI+JO9WEe61DyRMFFyNs/Mf11UJo+kwGUhkTZ3MtJb92ADvgWcqAUe09 4MT2ayWG1rOasYw3YI2SoHbhxmr71LpfZFkyum8qnX3QbPfgRfPwnMu4bwWPUC57eHYv GUE5YDpRNhe+xGTu3aUhrROuFTR6qGMvFRZXKCHLP/HFLA/gMI0dh+LiZ414b6iSxiiY ZXuJ2WyBGvhRtTENe1HRSdXB6uzs6FU7WJ47yKgYq9dHij/Lhw16Ei2mcwKzewUESl9J EQjQbClYwD746CShYPh9UUmoP1YLk+JuSCrOieQYDeSIHqlssXrX9JDFQlSWsFJZ7q3v qsVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JwJh0aad; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w81si12665126oig.107.2020.01.16.16.59.48; Thu, 16 Jan 2020 17:00:00 -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=@kernel.org header.s=default header.b=JwJh0aad; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387642AbgAPUVN (ORCPT + 99 others); Thu, 16 Jan 2020 15:21:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:39338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgAPUVN (ORCPT ); Thu, 16 Jan 2020 15:21:13 -0500 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B58EA2082F for ; Thu, 16 Jan 2020 20:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579206073; bh=OJ3J83vIabY7xpZcvf2DhJwhjwaTMS+skFpIApuBtEg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JwJh0aadu+1koOsCzuKbeJgCqbsIVa6wXIh8eamq0w+FvzAqXxq1gzv8bKewX5JJr 0LAd9SvjVMiaRKM5KNjw31n84OCJ2j4cgsYpXVB0SkUt2m3i7hsGJGrA4rHRu2s8jX GTY3J7+SCPPk/KJcvWhkGBpCaGlX6oQ/4joEhUUo= Received: by mail-wr1-f44.google.com with SMTP id d16so20506123wre.10 for ; Thu, 16 Jan 2020 12:21:12 -0800 (PST) X-Gm-Message-State: APjAAAWCP7BiP1MwRFUdcd4rHYMhSWc2TdBmAqr1dwkzABUzJDXsOieU 1JI1iU0b5/IcmpYVAvkzk27jA3H37AiM6x0UaDqJ9w== X-Received: by 2002:adf:8041:: with SMTP id 59mr4939370wrk.257.1579206071239; Thu, 16 Jan 2020 12:21:11 -0800 (PST) MIME-Version: 1.0 References: <877e1rfa40.fsf@nanos.tec.linutronix.de> In-Reply-To: <877e1rfa40.fsf@nanos.tec.linutronix.de> From: Andy Lutomirski Date: Thu, 16 Jan 2020 12:20:59 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v4 10/11] lib: vdso: Allow arches to override the ns shift operation To: Thomas Gleixner Cc: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , nathanl@linux.ibm.com, Arnd Bergmann , Vincenzo Frascino , Andrew Lutomirski , LKML , linuxppc-dev , linux-arm-kernel , "open list:MIPS" , X86 ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 11:57 AM Thomas Gleixner wrote: > > Andy Lutomirski writes: > > On Thu, Jan 16, 2020 at 9:58 AM Christophe Leroy > > > > Would mul_u64_u64_shr() be a good alternative? Could we adjust it to > > assume the shift is less than 32? That function exists to benefit > > 32-bit arches. > > We'd want mul_u64_u32_shr() for this. The rules for mult and shift are: > That's what I meant to type... > 1 <= mult <= U32_MAX > > 1 <= shift <= 32 > > If we want to enforce a shift < 32 we need to limit that conditionally > in the calculation/registration function. > > Thanks, > > tglx >