From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B847606A338 for ; Mon, 30 Nov 2026 14:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Di+OMv3I Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6223110F0DE; Mon, 30 Nov 2026 14:16:30 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8C8A10F0DE for ; Mon, 30 Nov 2026 14:16:24 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 8BD1641392; Mon, 30 Nov 2026 14:16:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 115AF1F00896; Mon, 30 Nov 2026 14:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796048184; bh=crJvOoktd6tk3o11vmGHCVxwBiuiRsIuJ0BGo27ifWU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Di+OMv3I4Q4jcjWQizKHaBUmZsLPFmWrh2THO+t2eW3diA4wLO/RDpH+wlYqI0thG GbTneRF9Wl+ocJ7PPK1vELFn9sJfXUSIcshthoTPd57mYRP29ofUXCgpXMIXR+Ei2z jgvzRNGeQPXfvCmB1+oWLte6Z4boSNYjLX7WHduYDj+pAYuliYHrI6IcT2rmDQOeaA mXOZeM1o1pgLzSpKzzJTloKGruauJLQEmntV0CGWz1tcZVLMyk0BehJ2ps8xDR/R4c /8ACDmjUOqPVVP5KCqpvpzMcoRG1B59ZaIi6NgOJ9kUwCGWB9DN+42ddvggWvmbwqs bWg+0qsdw5Njw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 4/4] drm/xe/cper: Add PCI ID to GUID mapping verification in KUnit To: "Mallesh Koujalagi" , intel-xe@lists.freedesktop.org In-Reply-To: <20261130140815.2227101-10-mallesh.koujalagi@intel.com> References: <20261130140815.2227101-6-mallesh.koujalagi@intel.com> <20261130140815.2227101-10-mallesh.koujalagi@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 14:16:23 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DIET_1, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] drm/xe/cper: cper_test_guid_matches_pci_id() duplicates xe_device_guids table -- commit 176ab22f8c81e3c66e0ddfd127c0940356bbfeeb Author: Mallesh Koujalagi drm/xe/cper: Add PCI ID to GUID mapping verification in KUnit This commit adds a KUnit test case to verify that each supported PCI device ID maps to its expected CPER GUID. > diff --git a/drivers/gpu/drm/xe/tests/xe_cper_kunit.c b/drivers/gpu/drm/x= e/tests/xe_cper_kunit.c > index 5bd0bbcef566f..72c86b7ea3772 100644 > --- a/drivers/gpu/drm/xe/tests/xe_cper_kunit.c > +++ b/drivers/gpu/drm/xe/tests/xe_cper_kunit.c > @@ -18,6 +18,32 @@ static const u16 cper_test_pci_ids[] =3D { > =20 > #undef CPER_TEST_PCI_ID > =20 > +/* UUIDv5 outputs for "platform/8086:". */ > +static const struct xe_device_guid_entry cper_test_expected_guids[] =3D { > + { 0x674C, GUID_INIT(0x9046afe5, 0x9041, 0x5124, > + 0x86, 0x14, 0x92, 0x55, 0x0d, 0x9e, 0x9d, 0xa6) }, > + { 0x674D, GUID_INIT(0xf95911b8, 0x6564, 0x5905, > + 0xa6, 0xa7, 0xb9, 0xbf, 0x54, 0xab, 0x6c, 0x27) }, > + { 0x674E, GUID_INIT(0xb8d24106, 0x0108, 0x59f1, > + 0x8f, 0xfc, 0x9f, 0xc4, 0xa9, 0xc9, 0xb7, 0xb0) }, > + { 0x674F, GUID_INIT(0xdd8dd88e, 0xef2f, 0x59b1, > + 0x99, 0x15, 0xdb, 0x6f, 0x1d, 0xc9, 0xb4, 0x5d) }, > + { 0x6750, GUID_INIT(0x1dd66c44, 0x87d5, 0x524a, > + 0xad, 0x6e, 0xfc, 0x18, 0x9d, 0x42, 0x6f, 0x1a) }, > + { 0x6751, GUID_INIT(0x17d0dd04, 0x2fad, 0x5400, > + 0x99, 0xc8, 0x9b, 0x45, 0x51, 0x3b, 0x67, 0xe3) }, > + { 0x6752, GUID_INIT(0xb778ead8, 0x0009, 0x59a7, > + 0xa1, 0x3a, 0x78, 0xce, 0x4d, 0xdd, 0xae, 0xf5) }, > + { 0x6753, GUID_INIT(0x7fcd80a7, 0xca5a, 0x5d21, > + 0x97, 0x0f, 0xe7, 0x6a, 0xc0, 0x27, 0xbb, 0x76) }, > + { 0x6754, GUID_INIT(0xf87c6f75, 0x96c1, 0x5ce4, > + 0x86, 0x75, 0xc7, 0xaa, 0x04, 0xbc, 0xc6, 0xd8) }, > + { 0x6755, GUID_INIT(0x839514b4, 0xf269, 0x5e61, > + 0xba, 0x2f, 0x79, 0x08, 0xa7, 0x59, 0x06, 0x5f) }, > + { 0x6756, GUID_INIT(0x5003ffda, 0xab3f, 0x5ae1, > + 0xb3, 0xbd, 0x19, 0x60, 0x0e, 0x0d, 0x4c, 0xc2) }, > +}; > + > static bool cper_test_pci_id_known(u16 device_id) > { > unsigned int i; > @@ -40,6 +66,17 @@ static const struct xe_device_guid_entry *cper_test_gu= id_entry(u16 device_id) > return NULL; > } > =20 > +static const struct xe_device_guid_entry *cper_test_expected_guid_entry(= u16 device_id) > +{ > + unsigned int i; > + > + for (i =3D 0; i < ARRAY_SIZE(cper_test_expected_guids); i++) > + if (cper_test_expected_guids[i].device_id =3D=3D device_id) > + return &cper_test_expected_guids[i]; > + > + return NULL; > +} > + > static void cper_test_pci_ids_have_guid(struct kunit *test) > { > unsigned int i; > @@ -52,6 +89,31 @@ static void cper_test_pci_ids_have_guid(struct kunit *= test) > cper_test_pci_ids[i]); > } > =20 > +static void cper_test_guid_matches_pci_id(struct kunit *test) > +{ > + unsigned int i; > + > + KUNIT_ASSERT_EQ(test, ARRAY_SIZE(cper_test_expected_guids), > + ARRAY_SIZE(cper_test_pci_ids)); > + > + for (i =3D 0; i < ARRAY_SIZE(cper_test_pci_ids); i++) { > + u16 device_id =3D cper_test_pci_ids[i]; > + const struct xe_device_guid_entry *actual =3D cper_test_guid_entry(dev= ice_id); > + const struct xe_device_guid_entry *expected =3D > + cper_test_expected_guid_entry(device_id); > + > + KUNIT_ASSERT_NOT_NULL_MSG(test, expected, > + "PCI ID %#06x has no expected GUID", > + device_id); > + KUNIT_ASSERT_NOT_NULL_MSG(test, actual, > + "PCI ID %#06x has no GUID entry", > + device_id); > + KUNIT_EXPECT_TRUE_MSG(test, guid_equal(&actual->guid, &expected->guid), > + "PCI ID %#06x has GUID %pUl, expected %pUl", > + device_id, &actual->guid, &expected->guid); > + } > +} [Severity: Low] Does cper_test_guid_matches_pci_id() just compare xe_device_guids[] against a verbatim copy of itself? cper_test_expected_guids[] duplicates the static xe_device_guids[] table defined in drivers/gpu/drm/xe/xe_cper.c, and cper_test_expected_guid_entry() duplicates the linear search in cper_test_guid_entry(). Because the test compares these two hardcoded tables using test-local helpers, it requires keeping two identical tables in sync without exercising lookup_device_guid() or computing the expected UUIDv5 from "platform/8086:". --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130140815.2227= 101-6-mallesh.koujalagi@intel.com?part=3D4