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: <20101107204153.GA17592@basil.fritz.box>
Date:	Sun, 7 Nov 2010 21:41:53 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	John Stultz <johnstul@...ibm.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Clark Williams <williams@...hat.com>,
	Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH] Greatly improve TSC calibration using a delayed
 workqueue

Hi John,

> +	/*
> +	 * Since the timer is started early in boot, we may be
> +	 * delayed the first time we expire. So set the timer
> +	 * again once we know timers are working.
> +	 */
> +	if (tsc_start == -1) {
> +		/*
> +		 * Only set hpet once, to avoid mixing hardware
> +		 * if the hpet becomes enabled later.
> +		 */
> +		hpet = is_hpet_enabled();
> +		schedule_delayed_work(&tsc_irqwork, HZ);
> +		tsc_start = tsc_read_refs(&ref_start, hpet);
> +		return;
> +	}
> +
> +	tsc_stop = tsc_read_refs(&ref_stop, hpet);

The HPET init code stops, starts the HPET. I think you need some
way to protect against that here, e.g. a variable and rearming the 
timer if it's true.

Another issue may be races against suspend, but that may be too
obscure.

I also worry a bit about NMIs etc. running later during this
and messing up the measurement, but I guess the longer period
makes up for it.

The rest of the patch looks ok to me.

-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ