From nobody Sat Feb 7 06:55:11 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=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1769450072; cv=none; d=zohomail.com; s=zohoarc; b=kNdXfypueLn5Gn1gW6lrNdk4DloHkkHbtkC98sjOr4jBlM1i0epLFGKZrPmNIOT+qpjmhnIRshLk+tpcl7vIobpZJ1GCzjCDdW8RRIJi1E01F3fH/qFj1wc4Z1C1MfGrd727v3NZGcKEqhTrnRTb8IQ+j8h02WSKp0JTqVeQyPI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769450072; 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=SVFZKPX+rQ8GQmkwaOmVq1QfQ8v/dwJRo6+jPX9Dkm8=; b=FII/KPRm7HHp/upIreF67jieZdLGW0wiGDkljtKMyhtg0y63SLgWn59eayuM1bGdhkNihQDjT0DS4gq5xzNIo+upu6bn8Y+guM44kojgefQnuroqGuSdEBMtKPBqozu7VA2uE1+DIwnFKFaUu/q7tUc+cUN6aRPqN2aJVRFnHJk= 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 1769450072881789.4746417818212; Mon, 26 Jan 2026 09:54:32 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1213831.1524282 (Exim 4.92) (envelope-from ) id 1vkQmh-0004Xf-Ij; Mon, 26 Jan 2026 17:53:55 +0000 Received: by outflank-mailman (output) from mailman id 1213831.1524282; Mon, 26 Jan 2026 17:53:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vkQmh-0004Tl-Bs; Mon, 26 Jan 2026 17:53:55 +0000 Received: by outflank-mailman (input) for mailman id 1213831; Mon, 26 Jan 2026 17:53:53 +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 1vkQmf-0004HW-Mq for xen-devel@lists.xenproject.org; Mon, 26 Jan 2026 17:53:53 +0000 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [2a00:1450:4864:20::32d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fa6536aa-fadf-11f0-b15f-2bf370ae4941; Mon, 26 Jan 2026 18:53:53 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-47ee301a06aso55313495e9.0 for ; Mon, 26 Jan 2026 09:53:53 -0800 (PST) Received: from localhost.localdomain (host-92-26-102-188.as13285.net. [92.26.102.188]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48066c10dbasm3896455e9.15.2026.01.26.09.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 09:53:52 -0800 (PST) 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: fa6536aa-fadf-11f0-b15f-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1769450032; x=1770054832; 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=SVFZKPX+rQ8GQmkwaOmVq1QfQ8v/dwJRo6+jPX9Dkm8=; b=P5S1xDUJCNyQG6IbahEYbDcJgsxRGwxBQ6SKXjhtDSpPesxnWhaY4T00BJQtND38Mk E5uDTW5eDbo2BNhmyD7EvTdGrOHHdrKLITE+3UAH8mGCAVOCxSp/K8Ncf8JrRE1mJQ/H r2hCebZoFt88ndlyphl/ZNjPYFrkMDpRPRF7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769450032; x=1770054832; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=SVFZKPX+rQ8GQmkwaOmVq1QfQ8v/dwJRo6+jPX9Dkm8=; b=BOGTLRcph9WgxQqQk3o5MjcsVx8HIKWbdCOVfDf+0x50JkOr4CZuBO1LkLL+SfPz94 g3QG7yAFsfq992ShOd1AuVpjtxEJ6K7TT47ljFgDwnSfqTzGobYaOoTtjuIJ7sfSZG5b 8/he8eBfIYLeH9PjAGBSu8nnYz6op90cJ/A+QVrxf8xnYvwSw4EYPi0kzUSGrUChtkI6 ZPP5IvAeb2dBv5OtcIIIfiZXlZZpG70QUXr/rHqCPXh/3iXrvCjrMUGqI6SJIvqRfidX Jrly2E9hT5WDNRbLBKTYvmOZ1QErVv+jwn0yS0n9wxXPr7ZeQjsSxsBkd6ZB5jvzn4xr qOVw== X-Gm-Message-State: AOJu0Yw+QEvZy9w2bsrF4U/5vlXsAQE12I8p+Ln+FojK+E6oNJFsvWkK O37qipBNkCljwbpNlm26rJjWS3T+xZvXlTMLbWJj++ESSlS3OdHVJv9jtpVoTzFkHVa1+13K0w1 jR1Nq X-Gm-Gg: AZuq6aLImjM8Uae1dH94byu1ln6wTch/kOKuD+hR2ZK64fktNy7d3a3mXuxtzh2zJzE w1hc5ST+U0AzJfZse3VcAlAj+S3g3/ys2ZsyUTxoVe+d1TEqs97JN5NQUeiJDtPMOQxPiFJKhYf tcwh7Js2Pp5ezzNI+p4/zpXl56te1uWwAVWGtVvCerEa/BJewYNw+xc3GntnnyBTOXv2N6Fhrmt JNymRnmmj6wv4hR3GAztg/RushXEHYe4Rbjx6GpRfMT5Q3y/q+3AilHAfRX6wY5nb9h2VDLitS2 ALcHpgn4dBviFFUE2zkJTcXHQ6TlWo53BF1wuqtHxJGqymXtU08bK2G5UTeQJ9yJHVg1oHPmT8l MSxXWxlLDt9mSuqj7rSkhvTNpOrWUiKY5DDdFyi1u9L2WxvjWiXwlDOFlAkj4hYVLV9t9Xp+R69 z1x4g4fBa5Rb1FdfIQjPuYy4BW2EEJdYKRArk088Pood/KCoPp82Fv34YVrPtjfQ== X-Received: by 2002:a05:600c:35ce:b0:47d:3ead:7440 with SMTP id 5b1f17b1804b1-4805d06c428mr85483385e9.32.1769450032374; Mon, 26 Jan 2026 09:53:52 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Julian Vetter , Teddy Astie Subject: [PATCH 05/16] x86/cpu: Move per-CPU actions out of the vendor early_init() hook Date: Mon, 26 Jan 2026 17:53:34 +0000 Message-Id: <20260126175345.2078371-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260126175345.2078371-1-andrew.cooper3@citrix.com> References: <20260126175345.2078371-1-andrew.cooper3@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: 1769450074557158500 cpu_dev.c_early_init() and .c_init() is a spilt we inherited from Linux. In Xen, these are called moments apart in identify_cpu(). The only logic between the two calls is filling part of c->x86_capability[] and collecting the the long model name. We are going to want to repurpose .c_early_init() somewhat, so move the log= ic wanting running on all CPUs to the .c_init() hook, which is only marginally later. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Julian Vetter CC: Teddy Astie --- xen/arch/x86/cpu/amd.c | 4 ++-- xen/arch/x86/cpu/hygon.c | 2 ++ xen/arch/x86/cpu/intel.c | 12 ++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index fc496dc43e08..970cb42e9e0b 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -621,8 +621,6 @@ void cf_check early_init_amd(struct cpuinfo_x86 *c) { if (c =3D=3D &boot_cpu_data) amd_init_levelling(); - - ctxt_switch_levelling(NULL); } =20 void amd_log_freq(const struct cpuinfo_x86 *c) @@ -1018,6 +1016,8 @@ static void cf_check init_amd(struct cpuinfo_x86 *c) u32 l, h; uint64_t value; =20 + ctxt_switch_levelling(NULL); + amd_init_de_cfg(c); =20 if (c =3D=3D &boot_cpu_data) diff --git a/xen/arch/x86/cpu/hygon.c b/xen/arch/x86/cpu/hygon.c index b99d83ed4d75..bb1624882499 100644 --- a/xen/arch/x86/cpu/hygon.c +++ b/xen/arch/x86/cpu/hygon.c @@ -32,6 +32,8 @@ static void cf_check init_hygon(struct cpuinfo_x86 *c) { unsigned long long value; =20 + ctxt_switch_levelling(NULL); + amd_init_de_cfg(c); =20 if (c =3D=3D &boot_cpu_data) diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c index eec6ee763040..141dc2368143 100644 --- a/xen/arch/x86/cpu/intel.c +++ b/xen/arch/x86/cpu/intel.c @@ -327,10 +327,6 @@ void __init intel_unlock_cpuid_leaves(struct cpuinfo_x= 86 *c) =20 static void cf_check early_init_intel(struct cpuinfo_x86 *c) { - /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ - if (c->x86 =3D=3D 15 && c->x86_cache_alignment =3D=3D 64) - c->x86_cache_alignment =3D 128; - if (c =3D=3D &boot_cpu_data && bootsym(trampoline_misc_enable_off) & MSR_IA32_MISC_ENABLE_XD_DISABLE) printk(KERN_INFO "re-enabled NX (Execute Disable) protection\n"); @@ -350,8 +346,6 @@ static void cf_check early_init_intel(struct cpuinfo_x8= 6 *c) =20 intel_init_levelling(); } - - ctxt_switch_levelling(NULL); } =20 /* @@ -615,6 +609,12 @@ static void init_intel_perf(struct cpuinfo_x86 *c) =20 static void cf_check init_intel(struct cpuinfo_x86 *c) { + /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ + if (c->x86 =3D=3D 15 && c->x86_cache_alignment =3D=3D 64) + c->x86_cache_alignment =3D 128; + + ctxt_switch_levelling(NULL); + /* Detect the extended topology information if available */ detect_extended_topology(c); =20 --=20 2.39.5