From nobody Thu Sep 3 07:03:32 2026 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=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1787747794; cv=none; d=zohomail.com; s=zohoarc; b=ivVw6JbIQwntohQJznzbDbLE3WM1cmgvoZ0efo52tXlIUxdWP9JY4HGu4qRXASPeSQjDyL9mrXY2PiW97t4ycQCpN0V5EnWdPoccryPvScx4NoIPowNYDwaTV9dZ66MpTnewKwu0jXRfpb8UjoydJ+irq8M029Q+pXcRpEJoc4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1787747794; 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=rv3V08n1rNWcfH/Wq0wKEeP+mXrRm3kizeLFPwSWLhY=; b=CUOuOo22J/E+NhjIQzoWaAME42xyDEctV+j8bTG2gSBauOfNGMrIn6qtfsoRhM0wFPGedR1Qz/Gk01T3YjJ9mx0I0j1C1fQccUu6L2IcYJNqS6IgTcMj/EXs8AQVee8FZay/kbf7VEEkqITEAboBegKuMFCpsfBxOLlqVeP434U= 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=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1787747794972268.5109577922974; Wed, 26 Aug 2026 05:36:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1399919.1635892 (Exim 4.92) (envelope-from ) id 1wzCrT-0003ca-QU; Wed, 26 Aug 2026 12:36:11 +0000 Received: by outflank-mailman (output) from mailman id 1399919.1635892; Wed, 26 Aug 2026 12:36:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wzCrT-0003cT-Nf; Wed, 26 Aug 2026 12:36:11 +0000 Received: by outflank-mailman (input) for mailman id 1399919; Wed, 26 Aug 2026 12:36:10 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wzCrS-0003cN-3A for xen-devel@lists.xenproject.org; Wed, 26 Aug 2026 12:36:10 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wzCrQ-0085EP-4f for xen-devel@lists.xenproject.org; Wed, 26 Aug 2026 14:36:08 +0200 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a8eddae-2eae-0a2a0a5409dd-0a2a4502db4e-16 for ; Wed, 26 Aug 2026 14:36:04 +0200 Received: from [209.85.208.52] (helo=mail-ed1-f52.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a8eddb4-6ca4-0a2a45020019-d155d034dc9c-3 for ; Wed, 26 Aug 2026 14:36:04 +0200 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-69c600f76ccso1406693a12.0 for ; Wed, 26 Aug 2026 05:36:04 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c250a9ef4d2sm359613266b.59.2026.08.26.05.36.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Aug 2026 05:36:03 -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" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:Content-Type:Autocrypt:Subject:From:Cc:To:Content-Language:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1787747764; x=1788352564; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=rv3V08n1rNWcfH/Wq0wKEeP+mXrRm3kizeLFPwSWLhY=; b=adfZchmCAKiv8NPfyWAXfNBx1SkefDpDM01wpDVZzd9A3I5bxC0tdbYKaHbGBiDNpp ZoQvbXhuhw17vV7xEdAVwy/lv6OxLUUDzdYG06y/UZAcwsNiUAqziFVAKUG18PD7Zfzv xjDKaUOSsFH94SRLn+SipUsS4mWQhk8v2Lps2Uu9QlU18fvHxeI0E1lJyPlu5br32Ic1 NxnIZRz1nKT4IMk78ABd1iv3cMD2ocoDNmBbdAQM3Z2nQZkgIrkaOhMd5uqHzG9Ezipj yCXcB7ypGiqPv6w0ivuqQduY0TZkdIRSVU/gOw6R8n8HdtWXX5epV60LsuguQ3ntWRdu ZmGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787747764; x=1788352564; h=content-transfer-encoding:content-type:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rv3V08n1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DESmTIvcIy2O33c/94oHw/yJbW X-Received: by 2002:a17:907:72c1:b0:c20:1c9d:8d4b with SMTP id a640c23a62f3a-c250bb05c0fmr805557266b.2.1787747764400; Wed, 26 Aug 2026 05:36:04 -0700 (PDT) Message-ID: Date: Wed, 26 Aug 2026 14:36:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Julien Grall , Stefano Stabellini , Anthony PERARD , Michal Orzel , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , George Dunlap , Teddy Astie From: Jan Beulich Subject: [PATCH] x86: always park offline CPUs Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1787747764-F18AC2AC-7DDEEEF2/0/0 X-purgate-type: clean X-purgate-size: 6947 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1787747797584158500 Content-Type: text/plain; charset="utf-8" While on AMD (or Hygon) CPUs the situation isn't as bad wrt broadcasting of #MC, some "multicast" can still happen. Therefore the reasoning to park CPUs rather than fully offlining them applies everywhere. Don't retain the dependency on the "mce=3D" cmdline option either: That option may best be dropped as well, as not enabling MCE will result in a shutdown when #MC would otherwise be raised. Drop the global variable, using a #define (just like common code does) instead. Outside of common code, simplify expressions / code accordingly. (In common code we still have to cater for x86 wanting it different from everyone else.) Suggested-by: Andrew Cooper Signed-off-by: Jan Beulich --- As it was never actually used after its introduction, we may want to further consider dropping CPU_REMOVE again. I was almost certain that we would have at least one place (presumably a CPU notifier handler) were we assumed no parking for AMD/Hygon. Yet I couldn't find anything; did I overlook the crucial bits? --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -436,7 +436,7 @@ static void cf_check dump_cx(unsigned ch =20 if ( cpu_online(cpu) ) print_acpi_power(cpu, power); - else if ( park_offline_cpus ) + else printk("CPU%u parked in state %u (C%u)\n", cpu, power->last_state ? power->last_state->idx : 1, power->last_state ? power->last_state->type : 1); @@ -1360,7 +1360,7 @@ long set_cx_pminfo(uint32_t acpi_id, str * If we've just learned of more available C states, wake the CPU = if * it's parked, so it can go back to sleep in perhaps a deeper sta= te. */ - if ( park_offline_cpus && apic_id !=3D BAD_APICID ) + if ( apic_id !=3D BAD_APICID ) { unsigned long flags; =20 --- a/xen/arch/x86/cpu/common.c +++ b/xen/arch/x86/cpu/common.c @@ -432,9 +432,6 @@ void __init early_cpu_init(bool verbose) paddr_bits -=3D (ebx >> 6) & 0x3f; } =20 - if (!(c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON))) - park_offline_cpus =3D opt_mce; - initialize_cpu_data(0); } =20 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -716,15 +716,8 @@ static int cf_check cpu_callback( rc =3D cpu_bank_alloc(cpu); break; =20 - case CPU_UP_CANCELED: - case CPU_DEAD: - if ( !park_offline_cpus ) - cpu_bank_free(cpu); - break; - case CPU_REMOVE: - if ( park_offline_cpus ) - cpu_bank_free(cpu); + cpu_bank_free(cpu); break; } =20 --- a/xen/arch/x86/genapic/x2apic.c +++ b/xen/arch/x86/genapic/x2apic.c @@ -181,12 +181,8 @@ static int cf_check update_clusterinfo( !cond_alloc_cpumask_var(&per_cpu(scratch_mask, cpu)) ) err =3D -ENOMEM; break; - case CPU_UP_CANCELED: - case CPU_DEAD: + case CPU_REMOVE: - if ( park_offline_cpus =3D=3D (action !=3D CPU_REMOVE) || - system_state =3D=3D SYS_STATE_suspend ) - break; if ( per_cpu(cluster_cpus, cpu) ) { cpumask_clear_cpu(cpu, per_cpu(cluster_cpus, cpu)); --- a/xen/arch/x86/include/asm/percpu.h +++ b/xen/arch/x86/include/asm/percpu.h @@ -1,7 +1,7 @@ #ifndef __X86_PERCPU_H__ #define __X86_PERCPU_H__ =20 -#define PARK_OFFLINE_CPUS_VAR +#define park_offline_cpus true =20 /* * Force uses of per_cpu() with an invalid area to attempt to access the --- a/xen/arch/x86/include/asm/smp.h +++ b/xen/arch/x86/include/asm/smp.h @@ -25,12 +25,6 @@ DECLARE_PER_CPU(cpumask_var_t, scratch_c DECLARE_PER_CPU(cpumask_var_t, hpet_scratch_cpumask); DECLARE_PER_CPU(cpumask_var_t, send_ipi_cpumask); =20 -/* - * Do we, for platform reasons, need to actually keep CPUs online when we - * would otherwise prefer them to be off? - */ -extern bool park_offline_cpus; - void smp_send_nmi_allbutself(void); =20 void send_IPI_mask(const cpumask_t *mask, int vector); --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -80,16 +80,12 @@ void __init set_nr_cpu_ids(unsigned int printk(XENLOG_INFO "SMP: Allowing %u CPUs (%d hotplug CPUs)\n", max_cpus, max_t(int, max_cpus - num_processors, 0)); =20 - if (!park_offline_cpus) - tot_cpus =3D max_cpus; nr_cpu_ids =3D min(tot_cpus, NR_CPUS + 0u); if (nr_cpu_ids < num_processors) { unaccounted_cpus =3D true; - if (park_offline_cpus) - printk(XENLOG_WARNING - "SMP: Cannot bring up %u further CPUs\n", - num_processors - nr_cpu_ids); + printk(XENLOG_WARNING "SMP: Cannot bring up %u further CPUs\n", + num_processors - nr_cpu_ids); } =20 #ifndef nr_cpumask_bits --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -2144,8 +2144,7 @@ void asmlinkage __init noreturn __start_ /* Set up node_to_cpumask based on cpu_to_node[]. */ numa_add_cpu(i); =20 - if ( (park_offline_cpus || num_online_cpus() < max_cpus) && - !cpu_online(i) ) + if ( !cpu_online(i) ) { ret =3D cpu_up(i); if ( ret !=3D 0 ) --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -92,9 +92,7 @@ void send_IPI_mask(const cpumask_t *mask if ( system_state > SYS_STATE_smp_boot && !unaccounted_cpus && !disabled_cpus && !cpu_in_hotplug_context() = && /* NB: get_cpu_maps lock requires enabled interrupts. */ - local_irq_is_enabled() && (cpus_locked =3D get_cpu_maps()) && - (park_offline_cpus || - cpumask_equal(&cpu_online_map, &cpu_present_map)) ) + local_irq_is_enabled() && (cpus_locked =3D get_cpu_maps()) ) cpumask_or(scratch, mask, cpumask_of(smp_processor_id())); else { --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -67,8 +67,6 @@ DEFINE_PER_CPU_READ_MOSTLY(struct stubs, cpumask_t cpu_online_map __read_mostly; EXPORT_SYMBOL(cpu_online_map); =20 -bool __read_mostly park_offline_cpus; - unsigned int __read_mostly nr_sockets; cpumask_t **__read_mostly socket_cpumask; static cpumask_t *secondary_socket_cpumask; @@ -1149,7 +1147,7 @@ static int cf_check cpu_smpboot_callback break; case CPU_UP_CANCELED: case CPU_DEAD: - cpu_smpboot_free(cpu, !park_offline_cpus); + cpu_smpboot_free(cpu, false); break; case CPU_REMOVE: cpu_smpboot_free(cpu, true); --- a/xen/include/xen/percpu.h +++ b/xen/include/xen/percpu.h @@ -34,7 +34,7 @@ #include #include =20 -#ifndef PARK_OFFLINE_CPUS_VAR +#if !defined(PARK_OFFLINE_CPUS_VAR) && !defined(park_offline_cpus) /* * Do we, for platform reasons, need to actually keep CPUs online when we * would otherwise prefer them to be off?