Re: [PATCH 2/2] x86/cpufeatures: Add macros for Intel's new fast rep string features

From: Dave Hansen
Date: Thu Feb 03 2022 - 15:25:50 EST


On 2/3/22 11:43, Jim Mattson wrote:
> Even if no one else cares, these features should be exposed to kvm
> guests, and the code for the KVM_GET_SUPPORTED_CPUID ioctl is more
> readable if the bits have corresponding X86_FEATURE macros.

I went digging around KVM_GET_SUPPORTED_CPUID and didn't see any obvious
unreadable things resulting from not having these defines. Maybe I'm
looking in the wrong spot. Do you have a slightly more specific pointer?

> +#define X86_FEATURE_FZRM (12*32+10) /* Fast zero-length REP MOVSB */
> +#define X86_FEATURE_FSRS (12*32+11) /* Fast short REP STOSB */
> +#define X86_FEATURE_FSRC (12*32+12) /* Fast short REP {CMPSB,SCASB} */

If the use really is for inside the kernel, maybe we should hide them
from cpuinfo:

#define X86_FEATURE_FSRC (12*32+12) /* "" Fast short REP {CMPSB,SCASB} */