Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp473346lqb; Wed, 29 May 2024 00:51:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV54lD77M/PhvGPlmUIKzezhye2X8bnQ8gu5OkEXyMpsrGitMCIa2ee+6iXCAXSVVppyI2+WZz4ftgQKFriRBvJFVHX0ekwJgX9y1n71A== X-Google-Smtp-Source: AGHT+IEHmRfTrwaI9jW4LeZ7WK5Ukl5Esv5Z1A6xBLvt8qW8N8ibEy+TEsQN8MKRCc2l8bPX2CKs X-Received: by 2002:a17:90a:c68a:b0:2bd:fcfa:6165 with SMTP id 98e67ed59e1d1-2bf5e18b219mr11635118a91.19.1716969064815; Wed, 29 May 2024 00:51:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716969064; cv=pass; d=google.com; s=arc-20160816; b=FudDqru5b1QFrmvdGu+JsssKVEw+CaU/zi4Wgjh+S8UUaez62H3JojSQF93/4Gk3aY eaE+BrcvhTw+Dm4oDj+uTFynb2IPuIXFXWfWraV8VAK2+6Nk1NesscCpLLxj4eU4VjWb Sx9ZN/nH6p3x/NMmxEZ2y86/uIAbQ9DRtSbz/TAOFtIhxZaEtTu7zHaRMrgbXiRjxUeP bwaKx8n/fgawWKkKOAUd5IKmIrYHFGQ3ovHvRGHDOppHnGf84s3fBWtdJYX2ZK2w0IEC qwiYcUWY5KlDkDDHxrDLrrevyXgJeGRC6/TMZYcaMbyejx6xbSeZt334Hxh+qs98zq6o q5dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=GbBWiLYIihe5kRoqFun+3uFh9apRMozX/dNd6f8NMMU=; fh=xI4zRO7QKw2cxl9qIUAxQj953J9ZfG+knUn66R89ZNg=; b=iXy9HusY1qlYakzgkbUyPAP/ivWWN8oiz8WwjlT4tilg7je/JAy5NDMYXcmKKngjS7 0rlcxObkKOa4rI4AL0URlvoWX/EFk9nOczL8V9ByBYWVQNJe/aAy7dn3sBAkuqh0+LHD wJa3jVghQvWSSojay/2NSzuk8Drfp6EkpMpsRIn1y2NPlVOa1qdCKSc6p+BjjXBw8N72 2dqhZWYeLtTvxgKb17mTULsLAtvm1ODevkSnOTNkqbkzSIWWC5WrUIPwjY1iTislojPP feVPV8OMzUhagw5c0qqN6kFNARgxsCNV8qf/81xKQxzGKdOHpmkWFOjW+WHCyWDZoHNi tSOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QuKNrxUu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-193614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdd9ed2cbcsi11598392a91.14.2024.05.29.00.51.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 00:51:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QuKNrxUu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-193614-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193614-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 99DA4B279DD for ; Wed, 29 May 2024 07:43:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B9BF168C3C; Wed, 29 May 2024 07:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QuKNrxUu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZD7NnbKW" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE379168C08; Wed, 29 May 2024 07:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716968567; cv=none; b=iKmJen3xWk8ELe1zXWgvHSgGxRkKZCj8PLWgYGZB8kCk5ptYq9NwEIUA61Yp8MwE74EPyS5ytP48bumXz7igrozxYPiI55DFPNyIxl9Yln4VE3CVTIoRG+bmHxL+CuyiEamXI8BAEaH6QQa4kcG6nsZNGq96kJNC7BmOg8JS9Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716968567; c=relaxed/simple; bh=ulWHMbKruyWR5uPQUxmckqv2wx9fqc+HKd1746aF3jQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hWKfJsOEAbxVym59N+RdJcc8VaFPZK4R5MS9cwrBOUoWiNQSHFJ1CDmGlbRkNdUwDQ1eCU5F4p/s1FmrZFb5JrGguctKtb4IyNK1NjvJZwRy1qVmwgkLx9YgbuBrHpW2E//qa5pm4M41X5dBQT+VJ+/Vbv3x/Ctf3xnsUUYY58k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QuKNrxUu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZD7NnbKW; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716968563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GbBWiLYIihe5kRoqFun+3uFh9apRMozX/dNd6f8NMMU=; b=QuKNrxUuepGmOZ2niwSVrSYItCMUdCenMqs/1mSyWFN1dm/uTyCzfTF2uCB3BhV4aBUW11 rn14dvy4nOHiT17kd4P0RJDfv5iLaVDU1HroT4UCbgjZObLkXfHTeRIDKVcKKVvcT8liHB ofPZ6CVsjRHbNV0ilJUzyaoheYKosc297ALX7KtwyVXRLOuarsAocjuS9INQ839vWqFY0c bO08YJ/FnFx1WjGmf9LLBSxpTYY6S2Km/VvUgD3kTBG9y1mvoyn3ajTwCl6hn9WEypNJ2E py89RJCGsAvJVh+9M6l1jcXRT1M26SGq5Y1DKy7O83petB93WxMMrmL/YXAPSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716968563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GbBWiLYIihe5kRoqFun+3uFh9apRMozX/dNd6f8NMMU=; b=ZD7NnbKWri5Vxr5kPEurTWpN4jJfKvL9gpsP5J4mNIXdO5gQPwgNCi73wofqupUXeHNQQL CLKpJhHVA5ix6IDg== To: Linus Torvalds Cc: Dave Hansen , Tony W Wang-oc , 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, CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LeoLiu-oc@zhaoxin.com Subject: Re: [PATCH] x86/hpet: Read HPET directly if panic in progress In-Reply-To: References: <20240528063836.5248-1-TonyWWang-oc@zhaoxin.com> <50fc1bd3-909e-41c4-a991-9d81e32ef92c@intel.com> <87wmnda8mc.ffs@tglx> Date: Wed, 29 May 2024 09:42:43 +0200 Message-ID: <87le3t9i8c.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Linus! On Tue, May 28 2024 at 16:22, Linus Torvalds wrote: > On Tue, 28 May 2024 at 15:12, Thomas Gleixner wrote: > I see the smiley, but yeah, I don't think we really care about it. Indeed. But the same problem exists on other architectures as well. drivers/clocksource alone has 4 examples aside of i8253 >> 1) Should we provide a panic mode read callback for clocksources which >> are affected by this? > > The current patch under discussion may be ugly, but looks workable. > Local ugliness isn't necessarily a show-stopper. > > So if the HPET is the *only* case which has this situation, I vote for > just doing the ugly thing. > > Now, if *other* cases exist, and can't be worked around in similar > ways, then that argues for a more "proper" fix. > > And no, I don't think i8253 is a strong enough argument. I don't > actually believe you can realistically find a machine that doesn't > have HPET or the TSC and really falls back on the i8253 any more. And > if you *do* find hw like that, is it SMP-capable? And can you find > somebody who cares? Probably not. >> 2) Is it correct to claim that a MCE which hits user space and ends up in >> mce_panic() is still just a regular exception or should we upgrade to >> NMI class context when we enter mce_panic() or even go as far to >> upgrade to NMI class context for any panic() invocation? > > I do think that an NMI in user space should be considered mostly just > a normal exception. From a kernel perspective, the NMI'ness just > doesn't matter. That's correct. I don't want to change that at all especially not for recoverable MCEs. > That said, I find your suggestion of making 'panic()' just basically > act as an NMI context intriguing. And cleaner than the > atomic_read(&panic_cpu) thing. > > Are there any other situations than this odd HPET thing where that > would change semantics? I need to go and stare at this some more. Thanks, tglx