lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3hJ+Xt2xfTg=bkDBfahk7Z-3+Unt1MqmMQrRnCeJhVtg@mail.gmail.com>
Date:   Wed, 17 Oct 2018 17:24:36 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Guo Ren <ren_guo@...ky.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        David Miller <davem@...emloft.net>,
        gregkh <gregkh@...uxfoundation.org>,
        Christoph Hellwig <hch@...radead.org>,
        Marc Zyngier <marc.zyngier@....com>,
        Mark Rutland <mark.rutland@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Rob Herring <robh@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arch <linux-arch@...r.kernel.org>,
        DTML <devicetree@...r.kernel.org>,
        Rob Herring <robh+dt@...nel.org>, c-sky_gcc_upstream@...ky.com,
        linfei_chen@...ky.com, Mao Han <han_mao@...ky.com>
Subject: Re: [PATCH V9 13/21] csky: Library functions

On Tue, Oct 16, 2018 at 5:02 AM Guo Ren <ren_guo@...ky.com> wrote:

> +++ b/arch/csky/lib/delay.c
> @@ -0,0 +1,39 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/delay.h>
> +
> +void __delay(unsigned long loops)
> +{
> +       asm volatile (
> +               "mov r0, r0\n"
> +               "1:declt %0\n"
> +               "bf     1b"
> +               : "=r"(loops)
> +               : "0"(loops));
> +}
> +EXPORT_SYMBOL(__delay);
> +
> +void __const_udelay(unsigned long xloops)
> +{
> +       unsigned long long loops;
> +
> +       loops = (unsigned long long)xloops * loops_per_jiffy * HZ;
> +
> +       __delay(loops >> 32);
> +}
> +EXPORT_SYMBOL(__const_udelay);

I can't find any indication we discussed this part before. Can you
explain (in the
changelog and in a reply) if there is a reliable high-resolution clocksource
available in the architecture? If you can read the elapsed time here instead of
using the loops_per_jiffy estimate, that would make this more robust, as
well as speed up the boot.

If you can't do that in general, that's fine, and you can add my
Reviewed-by: Arnd Bergmann <arnd@...db.de>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ