From nobody Fri Oct 31 09:42:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1747900503; cv=none; d=zohomail.com; s=zohoarc; b=XtyA4xxZeZwCUp/7V41XBHo6d9/XlsmjRob/B7iJwmBjqxXqcn5gQy2SOu3J9g6SsKxK9tmfAZG+/gW2h8yPR1TBjMihi6FKI1Jt2n8V+YIOf49V3ep5mUBOi1BWzuTFX+d2x13VmSrql7FPnNkpUH/KnK9u3yNt05SyH+4g+8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747900503; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SNt/a796h8HJ1FyF4HukdZmnJKGKgEPfZABr2Qwwqsc=; b=IwK+VanrE4mus8rm4zQgDnTXIrW+23s7zQuviQ6ZFBrzdlYbHOUW1zuzHHQaUw21RUMfSk3rPe+fuL+cWHpyc5MAYUSAye4LTj9IzoWMZXxJPkm1hzqGSo9zWA5+VW2VtRkM4sAnBtNfOpLpxrStRtSRnbTRXTFOAWSDKvqQqCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174790050384715.153340792084578; Thu, 22 May 2025 00:55:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.993101.1376560 (Exim 4.92) (envelope-from ) id 1uI0lN-0006p6-JR; Thu, 22 May 2025 07:54:49 +0000 Received: by outflank-mailman (output) from mailman id 993101.1376560; Thu, 22 May 2025 07:54:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lN-0006ox-GO; Thu, 22 May 2025 07:54:49 +0000 Received: by outflank-mailman (input) for mailman id 993101; Thu, 22 May 2025 07:54:47 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lL-0006LU-M8 for xen-devel@lists.xenproject.org; Thu, 22 May 2025 07:54:47 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 061ae988-36e2-11f0-b892-0df219b8e170; Thu, 22 May 2025 09:54:44 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a3683d8314so4468953f8f.3 for ; Thu, 22 May 2025 00:54:44 -0700 (PDT) Received: from localhost (112.pool92-178-7.dynamic.orange.es. [92.178.7.112]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a35ca889d9sm22233672f8f.77.2025.05.22.00.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:54:43 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 061ae988-36e2-11f0-b892-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1747900483; x=1748505283; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SNt/a796h8HJ1FyF4HukdZmnJKGKgEPfZABr2Qwwqsc=; b=mMkuERbf3ofMtAH2Id4jK/MG79eK0JwlKdSGgqI7XiTu0fbqajjQyNdJOYBmEC/ew5 5WL5ZyL7q1LacO1SN1ASf+3b2ADEUaroL772sNopGc/ql1+73GYCjcf1BWaQTYVNMpR9 gq7OL+T1qG3lgay5SzM3V1PQ9qaFOXPTJYolM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900483; x=1748505283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SNt/a796h8HJ1FyF4HukdZmnJKGKgEPfZABr2Qwwqsc=; b=cXu2rJvD4u7G+k8/9PN+Apwzvapqi0ZUfQwOKhT5GiXsqxBF1QKJb4CJXROc/v9sGL MSRImIRO7umqwMRSFoLkAtuveJTTqg0TdqaPrUj+8H9+5jmZFwszizxvyRjuJHOq/B/u MJbNkfSWZQH4B+xOd5jO8ANVPnsJdTvVHPzMMJKVCU6rtLhTAgpHR+f4XCLc01zdRsOQ 4j80yOkuRjPS6jK5W7HRyGjYHRQGIPKCBbL5LvJbsZOfTmp9FxOAO5gYJZncOL8nYnek KHXZOPHtxR6A7t4I0koJfqm8g7sjleZIdZFk0VTQLx0wXtksfcJgB4cVje2IoE+Ab3N6 81Fw== X-Gm-Message-State: AOJu0YxgEBxXNpV+NCFOl37I0uXlV0uqdxGh0q7gWbvYfOLKwfkQctQx orBaaVhAiGpWnHM2kc3rzKvhmJo36SAV3YWyw5jGl/mZF8yVrEjE+BnYiQOI2If10KZCLitUys/ QmRQL X-Gm-Gg: ASbGncvm7q0hwWvI7qdgQ5E3AQXzXgawiWpArDOTpt2ubd3GhJ6m0tlXAoQh6bc0Nha QmgVjFx3BvFpUh4n/y4kdMRmrP4alR/lm5ddhWrEI8CQ0qkhJBL4a+sVb+DymyrKN/AHOeHhaJ0 f/77mYpzFkw+IWXbHEahYjZ56st81yE3cftUVuC7zVhPOYjQdXKaVOGIImuAz7/e2OmBb568l+l HJJlXKv5Qxsasz2rGmFOE+9nDs+y9C78V+y+o+M5lA6QmK3JH/wnGy7jisVdXwhxN9gjFcfAEGt phGLRxIUTiKye3WxhWELun2CVpT8FzwfyauyTce08/BypzNh/IF3pjuHvJb5EU1Mm17HUeeWZlY cz0TOF3g7P7GGK44l0tJGrXy7XAmRAg== X-Google-Smtp-Source: AGHT+IGw5ZUYXHmwfwWoYLLq3/50OjJvJxw5n7JcSFRYTWRVB29lNAxDM4fup1ovD+xAR/gqZwDlzw== X-Received: by 2002:a05:6000:c0b:b0:3a3:5c64:c60 with SMTP id ffacd0b85a97d-3a35c84beacmr15062310f8f.59.1747900483409; Thu, 22 May 2025 00:54:43 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 1/4] x86/boot: print CPU and APIC ID in bring up failure Date: Thu, 22 May 2025 09:54:37 +0200 Message-ID: <20250522075440.99882-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522075440.99882-1-roger.pau@citrix.com> References: <20250522075440.99882-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1747900505093116600 Print the CPU and APIC ID that fails to respond to the init sequence, or that didn't manage to reach the "callin" state. Expand a bit the printed error messages. Otherwise the "Not responding." message is not easy to understand by users. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 --- Changes since v1: - Also print APIC ID. --- xen/arch/x86/smpboot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 0189d6c332a4..dbc2f2f1d411 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -618,10 +618,12 @@ static int do_boot_cpu(int apicid, int cpu) smp_mb(); if ( bootsym(trampoline_cpu_started) =3D=3D 0xA5 ) /* trampoline started but...? */ - printk("Stuck ??\n"); + printk("CPU%u/APICID%u: Didn't finish startup sequence\n", + cpu, apicid); else /* trampoline code not run */ - printk("Not responding.\n"); + printk("CPU%u/APICID%u: Not responding to startup\n", + cpu, apicid); } } =20 --=20 2.49.0 From nobody Fri Oct 31 09:42:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1747900500; cv=none; d=zohomail.com; s=zohoarc; b=U9bsnQ/sPvbPKd/kwIW3poDaUhPm4oACMtoJgef0whHALOEZA24YybJAncjLtMTQksOmzJRcgh6Epv8ttezvCPP57qfmK70DXZPnUDUDMu19NSsYBhA3rD6zfLBJIx7RGyqWOkmO3w16XWBFaZjVfai1ubTwiGJ8jKM9YTTOZx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747900500; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tt93X8/M//cm6RVXeEKC2o6v986fsxbCRkDTkmxvdfg=; b=IPFl7haYYA+DZv1wRBoCBLAMi689IcL67m0OE4aYwU6QY1RqQ9i0cDsWfvCJA2jcHB21Iy/hfRrKlItukIIb375Yhg1CvEfsbf8SnYdPfh7OwWdQALwSNFN2QLicrC5XYtNL1xcocPSxfvHrHydb1Ni5e+CGyRM8h+ArBrCSpiI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747900500910878.5421105514932; Thu, 22 May 2025 00:55:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.993099.1376545 (Exim 4.92) (envelope-from ) id 1uI0lL-0006OF-8e; Thu, 22 May 2025 07:54:47 +0000 Received: by outflank-mailman (output) from mailman id 993099.1376545; Thu, 22 May 2025 07:54:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lL-0006Ng-3U; Thu, 22 May 2025 07:54:47 +0000 Received: by outflank-mailman (input) for mailman id 993099; Thu, 22 May 2025 07:54:46 +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 1uI0lK-0006JE-31 for xen-devel@lists.xenproject.org; Thu, 22 May 2025 07:54:46 +0000 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [2a00:1450:4864:20::32e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 06c72dd9-36e2-11f0-a2fb-13f23c93f187; Thu, 22 May 2025 09:54:45 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-442f5b3c710so63606005e9.1 for ; Thu, 22 May 2025 00:54:45 -0700 (PDT) Received: from localhost (112.pool92-178-7.dynamic.orange.es. [92.178.7.112]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-447f73d3edcsm97786325e9.20.2025.05.22.00.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:54:44 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 06c72dd9-36e2-11f0-a2fb-13f23c93f187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1747900484; x=1748505284; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tt93X8/M//cm6RVXeEKC2o6v986fsxbCRkDTkmxvdfg=; b=keUgetdG2fXqvMvWke7zPH060AGv53DFA7JhK9UEZabeLK3L2zNtcnspkJiC1sluo3 3oOuBgyWwXjL95okSQHgXDm4Q+voToxVpswgcTxAYBFmvgYdBv3MdW9qt2OG9pfxSEYl kTH5IPuV8gMte8U/NSlqH8rRoinJMppe2JQGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900484; x=1748505284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tt93X8/M//cm6RVXeEKC2o6v986fsxbCRkDTkmxvdfg=; b=UUym3EjWpZy6bw5oSJM2/IQFy/L5WI1bUII0rKxK3EjRnOlZNnH+mWL6Xe07WH8KcQ Nk7nB7kL/+3B/gfLrLsYL+g5oKcX5Pvdw5fopc3skSWNe35zpdx5snc0CXcu8QZzs+8O eOyonDGPnEL3hb2x7JwgYocAuEjrauNpZBaJUoTp+myMXaumVcY+yqiTckfDXilMPNKV /EdAnzkefhmndYznEm4pCEekjyDGwzecI+LbRjUdIvFwCrKy6A/8OYr0pWR2Ee/Qv47T 2Ljp6KXS+bx/4VD52bdO/e5VTOJxTwuudKOubwE7Csgsxg8Jp1rzGMJXjNk13mrRbo6F OnVQ== X-Gm-Message-State: AOJu0Ywxa53+IPd+Akv9Q1T4f3TZ15Gb8TBfcwXPhRMF7QrtTgOgKWn0 JlcNn/cnsiRglg54xDmirAhkA8Ee67qJkZDmTyphOUJSHcphMOXz/WhycnSTOqNZhy+JzoC1J1m 4bhrw X-Gm-Gg: ASbGncu4PevKy/9aaJd6LXGaZrWKL5DIOyCRdEouUoZbnSkibdXuzo/y3UcYotwYc0Q t+cDs5RHB4AiEjYo99H8sihdZTJc9OgmLbHWn5rhWHmACyJkRQkwcv6WJ2uDgRn0pr8DZMh005x jcour8BseAQ5E5mFv7/VNLHrrxTN8cXPWO4145inBQTOdn8jejpRQUPKgMfyG6GOitxybdgB4D1 w0eMUDQh+vvHBStmzwMkC7gT6jyQRxtB/o0Q6A2YwREXNBL2v+H6DvGtiqjSuYnmsNVDJSBlOps +EoDtg6sL2MdGUUDnJ4RaPA9f5gBAYLawUvmGQgXzGSYV/THcvFTiiQGEPswkQJOndzwmTmuVcE fU0TMQnnNBHDFw+tQSvZEuMZkVPDYOA== X-Google-Smtp-Source: AGHT+IGhNrAr/hRUljY+8j/hvusjJZFNAobH2p1pEtgVC2wSlfpCVao6R/KxtDVBG57mG422/tHzlg== X-Received: by 2002:a05:600c:5305:b0:441:b19c:96fe with SMTP id 5b1f17b1804b1-442fd622eb4mr288804925e9.10.1747900484472; Thu, 22 May 2025 00:54:44 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 2/4] x86/traps: remove smp_mb() ahead of IPI dispatch Date: Thu, 22 May 2025 09:54:38 +0200 Message-ID: <20250522075440.99882-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522075440.99882-1-roger.pau@citrix.com> References: <20250522075440.99882-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1747900503317116600 The IPI dispatch functions should already have the required barriers to ensure correct memory ordering. Note other callers of send_IPI_mask() don't use any barriers. Reported-by: Andrew Cooper Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- Changes since v1: - New in this version. --- xen/arch/x86/traps.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index c94779b4ad4f..22f20629327d 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -785,8 +785,6 @@ void fatal_trap(const struct cpu_user_regs *regs, bool = show_remote) cpumask_andnot(&show_state_mask, &cpu_online_map, cpumask_of(smp_processor_id())); set_nmi_callback(nmi_show_execution_state); - /* Ensure new callback is set before sending out the NMI. */ - smp_wmb(); smp_send_nmi_allbutself(); =20 /* Wait at most 10ms for some other CPU to respond. */ --=20 2.49.0 From nobody Fri Oct 31 09:42:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1747900509; cv=none; d=zohomail.com; s=zohoarc; b=bZm6bSCEHqFtpXIuUaSoivJgqhzs0PXyj1jXPEzT3CF7scIVT9wPA/EdzBlSwGKZkKA99dInQi0W02uajr/d9oZ1vOT7rkpvM7Njg6ZTyOGEx8AfeqpPBJeuK899coY6tvSjTpwccSgmZXyGz7/u6Lsd5E+R1G56Qk5JKELptvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747900509; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AzhHFn9O4oOU3Qn2JobHAp8hOeRtdX5BhB0MX7qBcDI=; b=mhaTrKvTNF5mONnlYsFSS4QmfD0ByJKiRIK8zsqY/QqbRwNG44VrRii32w9Z+d2E5SUvy9B90b1Nu1GRM/Ja2UjzOiC/PBnwjcLucFBUz44aeoXz2JmySJ1C6vcup5T5Gqfmey/LhOMEnJ2tvcU31SZqNCXSLE/8EsvM7y5S2NM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747900509582827.3748036856738; Thu, 22 May 2025 00:55:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.993102.1376570 (Exim 4.92) (envelope-from ) id 1uI0lO-00074M-QR; Thu, 22 May 2025 07:54:50 +0000 Received: by outflank-mailman (output) from mailman id 993102.1376570; Thu, 22 May 2025 07:54:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lO-00074F-MH; Thu, 22 May 2025 07:54:50 +0000 Received: by outflank-mailman (input) for mailman id 993102; Thu, 22 May 2025 07:54:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lM-0006LU-MC for xen-devel@lists.xenproject.org; Thu, 22 May 2025 07:54:48 +0000 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [2a00:1450:4864:20::335]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 07614e74-36e2-11f0-b892-0df219b8e170; Thu, 22 May 2025 09:54:46 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-442f5b3c710so63606155e9.1 for ; Thu, 22 May 2025 00:54:46 -0700 (PDT) Received: from localhost (112.pool92-178-7.dynamic.orange.es. [92.178.7.112]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-447f78aeb8csm93578185e9.28.2025.05.22.00.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:54:45 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 07614e74-36e2-11f0-b892-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1747900485; x=1748505285; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AzhHFn9O4oOU3Qn2JobHAp8hOeRtdX5BhB0MX7qBcDI=; b=LAQw2uPbrKsK3NSB3RJ3ZUi+NCN01DVBvZsKN0gXgKI/4rVNOMEsog5EUJP78qD2y+ A8NvO+cCROEguh31ireqZKfmku7nPtqUaK6lt55J8BLsHqW+IM10nP9T/Xw6xjn3vQ8u wdq7PwkrOu59u1QAgjLnF28Yz0HrOKBScA3K8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900485; x=1748505285; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AzhHFn9O4oOU3Qn2JobHAp8hOeRtdX5BhB0MX7qBcDI=; b=K6DKIx/uBfS0iIz/Bb7C58R5bmpxBXk0Ox/6jzP2c+zIROjtl6pBR2FoRk+GeiNErC TR7R1xqDD9WamWmUQAfIv+9Or8nWY+ubWIob+ponR5LLgvcUsDU3iDmj84zSgnDHSUI3 MvgRj5AvFLHKXMF6tdVaqvTchtq53vYVeGGoC2qx4P/JLx6Hfs40ucTB+kEyWM1dasz+ L3I1aKLVGJNd35Hj0kg9jPU7Sf8DCBQftseHxTlHGQWFi6rtbGxIs1oIUydn4cera03G 2oDHzoSMtXZQI+cpBNTdVUen2DD3Vlw40in8VaRhiopEUDSp9D+RLm5HNOrFInRRkeJx ebYg== X-Gm-Message-State: AOJu0Yxd4rWDjKGSsG61j9ReIk+vD6q3vJzXZIoWyaJqzMjgHn0exMU1 KNavkaCeoxQawOcdwKTcW/tSBVVJWpNATdEqyOcGXttRymsnvkMhnHKNd/6hg0w27byHrp241OG /Mbwb X-Gm-Gg: ASbGncui1J14wl/YKRnb4oPDhZpnX1TmQ07FIrrqDnmLzEDFmTEW2IHaBUwbHe6d9bC mTtQ320Q/h3IKLPDXkTw50U5RJlc1k99ZeO1LLAR7XU2UiJGmq6irIsCZv/gp/wsI2FbH2By6XU LYBGBCyqf/bD+Nuxm2/2YQj6HJpIvnTkCZvc31jGLycUzbZnIn03SvxVdKQ4GYguIOQAYGVtnRU lo7l3cIn8tpfdjHcfAXCERrHK2UR3rQR0QSL4jAGJH35rUiFminfTtm2vLkbfPEbXXT+O6cD+hw lNP91vgT563HDEh9IESN7T5RkC+agst93FiNIeKI4BH81ifQ0mNyJQDzS7EqCJlsWGjiRknCHq/ AzMzurNeuv8+q4dkHA6E= X-Google-Smtp-Source: AGHT+IG61P+oaIK9VJw8B2DaXk4AiHjU8pknx0c2hQqVWKmmd8kHow/r6+OtNqaQNz/VBb1nqJEi6g== X-Received: by 2002:a05:600c:628c:b0:43d:b32:40aa with SMTP id 5b1f17b1804b1-442fd60a536mr247845445e9.3.1747900485527; Thu, 22 May 2025 00:54:45 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 3/4] x86/traps: split code to dump execution state to a separate helper Date: Thu, 22 May 2025 09:54:39 +0200 Message-ID: <20250522075440.99882-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522075440.99882-1-roger.pau@citrix.com> References: <20250522075440.99882-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1747900511357116600 Split the code that triggers remote CPUs to dump stacks into a separate function. Also introduce a parameter that can be set by the caller of the newly introduced function to force CPUs to dump the full stack, rather than just dumping the current function name. No functional change intended. Signed-off-by: Roger Pau Monn=C3=A9 --- xen/arch/x86/include/asm/processor.h | 1 + xen/arch/x86/traps.c | 62 +++++++++++++++++----------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/as= m/processor.h index eacd425c5350..10d8078cc1ca 100644 --- a/xen/arch/x86/include/asm/processor.h +++ b/xen/arch/x86/include/asm/processor.h @@ -371,6 +371,7 @@ void show_registers(const struct cpu_user_regs *regs); #define dump_execution_state() run_in_exception_handler(show_execution_sta= te) void show_page_walk(unsigned long addr); void noreturn fatal_trap(const struct cpu_user_regs *regs, bool show_remot= e); +void show_execution_state_nmi(const cpumask_t *mask, bool show_all); =20 extern void mtrr_ap_init(void); extern void mtrr_bp_init(void); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 22f20629327d..f6646d505644 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -714,13 +714,15 @@ static cpumask_t show_state_mask; static bool opt_show_all; boolean_param("async-show-all", opt_show_all); =20 +static bool force_show_all; + static int cf_check nmi_show_execution_state( const struct cpu_user_regs *regs, int cpu) { if ( !cpumask_test_cpu(cpu, &show_state_mask) ) return 0; =20 - if ( opt_show_all ) + if ( opt_show_all || force_show_all ) show_execution_state(regs); else if ( guest_mode(regs) ) printk(XENLOG_ERR "CPU%d\t%pv\t%04x:%p in guest\n", @@ -734,6 +736,38 @@ static int cf_check nmi_show_execution_state( return 1; } =20 +void show_execution_state_nmi(const cpumask_t *mask, bool show_all) +{ + unsigned int msecs, pending; + + force_show_all =3D show_all; + + watchdog_disable(); + console_start_sync(); + + cpumask_copy(&show_state_mask, mask); + set_nmi_callback(nmi_show_execution_state); + send_IPI_mask(mask, APIC_DM_NMI); + + /* Wait at most 10ms for some other CPU to respond. */ + msecs =3D 10; + pending =3D cpumask_weight(&show_state_mask); + while ( pending && msecs-- ) + { + unsigned int left; + + mdelay(1); + left =3D cpumask_weight(&show_state_mask); + if ( left < pending ) + { + pending =3D left; + msecs =3D 10; + } + } + if ( pending ) + printk("Non-responding CPUs: {%*pbl}\n", CPUMASK_PR(&show_state_ma= sk)); +} + const char *vector_name(unsigned int vec) { static const char names[][4] =3D { @@ -780,31 +814,11 @@ void fatal_trap(const struct cpu_user_regs *regs, boo= l show_remote) =20 if ( show_remote ) { - unsigned int msecs, pending; + cpumask_t *scratch =3D this_cpu(scratch_cpumask); =20 - cpumask_andnot(&show_state_mask, &cpu_online_map, + cpumask_andnot(scratch, &cpu_online_map, cpumask_of(smp_processor_id())); - set_nmi_callback(nmi_show_execution_state); - smp_send_nmi_allbutself(); - - /* Wait at most 10ms for some other CPU to respond. */ - msecs =3D 10; - pending =3D cpumask_weight(&show_state_mask); - while ( pending && msecs-- ) - { - unsigned int left; - - mdelay(1); - left =3D cpumask_weight(&show_state_mask); - if ( left < pending ) - { - pending =3D left; - msecs =3D 10; - } - } - if ( pending ) - printk("Non-responding CPUs: {%*pbl}\n", - CPUMASK_PR(&show_state_mask)); + show_execution_state_nmi(scratch, false); } } =20 --=20 2.49.0 From nobody Fri Oct 31 09:42:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1747900507; cv=none; d=zohomail.com; s=zohoarc; b=mll6I8wqvG9CfD0JZmYanF+MwoT61o3HHnigj7unT3hX9NNw5Yt99DD8knRpPPAv58WtQ0S1Ah9T7AI1GG4Cz4fhK68w7cyMB9UwG53AO6r38GL6/Y7Om9agaOk/lGlIJLVxCGcRmXB2KgbtuNgAY1xfSU+iLRoTY5KI9bfF0ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747900507; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AWtufX/fZJTkl4t/yBYN+P8J2qIQZH/xOV2FrRV6Hek=; b=LzKtfXsdxw29VmcgZvlI7ttomO8GEdFMiziQp4zapFQf5chJ/7Cvp8hUwZZnoh7kF9+p6/sVd5iXtbkxE32N+1jJoRsW4noEUArZK7hEvy+HcZU2MegUEDCCMLfe0c5nXIJIon9Oz/uN10sPUp/0iqEDWNwTi/3hREVQBeJv7Kw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1747900507134842.3153691050546; Thu, 22 May 2025 00:55:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.993103.1376575 (Exim 4.92) (envelope-from ) id 1uI0lP-00077E-40; Thu, 22 May 2025 07:54:51 +0000 Received: by outflank-mailman (output) from mailman id 993103.1376575; Thu, 22 May 2025 07:54:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lO-00076S-UX; Thu, 22 May 2025 07:54:50 +0000 Received: by outflank-mailman (input) for mailman id 993103; Thu, 22 May 2025 07:54:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uI0lN-0006LU-ME for xen-devel@lists.xenproject.org; Thu, 22 May 2025 07:54:49 +0000 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [2a00:1450:4864:20::431]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 083f4952-36e2-11f0-b892-0df219b8e170; Thu, 22 May 2025 09:54:47 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a4bdee0bf7so238247f8f.1 for ; Thu, 22 May 2025 00:54:47 -0700 (PDT) Received: from localhost (112.pool92-178-7.dynamic.orange.es. [92.178.7.112]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a35ca5a892sm21774670f8f.24.2025.05.22.00.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:54:46 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 083f4952-36e2-11f0-b892-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1747900486; x=1748505286; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AWtufX/fZJTkl4t/yBYN+P8J2qIQZH/xOV2FrRV6Hek=; b=N11JkwK+cstNd/PQ/n+Zpa05GWWNOw4jq37pyZcLxwowvRjKW+4y3a9quDdxXg7JFJ XoyqPfx8DUfov51sZYpnhNIANam9Axw2Pg2ROXadrtozeVXIFf0DYpIUv9tTiB6V2x5s cTV1jXDF95jUN4w0XXduJIn78MgyN9Oy9K6nM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900486; x=1748505286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWtufX/fZJTkl4t/yBYN+P8J2qIQZH/xOV2FrRV6Hek=; b=B5Xq/1kj2fXHzBUZ6jGGpJ2QVUDmMcpyzQpKfXgotkdcqj5SaHaXSOxrzgvUM8hNSp mLkVKJRtlK4zXJzM7AOTknxqFby18mgoOnGkNxFx3d9un1FS5/87AsVBtiyAqLuZVqYW Si5OweUkaUwo5yjUTE6If/K+RjwSNjJnZUVC23WxbG2nYGeaqxFrBWFg/Z6qmVN0L5CG ijVSYuu1r4S4yGRwYAltZkzjD5yn/lfORAQKCH/3TnQgpk5j8P3NM2/LXUdQZY8Nph/R AZX5bBdEOvZobdlVIObbVeAvJGgM5M7ze25tK+0mwZFaOBcmlrDqdx7OM26RLzvBTAvK GcEQ== X-Gm-Message-State: AOJu0YyBQ4/4B5WonlYCDWYVg3oJnX9hDvXdqK0+6K3J6+vPq47C4oyo T44zZcjm6PIDw2ObBDfLglntHiopMwA7oqI47Dkh4TXSMxghs9/ZJn4Zy4Psi8QiWMuHu9S4vnS Fq3yz X-Gm-Gg: ASbGncuoIQxRrUMZSwxNOnoXD/5uOwyl0JFJ3GK485SFFA+XH18zN/NXUyKkkR8AV8m I1XHUDsCO55SpP2UZoIz8k51l/A5mm2aYFVUsWN161Fn9TdbQnT4b0nm7maf9W3BYUkZQ6MpVX3 9ho8O8K8abotHmBRdjPBafP3Ozv/KqDXEK1Cgbiqxf6hLjBnEaVBIlVp20cuA/eksukG2CqjfaT t57XKha84lWPyQ/q3DAaBJBE59h7u03r8O5jOOw3T8xOC2/LXzasH0uPMjGNvdPEjogmVEM/31b 4ud5zpvdU2jBIFMCOuOvJ9/HrpzemsoTv22yH6cRXIpj/rWMHcFgi6Mf0YqR7i8Mi+wBocdVISK i2ca+uHLs93gmeKxznH13aQcJ7L32QQ== X-Google-Smtp-Source: AGHT+IEdIbVsdISUuEN4SVsoPfQG2xeQf8EhvNBS7jzQTibsGDg+6/qOpvLZsSWIvjZBCOZv6m8qOg== X-Received: by 2002:a05:6000:22c7:b0:3a3:6cf9:9b58 with SMTP id ffacd0b85a97d-3a36cf99c63mr12895366f8f.20.1747900486560; Thu, 22 May 2025 00:54:46 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Jan Beulich , Andrew Cooper Subject: [PATCH v2 4/4] x86/boot: attempt to print trace and panic on AP bring up stall Date: Thu, 22 May 2025 09:54:40 +0200 Message-ID: <20250522075440.99882-5-roger.pau@citrix.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522075440.99882-1-roger.pau@citrix.com> References: <20250522075440.99882-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1747900509159116600 With the current AP bring up code, Xen can get stuck indefinitely if an AP freezes during boot after the 'callin' step. Introduce a 5s timeout while waiting for APs to finish startup. On failure of an AP to complete startup, send an NMI to trigger the printing of a stack backtrace on the stuck AP and panic on the BSP. This patch was done while investigating the issue caused by Intel erratum ICX143. It wasn't helpful in that case, but it's still and improvement when debugging AP bring up related issues. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Andrew Cooper --- Changes since v1: - Use 5s timeout. - Print APICID. - Split NMI dispatch code movement to a pre-patch. - Reorder timeout check condition. --- xen/arch/x86/smpboot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index dbc2f2f1d411..50c5674555e4 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -1372,6 +1372,7 @@ int cpu_add(uint32_t apic_id, uint32_t acpi_id, uint3= 2_t pxm) int __cpu_up(unsigned int cpu) { int apicid, ret; + s_time_t start; =20 if ( (apicid =3D x86_cpu_to_apicid[cpu]) =3D=3D BAD_APICID ) return -ENODEV; @@ -1390,10 +1391,17 @@ int __cpu_up(unsigned int cpu) time_latch_stamps(); =20 set_cpu_state(CPU_STATE_ONLINE); + start =3D NOW(); while ( !cpu_online(cpu) ) { cpu_relax(); process_pending_softirqs(); + if ( (NOW() - start) > SECONDS(5) ) + { + /* AP is stuck, send NMI and panic. */ + show_execution_state_nmi(cpumask_of(cpu), true); + panic("CPU%u/APICID%u: Stuck while starting up\n", cpu, apicid= ); + } } =20 return 0; --=20 2.49.0