Re: [PATCH] x86/cpufeatures: Add enumeration for serialize instruction

From: Ricardo Neri
Date: Mon Apr 06 2020 - 21:35:37 EST


On Sat, Apr 04, 2020 at 10:28:09AM +0200, Borislav Petkov wrote:
> On Fri, Apr 03, 2020 at 10:20:39PM -0700, Ricardo Neri wrote:
> > Do you mean code in the kernel using this instructions. Thus far, I
> > don't have any kernel use cases for this instruction.
>
> I'm sure you can find at least a couple of places in the kernel
> which use CPUID to serialize and could switch to this new insn with
> alternatives, for example. Or all those memory barrier uses. Would it be
> better to switch to SERIALIZE there? Dunno, but would be good to know.
> And so on.

Yes, I lookede for uses of CPUID for serialization but I didn't find
any. I will look again. I will also look at the memory barrier cases.

Thanks and BR,
Ricardo

>
> > My intention is to expose this instruction to user space via
> > /proc/cpuinfo. Is that not acceptable?
>
> I know what your intention is. What good is the string "serialize" in
> /proc/cpuinfo if nothing uses it?

Wouldn't it be useful for userspace tools to see? Admittedly, the would
be looking at CPUID directly, I think.

Thanks and BR,
Ricardo