From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796393509; b=DyN/ejPejvvYR+jpQzh/zNDMgsT3WRAEE+TYvd255kzmIfUlb/YbsZNRuXgRbC2SW+NV e0uxdLYiKmNBxM4QLULTctpyu//a/THwskVDckIV8ZAxpPXzDF60+lhdTGYf1EcaUw8Mc yLNRwWzgv0aj7+8SkOYR0bGMSGY1mc/MFcgKzFbsMqqRDbrLpk/wZFF+wMOaanMNl0o3X JKViJY8N4yLQUse2YMmwhPzjBVoi9Oib2fhNrAS2cUbIkqLx6pgBVjn0k1k0Fw2sLKChs y4iJBavBbaF2ptWIPVyIIo9A5261Ma7v/yj/dScuceUzT363YU+KTvo2wi+d05swtiQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393509; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=23cDlpczU6Xyvd87wzrNYvfPXI6cCmj9I83l3NtSSdU=; b=nzirmcL43SXyuxABdhY6n3kPdPJ2eLWK45CLUyB7pt/ACsUFHakuCJwL8CtRmBMVBOH/ ekkK/m0/VEhDaInr577yN5mDbWIol/3CeJ7RN0TqGk3suKeCx7CYJDHjkp7MnePQcSuF7 eUmF2WQLqjFympDBsqSA5BN62jLuV0brMbumboi8xTnMpyl+j7s57YNMCG7nlrI3XJRNb rhCBKTMqchX3NK7IQym8EQak9szIzH5FUN0/qy+2Ww7FMXjBolBLSV0GgXaLqJXoQewmF EPqMe4kpKhZlzBHfBu+fL3aqPON3QD7OUf+sZqe2WkC1uWCKcvyZJv0UoLq8YtSYhzg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=BD1Bx1ky; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDBD4606A322; Fri, 4 Dec 2026 14:11:49 +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=BD1Bx1ky Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36A9E1F000C2; Fri, 4 Dec 2026 14:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796393509; bh=23cDlpczU6Xyvd87wzrNYvfPXI6cCmj9I83l3NtSSdU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=BD1Bx1kynr/kUed2IEbNPLivLkr3J6br/xHxYSW4yTS9hjojkfKxrft44hYv1zwu5 6IDokNsnbr6J9awrrC0D+kM/zgRs1W5a35DIj2QgJutklXAyjBvnFl9LBcadHOeA8p hr0DbrVkCAqwDeYM2Kgxf86/QStoqueKzLKVLTRda0Lh5HIl2ocCmvGf1dW4xb3vWz IJ9s/F5e+FfdL1YgqHXgdKkt3gMPg3AcujsBGCcGVQNIKusgXJ1aFO+7mWV0OQAxQl XUEgLTKsvtOgXTAwyGMJ3OvWOS9BF4m3IhFJ2nTodgHSTfmsfkJwY+iAtGtwyTuBux 4bQnoYdPrOIkw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 08/14] treewide: Add a flag to detect the Apple T2 chip Reply-To: sashiko-reviews@lists.linux.dev To: "Atharva Tiwari" Cc: "Aditya Garg" , "Bjorn Helgaas" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , "Len Brown" , "Linus Walleij" , "Bartosz Golaszewski" , "Sven Peter" , "Janne Grunau" , "Neal Gompa" , "Guenter Roeck" , "Jonathan Cameron" , "David Lechner" , =?utf-8?b?TnVubyBTw6E=?= , "Andy Shevchenko" , "Lee Jones" , "Pavel Machek" , "Griffin Kroah-Hartman" , "Hans de Goede" , =?utf-8?b?SWxwbyBKw6RydmluZW4=?= , "Sebastian Reichel" , "Alexandre Belloni" , "Wim Van Sebroeck" , "Jarkko Sakkinen" , "Mimi Zohar" , "Roberto Sassu" , "Dmitry Kasatkin" , "Eric Snowberg" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-leds@vger.kernel.org, mfd@lists.linux.dev, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org In-Reply-To: <20261204131619.5059-9-atharvatiwarilinuxdev@gmail.com> References: <20261204131619.5059-1-atharvatiwarilinuxdev@gmail.com> <20261204131619.5059-9-atharvatiwarilinuxdev@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 14:11:46 +0000 X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Low] x86: inconsistent naming and missing __ro_after_init on has_apple_t2_chip - [Low] x86: open-coded match_string(), early return, and __initconst style - [Low] x86/apple: missing var keyword in has_apple_t2_chip kernel-doc comment - [Low] treewide: commit message omits load_uefi.c refactoring and export context -- commit a2285f7954298eb43ab5023f81b0b6900c8dde80 Author: Atharva Tiwari > treewide: Add a flag to detect the Apple T2 chip > > Add a flag to detect Apple T2 chips on Intel Macs. > Cache the result to avoid repeated checks. That will > be used in upcoming patches. > > Tested-by: Aditya Garg > Signed-off-by: Atharva Tiwari [Severity: Low] Should the commit message mention that this patch also converts load_uefi_certs() in security/integrity/platform_certs/load_uefi.c to use has_apple_t2_chip and removes uefi_skip_cert and UEFI_QUIRK_SKIP_CERT? It would also help reviewers to note which upcoming drivers or runtime paths need has_apple_t2_chip exported globally. > diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c > index a92f18db96100..6651e5d4d106f 100644 > --- a/arch/x86/kernel/quirks.c > +++ b/arch/x86/kernel/quirks.c > @@ -664,8 +664,45 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2083,= quirk_intel_purley_xeon_ras > bool x86_apple_machine; > EXPORT_SYMBOL(x86_apple_machine); > =20 > +bool has_apple_t2_chip; > +EXPORT_SYMBOL(has_apple_t2_chip); [Severity: Low] Should this flag keep the x86_apple_ prefix from x86_apple_machine (such as x86_apple_t2 or x86_apple_t2_machine)? Because x86/apple.h defines it to false when CONFIG_X86 is disabled, an unprefixed name is misleading on arm64 kernels running on Apple T2 SoC hardware. Since has_apple_t2_chip is only written during early_platform_quirks(), it can also be marked __ro_after_init. > + > +static const char * const __initconst apple_t2_models[] =3D { > + "MacBookPro15,1", [ ... ] > + "iMacPro1,1", > +}; > + > void __init early_platform_quirks(void) > { > x86_apple_machine =3D dmi_match(DMI_SYS_VENDOR, "Apple Inc.") || > dmi_match(DMI_SYS_VENDOR, "Apple Computer, Inc."); > + > + if (x86_apple_machine) { > + const char *product_name =3D dmi_get_system_info(DMI_PRODUCT_NAME); > + int i; > + > + if (!product_name) > + return; > + > + for (i =3D 0; i < ARRAY_SIZE(apple_t2_models); i++) { > + if (!strcmp(product_name, apple_t2_models[i])) { > + has_apple_t2_chip =3D true; > + break; > + } > + } > + } > } [Severity: Low] Could this loop reuse match_string(apple_t2_models, ARRAY_SIZE(apple_t2_models), product_name) >=3D 0? Returning early when product_name is NULL also exits early_platform_quirks() entirely, which would skip any future quirks added after this block. Also, per include/linux/init.h, __initconst belongs between the variable name and "=3D" (apple_t2_models[] __initconst =3D). Note that an array of pointers only puts the pointer table in .init.rodata while leaving the model strings in permanent .rodata. > diff --git a/include/linux/platform_data/x86/apple.h b/include/linux/plat= form_data/x86/apple.h > index 079e816c3c219..47b27dceab18c 100644 > --- a/include/linux/platform_data/x86/apple.h > +++ b/include/linux/platform_data/x86/apple.h > @@ -6,8 +6,13 @@ > * x86_apple_machine - whether the machine is an x86 Apple Macintosh > */ > extern bool x86_apple_machine; > +/** > + * has_apple_t2_chip - whether the machine has the Apple T2 chip > + */ > +extern bool has_apple_t2_chip; [Severity: Low] Does this kernel-doc comment need the "var" keyword ("* var has_apple_t2_chip - ...")? Without it, scripts/kernel-doc parses the declaration as a function and emits a "cannot understand function prototype" warning. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204131619.5059= -1-atharvatiwarilinuxdev@gmail.com?part=3D8