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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0FCC3C33CAF for ; Thu, 16 Jan 2020 20:21:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C88EE206D7 for ; Thu, 16 Jan 2020 20:21:13 +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:List-ID:From; b=jpsbxKBk5aUgmDG6ZXclFRuVeO2GWf7MvIC2x+XEZ8lCUht3kMXj/nN8sUDmOJS/a PnYLdsXQitMND9eqFHvJoTRBm1xWnnl+x8+mXuhPNuf7EGn+/B7WKgftFgNNmWTSOu 3yfYbPDnu6GK8OmMzwp1zlnluB7ULmTH3LG6rY6A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387470AbgAPUVN (ORCPT ); Thu, 16 Jan 2020 15:21:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:39342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733229AbgAPUVN (ORCPT ); Thu, 16 Jan 2020 15:21:13 -0500 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 B76BA2176D 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-f41.google.com with SMTP id z3so20511439wru.3 for ; Thu, 16 Jan 2020 12:21:12 -0800 (PST) X-Gm-Message-State: APjAAAVNOvjUBRdMlaW/5UijpsnBx0n5YjLwIGeAGdrFXWCg/rciamag 5ZvSrpIyqJD7jGENi1Cu4XlKGgFiPavfGdJ1xfG7ow== X-Google-Smtp-Source: APXvYqyJFUWBWMkFpVuosDSd8/lQDbzy6zF5xwHRHcZ1pdoSXL/YmNp4uOFO1NJDoLptUYmOV9mv1qxrQ7fzMgsykOE= 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 >