Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8363846ybl; Thu, 16 Jan 2020 15:24:01 -0800 (PST) X-Google-Smtp-Source: APXvYqy6YW6xXwp0k6UDDrjOQ4iKiN0cQrVgq+UbSPLNAoja5OQqz2CGgWE/OoTS6BVy1cbSukX7 X-Received: by 2002:a54:4501:: with SMTP id l1mr1248107oil.101.1579217041300; Thu, 16 Jan 2020 15:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579217041; cv=none; d=google.com; s=arc-20160816; b=HBzkT/jJrC7QrWYiOhn+YSjo3kfcuq4memrnsbItdohIv6MQXeHQmeSbvHsWe4rEWk 0CD7jmLu6y0iAcEPiNDwcVTQ+Kpr6kT8ShIRA8Z9W440kmV98eyA4d0Sn0bnwSpPsYes 1/PIucV7s5cV3FuVvpvsvDV9MBDh1qLERPFRROex5YrrsaDnD76lvwb6Nhr17aSXwlk5 b2tcHLZo7idXbaRpkFH4jKEAJsHeP7DJ0CxOe/+3aYjCGt+Bm7/b8miUXb7/skBRBIsg iiPfbnBu3xeo/oFmk1WMu2B5QFfyLhi/cyYkYEt6zdK546bpijKa4fU5MeV/4kHMCts9 JrYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=Pfxz1UP4Wv4vm2h9no7MKaT8UUui2Yb1t9ZrRyXNYPs=; b=NXN1nwa5JqaLgfu3vyn34h16TogpANWA7tjhw7yAacIZ0HGb5Swek9qDukXVW++ivT bxmoWnEvDkTNr3TX/Zg5V/+xgOLwkv2ihnPNrqQpp/jYFIKYx8e7dmj9JL58d8KqT1ji wf4Qyep/9JtHuScY7wmKF4+nsZqkCkA5wcHl2H6xr3FNZO1B9anE//np+4k/CaWobTEo xOJ6fOYvsvoq7g5pSPDfYcQWJOTv/gcDcAEzKF7vq9UfylneUMExLE7njkf7HQPQw2aK OBItimxzaO9qQJY5Uq7J5p27BU9niUAj5xVZmMvjKK962eL6kyHxgB0I0JRjoegVHF6r bwbA== 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 t4si13571156otc.160.2020.01.16.15.23.48; Thu, 16 Jan 2020 15:24:01 -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; 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 S1732952AbgAPT5Y (ORCPT + 99 others); Thu, 16 Jan 2020 14:57:24 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53194 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbgAPT5X (ORCPT ); Thu, 16 Jan 2020 14:57:23 -0500 Received: from p5b06da22.dip0.t-ipconnect.de ([91.6.218.34] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1isBGJ-0000KB-UP; Thu, 16 Jan 2020 20:57:04 +0100 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id 6000B101226; Thu, 16 Jan 2020 20:57:03 +0100 (CET) From: Thomas Gleixner To: Andy Lutomirski , Christophe Leroy Cc: 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 Subject: Re: [RFC PATCH v4 10/11] lib: vdso: Allow arches to override the ns shift operation In-Reply-To: References: Date: Thu, 16 Jan 2020 20:57:03 +0100 Message-ID: <877e1rfa40.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 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