Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C570C54E58 for ; Tue, 12 Mar 2024 16:06:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.691946.1078590 (Exim 4.92) (envelope-from ) id 1rk4db-0001Kn-2K; Tue, 12 Mar 2024 16:05:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 691946.1078590; Tue, 12 Mar 2024 16:05:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rk4da-0001Kg-VU; Tue, 12 Mar 2024 16:05:58 +0000 Received: by outflank-mailman (input) for mailman id 691946; Tue, 12 Mar 2024 16:05:57 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rk4dZ-0001KZ-FB for xen-devel@lists.xenproject.org; Tue, 12 Mar 2024 16:05:57 +0000 Received: from 17.mo583.mail-out.ovh.net (17.mo583.mail-out.ovh.net [46.105.56.132]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 68c5d833-e08a-11ee-afdd-a90da7624cb6; Tue, 12 Mar 2024 17:05:56 +0100 (CET) Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.139.11]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 4TvJQr0mMdz1FNt for ; Tue, 12 Mar 2024 16:05:56 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-ktqmh (unknown [10.111.182.20]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 24BA81FEA1; Tue, 12 Mar 2024 16:05:54 +0000 (UTC) Received: from 3mdeb.com ([37.59.142.108]) by ghost-submission-6684bf9d7b-ktqmh with ESMTPSA id l/0fNGJ98GX/+AEASnncPg (envelope-from ); Tue, 12 Mar 2024 16:05:54 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 68c5d833-e08a-11ee-afdd-a90da7624cb6 Authentication-Results:garm.ovh; auth=pass (GARM-108S0025fe8f4cf-b773-4400-aff0-01b1bbbd189c, 0B6B113C544506A41C6EB031E0F94F2E66B6AEBC) smtp.auth=krystian.hebel@3mdeb.com X-OVh-ClientIp:217.171.61.25 Message-ID: <173cc1f7-d906-47ed-bba3-d43da219fd7b@3mdeb.com> Date: Tue, 12 Mar 2024 17:05:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [XEN PATCH 6/9] x86/shutdown: protect against recurrent machine_restart() Content-Language: en-US To: Jan Beulich Cc: Andrew Cooper , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , xen-devel@lists.xenproject.org, Wei Liu References: <87b0e650f28038c2fb64c5eb607c8fdaa7b4db07.1699982111.git.krystian.hebel@3mdeb.com> <665c7f47-a218-4187-858d-562bb5b9513b@suse.com> From: Krystian Hebel In-Reply-To: <665c7f47-a218-4187-858d-562bb5b9513b@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 9035346755143379312 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrjeefgdekgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepmfhrhihsthhirghnucfjvggsvghluceokhhrhihsthhirghnrdhhvggsvghlseefmhguvggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejuedvffefvdeuvdeffeduuddtjeetgeefffdugfdvkeehtedutefghfdtteejieenucffohhmrghinhepfehmuggvsgdrtghomhenucfkphepuddvjedrtddrtddruddpvddujedrudejuddriedurddvhedpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepkhhrhihsthhirghnrdhhvggsvghlseefmhguvggsrdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtohepgigvnhdquggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth On 8.02.2024 12:30, Jan Beulich wrote: > On 14.11.2023 18:50, Krystian Hebel wrote: >> If multiple CPUs called machine_restart() before actual restart took >> place, but after boot CPU declared itself not online, > Can you help me please in identifying where this operation is? I can see > two places where a CPU is removed from cpu_online_map, yet neither > __stop_this_cpu() nor __cpu_disable() ought to be coming into play here. > In fact I didn't think CPU0 was ever marked not-online. Except perhaps > if we came through machine_crash_shutdown() -> nmi_shootdown_cpus(), but > I'm sure you would have mentioned such a further dependency. > > Jan BUG_ON() in cpu_notifier_call_chain() (I've been playing with some of the notifiers and one of them eventually failed) resulted in panic() around the same time AP did in pm_idle() due to inconsistent settings between BSP and AP for MWAIT/MONITOR support after TXT dynamic launch. There is 5s delay between smp_send_stop() and actual reboot, during that time AP spammed the output so the original reason for panic() was visible only after unreasonable amount of scrolling. Adding TXT support is the reason why I even started making AP bring-up parallel. Problem with MWAIT doesn't happen in current code or changes in this patchset, but handling of such error is related to SMP so I've included it. Best regards, -- Krystian Hebel Firmware Engineer https://3mdeb.com | @3mdeb_com