From nobody Thu Oct 30 22:54:57 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=1756495803; cv=none; d=zohomail.com; s=zohoarc; b=cZDnxjbgHLrrQhLQezJ/t8vM0UUqy/WVmoE3dyiWZ/NRojeF8+yy/SIF3lAcPD9h6Oc3b7FgOxvG6uuG0JHoT+R8JU2ujHIYEJv6cZuBIBRk39MKTVVRjSjIUH2nqbIilBMI9zJwVxSgo+0NMa848e082PHV7ukj4ZvZUbOFrY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1756495803; 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=kWB8Pv2sqAgv9Nea+D2JzgKMYzdAPnpLmqubRuhPgt8=; b=LBQ7QeQfg+VNv3bmGND+Tvf46XFveUrfL+Vy8xL/hgY59tUVYZio771KBqRnfRlKpuxgqHxJBic2ezPgd2cQLO50sNQC3dY+LEKU2ngbuRgPIuJJ9ysEOlgLIZjUq6HknFYdT5r7lpjZTlnd45/XdA9BaQak4ftbCxGcZOd7Q68= 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 1756495803143443.0594035804719; Fri, 29 Aug 2025 12:30:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1102020.1454812 (Exim 4.92) (envelope-from ) id 1us4nC-00021m-Cy; Fri, 29 Aug 2025 19:29:46 +0000 Received: by outflank-mailman (output) from mailman id 1102020.1454812; Fri, 29 Aug 2025 19:29:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1us4nC-00021f-AS; Fri, 29 Aug 2025 19:29:46 +0000 Received: by outflank-mailman (input) for mailman id 1102020; Fri, 29 Aug 2025 19:29:45 +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 1us4nB-00021Z-56 for xen-devel@lists.xenproject.org; Fri, 29 Aug 2025 19:29:45 +0000 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [2a00:1450:4864:20::42a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 83fe1a0c-850e-11f0-8adc-4578a1afcccb; Fri, 29 Aug 2025 21:29:44 +0200 (CEST) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3cdc54cabb1so960549f8f.0 for ; Fri, 29 Aug 2025 12:29:44 -0700 (PDT) Received: from localhost.localdomain (host-195-149-20-212.as13285.net. [195.149.20.212]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3cf34491a65sm4324054f8f.56.2025.08.29.12.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Aug 2025 12:29:41 -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: 83fe1a0c-850e-11f0-8adc-4578a1afcccb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1756495783; x=1757100583; 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=kWB8Pv2sqAgv9Nea+D2JzgKMYzdAPnpLmqubRuhPgt8=; b=SZ/Cf5gismCvddg6rw2HxHKF+XQNGQZ0oLVNr2pjeSSVVOy2PT/0Z+O4W/YqSaW2sV wlvxOs8NAFfFjuQvzjCzXvWae24L+DoFgaF1nS0sv/ao/cWa0HFs3fMqHjNG0x6roF9l V/0+DNDo8oei1QvKpJMK5s2O0DX0PdYLQKihw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756495783; x=1757100583; 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=kWB8Pv2sqAgv9Nea+D2JzgKMYzdAPnpLmqubRuhPgt8=; b=NS4titaKOH1licuksUXXggUIw7wMQ/O3RQAUEQYifiL6mOMvtcN1Gh4N1IuDILuLj1 BQtvakBzyOdYLZIhfvz2mS/4U9jfgwIO/sBigB22GOCCYez8UA61SFCtVcXTWK8i04SN XBljc7ju0GwtvcrD1D0CoFnBiFWTbsdZIO9JXtKjhFw7QIlaM6Xb7OiEiWR0yUD5apay SZy9K/UMVcF9EBYOCU/2cEMww7xhA72wkiuk68lqnXt3yaXprbqw81hPkJgeHtMSYUXT bItfn4sSGkgF9XuL8qq20r/PDsqiMtuoGfBKdk0cfJSzZGqZVoBExNP/cQ4ENPPDuNoR 5bhw== X-Gm-Message-State: AOJu0Yy6lmfkayAol3iXWHMiRy57Tu5KETaUvcC8um58SpZLZ0mZLY35 6ZOlNRGNpNsM3kozfU+wZc8T0tTRlXkb/sMY104Y8E33fdgGOFIdy3SM5gH/aO2PdLryLs8OmTh CptOU X-Gm-Gg: ASbGncvNXnLb3pqemBOf0Itz0u3FAvXg6CQQ+tbkv7EAYR9INRNeRo/qUn+CNopl4nx vNxCX1Mlbjn5XVUF8xFVINkS00/RugRUMFhWVU8XNBT0Aj+MwVGoWNOVWpVrJP2ZULTy6N2KDw0 4WuiF/x6gpvnLbgREgUJX2v8oPMqcn68pqMiPQWrcsWiQJuiuAlcan40ozqTnDlwqVsrcitBJ1u F2RJ4VRq1XATQQNEUaH/zBc81q5dNbCsXw0DtBmCwrCQCvDgGNIRfD0hyuhLNIOPL3sHur8MN6Q 2L4ua1eB+wREHZs+GUbX0ExnNYNo1926ZgRj/C1NxkvjaFc4FWo2q5U9IUqwE/+hZN9Z7+/LTK7 pyL1vU14VIErF4B7spnXWSyz71StVrHvyoFL6r07y6K6L6i3hRbaX/RzSvvaWfqTe0w2bhjBVta 0AlY/U4fVj8JI= X-Google-Smtp-Source: AGHT+IFVz0Q1xvsJTii6GiHVD1gt4bLIe1V4qPxG31Fi/gBSG6mI8P9dCXnVwwqgg2Fudo/3pRWdwA== X-Received: by 2002:a05:6000:18ad:b0:3b7:9c79:32bb with SMTP id ffacd0b85a97d-3c5dcdf9bd9mr25803363f8f.44.1756495783130; Fri, 29 Aug 2025 12:29:43 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] x86/gen-cpuid: Fix debugging for cycle detection Date: Fri, 29 Aug 2025 20:29:39 +0100 Message-Id: <20250829192939.1090358-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: 1756495804192116600 Jan reports the following exception when using the cycle debugging: Feature IBRSB, seen [IBRSB, STIBP, INTEL_PSFD, EIBRS, IPRED_CTRL, RRSBA_C= TRL, RRSBA, BHI_CTRL], to_process [SSBD] Traceback (most recent call last): File "/local/xen.git/xen/../xen/tools/gen-cpuid.py", line 594, in sys.exit(main()) ^^^^^^ File "/local/xen.git/xen/../xen/tools/gen-cpuid.py", line 588, in main crunch_numbers(state) File "/local/xen.git/xen/../xen/tools/gen-cpuid.py", line 366, in crunc= h_numbers (state.names[feat], repl(seen), repl(to_process))) ^^^^^^^^^^^^^^^^ File "/local/xen.git/xen/../xen/tools/gen-cpuid.py", line 364, in repl return "[" + ", ".join((state.names[x] for x in l)) + "]" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/local/xen.git/xen/../xen/tools/gen-cpuid.py", line 364, in return "[" + ", ".join((state.names[x] for x in l)) + "]" ~~~~~~~~~~~^^^ KeyError: 534 make[2]: *** [/local/xen.git/xen/include/xen/lib/x86/Makefile:9: cpuid-au= togen.h] Error 1 This is caused by commit ce8c930851a5 ("x86/cpu-policy: MSR_ARCH_CAPS featu= re names") being rather lazy and marking dependenices on unknown features. Introduce a helper to pick the known features in a range, and use it for ARCH_CAPS. Additionally, remove trailing whitepsace from the debug print. Reported-by: Jan Beulich Fixes: ce8c930851a5 ("x86/cpu-policy: MSR_ARCH_CAPS feature names") Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/tools/gen-cpuid.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py index 6f96d1368e9e..403369aedcd9 100755 --- a/xen/tools/gen-cpuid.py +++ b/xen/tools/gen-cpuid.py @@ -168,6 +168,10 @@ def crunch_numbers(state): state.hvm_shadow_max =3D state.pv_max | state.raw['S'] | state= .raw['s'] state.hvm_hap_max =3D state.hvm_shadow_max | state.raw['H'] | state= .raw['h'] =20 + def feat_range(start, last): + """ Select all known features in the given range """ + return [ x for x in state.names.keys() if start <=3D x <=3D last ] + # # Feature dependency information. # @@ -338,7 +342,7 @@ def crunch_numbers(state): PSFD: [EPSF], =20 # The ARCH_CAPS CPUID bit enumerates the availability of the whole= register. - ARCH_CAPS: list(range(RDCL_NO, RDCL_NO + 64)), + ARCH_CAPS: feat_range(RDCL_NO, RDCL_NO + 63), =20 # The behaviour described by RRSBA depend on eIBRS being active. EIBRS: [RRSBA], @@ -362,7 +366,7 @@ def crunch_numbers(state): # To debug, uncomment the following lines: # def repl(l): # return "[" + ", ".join((state.names[x] for x in l)) + "]" - # sys.stderr.write("Feature %s, seen %s, to_process %s \n" % \ + # sys.stderr.write("Feature %s, seen %s, to_process %s\n" % \ # (state.names[feat], repl(seen), repl(to_process))) =20 f =3D to_process.pop(0) base-commit: e7c689a249ca6b8d14a077bb0f3311eaeda2ca19 --=20 2.39.5