Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37196 )
Change subject: cpu/x86/cache: CLFLUSH programs to memory before running
......................................................................
Patch Set 13:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37196/12/src/cpu/x86/cache/cache.c
File src/cpu/x86/cache/cache.c:
https://review.coreboot.org/c/coreboot/+/37196/12/src/cpu/x86/cache/cache.c@...
PS12, Line 24: CONFIG(X86_CLFLUSH_CAR)
I'm curious, does the compiler optimize it differently? […]
I'm not sure if the compiler can infer that cpuid_edx has no side-effect, so it may not be able to optimize out the code as-is.
In any case, I'd write this function as follows:
bool clflush_supported(void)
{
/* CLFLUSH while operating in CAR might not be supported by platforms */
if (ENV_CACHE_AS_RAM && !CONFIG(X86_CLFLUSH_CAR))
return false;
return !!(cpuid_edx(1) >> CPUID_FEATURE_CLFLUSH_BIT);
}
--
To view, visit
https://review.coreboot.org/c/coreboot/+/37196
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7ff2a57aee620908b71829457ea0f5a0c410ec5b
Gerrit-Change-Number: 37196
Gerrit-PatchSet: 13
Gerrit-Owner: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Arthur Heymans
arthur@aheymans.xyz
Gerrit-Reviewer: Marshall Dawson
marshalldawson3rd@gmail.com
Gerrit-Reviewer: Martin Roth
martinroth@google.com
Gerrit-Reviewer: Patrick Georgi
pgeorgi@google.com
Gerrit-Reviewer: Paul Menzel
paulepanter@users.sourceforge.net
Gerrit-Reviewer: Subrata Banik
subrata.banik@intel.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Aaron Durbin
adurbin@chromium.org
Gerrit-CC: Angel Pons
th3fanbus@gmail.com
Gerrit-CC: Nico Huber
nico.h@gmx.de
Gerrit-Comment-Date: Sat, 05 Dec 2020 18:35:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber
nico.h@gmx.de
Comment-In-Reply-To: Angel Pons
th3fanbus@gmail.com
Gerrit-MessageType: comment