From nobody Fri Dec 19 19:17:26 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=1747051242; cv=none; d=zohomail.com; s=zohoarc; b=PhjGbbb+8dUkk80tpW8zv50+kTp5BiZw8O4O6RDbQXXIdOViSvn1tbSujMoK+6yjemh7KQnXRyvcaMWjsUJ31MOcHo2norTlGpSHvhJWJWI6JrQKPE59njrvvtIVdRSXGhVvqQo+wCspW3dfGyLKB82fbC36DA5V5zxg6XbgKSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747051242; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o9C25/zJkOBu3Gqsy7Zlw3kC1/MzrPAZCWFxQZ+xvH0=; b=BRUx5jWaL1v/dTUdQaesFOkKBFPQnemy80NQZ5j0vtNFe68mpLk8yQPnyO7lMk3JF4tacUXFSnLCRdwnAu24ZAUIRoknjHxLXI0iO9mqCMKN/2v1kAeEeclPYt0Tur49cbjpunnJaG9sPv0omIQHHVr15BGcuxtjX8f4jAr222s= 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 174705124272978.07809044441899; Mon, 12 May 2025 05:00:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.981353.1367748 (Exim 4.92) (envelope-from ) id 1uERpd-0001iN-6e; Mon, 12 May 2025 12:00:29 +0000 Received: by outflank-mailman (output) from mailman id 981353.1367748; Mon, 12 May 2025 12:00:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uERpd-0001iG-25; Mon, 12 May 2025 12:00:29 +0000 Received: by outflank-mailman (input) for mailman id 981353; Mon, 12 May 2025 12:00:28 +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 1uERpb-0001i4-Vh for xen-devel@lists.xenproject.org; Mon, 12 May 2025 12:00:27 +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 b0d4a3a1-2f28-11f0-9ffb-bf95429c2676; Mon, 12 May 2025 14:00:26 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-440685d6afcso49085555e9.0 for ; Mon, 12 May 2025 05:00:26 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f58f33b5sm12460480f8f.54.2025.05.12.05.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 May 2025 05:00:24 -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: b0d4a3a1-2f28-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1747051225; x=1747656025; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=o9C25/zJkOBu3Gqsy7Zlw3kC1/MzrPAZCWFxQZ+xvH0=; b=HcDTe3MOPNcp+d2pVcD1FofJNUt6gl8tuQvSbcLnngEL2uuMKZ3I4WN162Q1uhkAyS V/L8XhPnBcIX9etzPospe8g58NuIail5vVvSBRRWpReTc7rDE162/PSeSxt2byeFzIsa PDBDhETnbPv9NiHnyEQ6aSb69lVkprbJm5QoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747051225; x=1747656025; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o9C25/zJkOBu3Gqsy7Zlw3kC1/MzrPAZCWFxQZ+xvH0=; b=AkOv5HVHJRxuwE+IYeGh/SqMgv/sGX+yxlAgX4R8J8u5LRKzoJzn+2BE6cGhy+drHF DMTbXrNZS/IzBaVohqOOLT/ub9pSVFP6Q9Sws/SEowj2w3BH03NxwtEw6eHf4ooACY36 IeZmoMu4Fqz7FtNXRTF0+2FnF86t4d/y9l2lARdgaSnc8nYY2YlJmFguTxoAexXsWxCV zVQT7bkuatIiTBS6anQQryRx05PDuHTP4Ma7LMnOw285l5HPamTt3Kb79rnDT86Hl2ht u671zqiRKogbq0BpnonGaYXvw4HrPhjqeuuPjPQTg/dvZG3AJMUFYNC/pDeGZ2UZapPs y3mg== X-Gm-Message-State: AOJu0YwOfT3KwQb7atZ5/ZM5HU7Yb8y96e7PvLJtRjOPTySuakfPVYvO OAnXJbVJjeMqqvAX/jijr69b958vqnu1js75jNCn6bgOrfAFSLzTJZHPOcKVLFbCgrH1B74CSEB + X-Gm-Gg: ASbGncvAYHiFw8wFHAexzrHCAkeyo2sIjpnMIbtassfoSogLN4UuWyXtaDQS+3o0LMa t027WYYymKZ7m7rV3Mo4us8PZoGScKE72pSkghM0ZxdvSE9VD1D7Q+8YPe8xl3Ix6+4P7uySNNn PSEOiFbCe0qK0pPL1POTuLyn1i+XF+1c2CeS7bhP5cFqWs28ozAzWvjQRfzrD+NNVFHAhgYPVy0 VXc81vmLDEY7l0dGb8QVxwddcwyqWpeelYnXO2dkHsfUIA1/tg40hQ8Vued1CLMa3hIdjOlML1S oGHwOnZuVDczj6bbHDNhacFX+mTF6JkrwIzd7XrsSRipcz5X79EEQJ54frS+HJ9H1P4zEP8ZPNG Em5f18outQO3YaACJQA69OdJG X-Google-Smtp-Source: AGHT+IEPYR4IRNTXWcqq94UhwJv9iE6hL37pLoU8EhyoZyHwEwnuQu782X7E0Zgx9cXdCy/i3Zxu4A== X-Received: by 2002:a5d:588a:0:b0:3a0:b2ff:fb00 with SMTP id ffacd0b85a97d-3a1f64b4557mr8853139f8f.44.1747051225328; Mon, 12 May 2025 05:00:25 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] x86/smp: Drop booting_cpu Date: Mon, 12 May 2025 13:00:15 +0100 Message-Id: <20250512120015.3445217-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 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: 1747051243892116600 Since commit 434596bbd44a ("x86/smpboot: Write the top-of-stack block in cpu_smpboot_alloc()"), smp_processor_id() is unconditionally usable on APs. Drop the global variable. Also drop the parameter from start_secondary(). It was introduced as unused in commit e9ac3bbccab0 ("Move initial stack-pointer adjustment into assembly bootstrap code.") in 2005. At the time, the caller was a shared codepath w= ith __start_xen() with a parameter on the stack, but that never mattered for start_secondary() which ultimately reset_stack_and_jump()'s out of context. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/smpboot.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 54207e6d8830..49e111018224 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -226,8 +226,6 @@ static void smp_callin(void) cpu_relax(); } =20 -static int booting_cpu; - /* CPUs for which sibling maps can be computed. */ static cpumask_t cpu_sibling_setup_map; =20 @@ -315,15 +313,10 @@ static void set_cpu_sibling_map(unsigned int cpu) } } =20 -void asmlinkage start_secondary(void *unused) +void asmlinkage start_secondary(void) { struct cpu_info *info =3D get_cpu_info(); - - /* - * Dont put anything before smp_callin(), SMP booting is so fragile th= at we - * want to limit the things done here to the most necessary things. - */ - unsigned int cpu =3D booting_cpu; + unsigned int cpu =3D smp_processor_id(); =20 /* Critical region without IDT or TSS. Any fault is deadly! */ =20 @@ -571,8 +564,6 @@ static int do_boot_cpu(int apicid, int cpu) */ mtrr_save_state(); =20 - booting_cpu =3D cpu; - start_eip =3D bootsym_phys(entry_SIPI16); =20 /* start_eip needs be page aligned, and below the 1M boundary. */ --=20 2.39.5