On 1/10/21 6:31 PM, Roman Bolshakov wrote: >> Also, if we're going to put this some place common, forcing the caller to do >> the cpuid that feeds this, then we should probably make all of the startup >> cpuid stuff common as well. >> > > I proposed the version because all callers of xgetbv instruction already > call cpuid before invoking inline xgetbv. > >> Note that we'd probably have to use constructor priorities to get that right >> for util/bufferiszero.c. >> > > Please correct me if I read this wrong. What you're saying is we should > initialize cpuid in constructors and then use cached cpuid ecx in > xgetbv() (and drop one argument, respectively)?
I would have xgetbv and all of the cpuid values cached at startup, and all three places would read global variables. r~