Attention is currently required from: Nico Huber, Angel Pons. Arthur Heymans 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 15:
(5 comments)
File src/cpu/x86/cache/cache.c:
https://review.coreboot.org/c/coreboot/+/37196/comment/adfd21fb_4816c5ff PS12, Line 16: int
bool?
Done
https://review.coreboot.org/c/coreboot/+/37196/comment/0d31a398_68df3ece PS12, Line 21: ENV_POSTCAR || ENV_RAMSTAGE
`!ENV_CACHE_AS_RAM` might be a good choice, it also covers the […]
Done
https://review.coreboot.org/c/coreboot/+/37196/comment/6458fd9a_c9dcd380 PS12, Line 24: CONFIG(X86_CLFLUSH_CAR)
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); }
I sort of rewrote it.
https://review.coreboot.org/c/coreboot/+/37196/comment/464c0b97_bb3362bc PS12, Line 29: uintptr_t
types. […]
Done
https://review.coreboot.org/c/coreboot/+/37196/comment/650ca424_6dd5006f PS12, Line 33: ram
RAM
Done