Attention is currently required from: Felix Held, Jérémy Compostella, Maximilian Brune, Naresh Solanki, Patrick Rudolph, Paul Menzel.
Angel Pons has posted comments on this change by Naresh Solanki. ( https://review.coreboot.org/c/coreboot/+/85640?usp=email )
Change subject: soc/amd/glinda/cpu: Implement soc_fill_cpu_cache_info helper
......................................................................
Patch Set 4:
(1 comment)
File src/soc/amd/glinda/cpu.c:
https://review.coreboot.org/c/coreboot/+/85640/comment/309f493e_bcc11bc1?usp... :
PS4, Line 41: __fls(info->num_cores_shared-1);
Yes __fls it uses log2.
What Max suggests is using `log2()` since that's what the spec says. Especially considering that `__fls()` literally just calls `log2()`: https://github.com/coreboot/coreboot/blob/8bb59ca2faee83ba50850900c8b4edf933...
```
static inline int __fls(u32 x) { return log2(x); }
```
I agree with this change and I would also add spaces around the `-`:
```suggestion
info->unique_id = cpuid_cpu_id >> log2(info->num_cores_shared - 1);
```
Though now I wonder, is `info->num_cores_shared` ever 0? (Subtracting would underflow) And is it ever 1? (`log2(0)` is -1, IIRC negative shifts are undefined behaviour)
--
To view, visit
https://review.coreboot.org/c/coreboot/+/85640?usp=email
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I46947e8ac62c903036a81642e03201e353c3dac6
Gerrit-Change-Number: 85640
Gerrit-PatchSet: 4
Gerrit-Owner: Naresh Solanki
naresh.solanki@9elements.com
Gerrit-Reviewer: Angel Pons
th3fanbus@gmail.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Felix Held
felix-coreboot@felixheld.de
Gerrit-CC: Jérémy Compostella
jeremy.compostella@intel.com
Gerrit-CC: Maximilian Brune
maximilian.brune@9elements.com
Gerrit-CC: Patrick Rudolph
patrick.rudolph@9elements.com
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Patrick Rudolph
patrick.rudolph@9elements.com
Gerrit-Attention: Jérémy Compostella
jeremy.compostella@intel.com
Gerrit-Attention: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Maximilian Brune
maximilian.brune@9elements.com
Gerrit-Attention: Naresh Solanki
naresh.solanki@9elements.com
Gerrit-Attention: Felix Held
felix-coreboot@felixheld.de
Gerrit-Comment-Date: Tue, 25 Feb 2025 18:34:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Maximilian Brune
maximilian.brune@9elements.com
Comment-In-Reply-To: Naresh Solanki
naresh.solanki@9elements.com