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: <20250317151446.GFZ9g8Zi3qmBwOTuz_@fat_crate.local>
Date: Mon, 17 Mar 2025 16:14:46 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Guilherme G. Piccoli" <gpiccoli@...lia.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, tglx@...utronix.de,
	mingo@...hat.com, dave.hansen@...ux.intel.com, hpa@...or.com,
	kernel@...ccoli.net, kernel-dev@...lia.com
Subject: Re: [PATCH] x86/tsc: Add debugfs entry to mark TSC as unstable after
 boot

On Mon, Mar 17, 2025 at 12:03:02PM -0300, Guilherme G. Piccoli wrote:
> We as in we, the Linux users. I can change to something like "Right now,
> TSC can be marked as unstable" - let me know your preference =)

Yes please.

Personal pronouns are ambiguous in text, especially with so many
parties/companies/etc developing the kernel so let's avoid them please.

> For example, my team and I debugged recently a problem with
> TSC+sched_clock: after TSC being marked as unstable by the watchdog,
> sched_clock continues to use it BUT the suspend/resume TSC routines stop
> being executed; for more details, please check [1]. But the thing is:
> during this debug we tried forcing TSC unstable, and did that by
> changing the command-line.
> 
> Problem: with that, tracing code sets its clock to global on boot time.
> We were suspicious that the issue was related to local trace clock, so
> we couldn't mark TSC unstable and let the trace code run with local
> clock as it would, if TSC was marked as unstable by the watchdog late on
> runtime.
> 
> That was one case (easily "workarounded" with trace_clock=), but in the
> end, I thought that would be way better to just have this switch on
> debugfs to be able to reproduce real-life TSC cases of instability,
> while system runs. Hope that explains better my reasoning for adding
> this debugs entry.

That sounds like a debugging session and we all change the kernel to do things
it doesn't normally do just for the purposes of debugging. It doesn't mean
that that should be exposed upstream.

> The same that happens if today someone marks it as unstable via
> command-line, right? You will see that on logs, and could simply reply
> that the user marked as unstable themselves, so..no bug at all!!
> 
> But let's think the other way around: what if some user marks TSC
> unstable via debugfs, later on runtime, and with that, unveils a real

I don't understand what you mean here.

> bug as [1] and then, we can then fix it? That would be a win heheh

No, marking the most important clocksource on x86 deliberately as unstable
better scream bloody hell in dmesg. But regardless, I'm not convinced this is
nearly as needed to have upstream. Just use it locally or cmdline.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ