From: Dave Hansen <dave.hansen@intel.com>
To: Tony W Wang-oc <TonyWWang-oc@zhaoxin.com>,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com,
mat.jonczyk@o2.pl, rdunlap@infradead.org,
alexandre.belloni@bootlin.com, mario.limonciello@amd.com,
yaolu@kylinos.cn, bhelgaas@google.com, justinstitt@google.com,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Cc: CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LeoLiu-oc@zhaoxin.com
Subject: Re: [PATCH] x86/hpet: Read HPET directly if panic in progress
Date: Tue, 28 May 2024 07:18:54 -0700 [thread overview]
Message-ID: <50fc1bd3-909e-41c4-a991-9d81e32ef92c@intel.com> (raw)
In-Reply-To: <20240528063836.5248-1-TonyWWang-oc@zhaoxin.com>
On 5/27/24 23:38, Tony W Wang-oc wrote:
...> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
> index c96ae8fee95e..ecadd0698d6a 100644
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -804,6 +804,12 @@ static u64 read_hpet(struct clocksource *cs)
> if (in_nmi())
> return (u64)hpet_readl(HPET_COUNTER);
>
> + /*
> + * Read HPET directly if panic in progress.
> + */
> + if (unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID))
> + return (u64)hpet_readl(HPET_COUNTER);
> +
There is literally one other piece of the code in the kernel doing
something similar: the printk() implementation. There's no other
clocksource or timekeeping code that does this on any architecture.
Why doesn't this problem apply to any other clock sources?
Why should the problem be fixed in the clock sources themselves? Why
doesn't printk() deadlock on systems using the HPET?
In other words, I think we should fix pstore to be more like printk
rather than hacking around this in each clock source.
next prev parent reply other threads:[~2024-05-28 14:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 6:38 [PATCH] x86/hpet: Read HPET directly if panic in progress Tony W Wang-oc
2024-05-28 14:18 ` Dave Hansen [this message]
2024-05-28 22:12 ` Thomas Gleixner
2024-05-28 23:22 ` Linus Torvalds
2024-05-29 7:42 ` Thomas Gleixner
2024-06-05 6:23 ` Tony W Wang-oc
2024-06-05 9:36 ` Borislav Petkov
2024-06-05 10:10 ` Tony W Wang-oc
2024-06-05 11:33 ` Borislav Petkov
2024-06-05 12:02 ` Tony W Wang-oc
2024-06-05 15:51 ` Luck, Tony
2024-06-06 8:44 ` Tony W Wang-oc
2024-06-06 17:00 ` Luck, Tony
2024-05-29 4:39 ` Tony W Wang-oc
2024-05-29 6:44 ` Tony W Wang-oc
2024-05-29 7:45 ` Thomas Gleixner
2024-05-29 8:15 ` Tony W Wang-oc
2024-05-29 7:44 ` Thomas Gleixner
2024-07-01 11:09 ` Tony W Wang-oc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50fc1bd3-909e-41c4-a991-9d81e32ef92c@intel.com \
--to=dave.hansen@intel.com \
--cc=CobeChen@zhaoxin.com \
--cc=LeoLiu-oc@zhaoxin.com \
--cc=TimGuo@zhaoxin.com \
--cc=TonyWWang-oc@zhaoxin.com \
--cc=alexandre.belloni@bootlin.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=gpiccoli@igalia.com \
--cc=hpa@zytor.com \
--cc=justinstitt@google.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mat.jonczyk@o2.pl \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yaolu@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox