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: <87frruuct2.ffs@tglx>
Date: Sat, 27 Jul 2024 16:31:05 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: ysionneau@...rayinc.com, linux-kernel@...r.kernel.org
Cc: Jonathan Borne <jborne@...rayinc.com>, Julian Vetter
 <jvetter@...rayinc.com>, Yann Sionneau <ysionneau@...rayinc.com>, Alex
 Michon <amichon@...rayinc.com>, Clement Leger <clement@...ment-leger.fr>,
 Guillaume Missonnier <gmissonnier@...rayinc.com>, Guillaume Thouvenin
 <thouveng@...il.com>, Jules Maselbas <jmaselbas@...v.net>, Julien Hascoet
 <jhascoet@...rayinc.com>, Julien Villette <julien.villette@...il.com>,
 Marc
 Poulhiès <dkm@...aplop.net>, Luc Michel <luc@...chel.fr>,
 Marius Gligor
 <mgligor@...rayinc.com>
Subject: Re: [RFC PATCH v3 17/37] kvx: Add boot and setup routines

On Mon, Jul 22 2024 at 11:41, ysionneau@...rayinc.com wrote:
> diff --git a/arch/kvx/kernel/time.c b/arch/kvx/kernel/time.c

Any reason why this is not in drivers/clocksource/ ?

> +static unsigned int kvx_timer_frequency;
> +static unsigned int kvx_periodic_timer_value;
> +static unsigned int kvx_timer_irq;
> +
> +static void kvx_timer_set_value(unsigned long value, unsigned long reload_value)
> +{
> +	kvx_sfr_set(T0R, reload_value);
> +	kvx_sfr_set(T0V, value);
> +	/* Enable timer */
> +	kvx_sfr_set_field(TCR, T0CE, 1);
> +}
> +
> +static int kvx_clkevent_set_next_event(unsigned long cycles,
> +				      struct clock_event_device *dev)
> +{
> +	/*
> +	 * Hardware does not support oneshot mode.
> +	 * In order to support it, set a really high reload value.
> +	 * Then, during the interrupt handler, disable the timer if
> +	 * in oneshot mode
> +	 */
> +	kvx_timer_set_value(cycles - 1, KVX_TIMER_MAX_VALUE);
> +
> +	return 0;
> +}
> +
> +static irqreturn_t kvx_timer_irq_handler(int irq, void *dev_id)
> +{
> +	struct clock_event_device *evt = this_cpu_ptr(&kvx_clockevent_device);
> +
> +	/* Disable timer if in oneshot mode before reloading */

The timer has already reloaded KVX_TIMER_MAX_VALUE, no?

> +
> +static int kvx_timer_dying_cpu(unsigned int cpu)
> +{
> +	disable_percpu_irq(kvx_timer_irq);

What disables the timer itself?

> +	return 0;
> +}

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ