# Re: \[PATCH 01/11\] mm: Introduce a function to check for virtualization protection features

- From: Borislav Petkov \<bp@alien8.de\>
- Date: 2021-07-28 16:27:58 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/07/211184
- Thread: https://ratatoskr.run/linuxppc-dev/2021/07/211118/t.md

```text
On Wed, Jul 28, 2021 at 02:17:27PM +0100, Christoph Hellwig wrote:
> So common checks obviously make sense, but I really hate the stupid
> multiplexer.  Having one well-documented helper per feature is much
> easier to follow.

We had that in x86 - it was called cpu_has_<xxx> where xxx is the
feature bit. It didn't scale with the sheer amount of feature bits that
kept getting added so we do cpu_feature_enabled(X86_FEATURE_XXX) now.

The idea behind this is very similar - those protected guest flags
will only grow in the couple of tens range - at least - so having a
multiplexer is a lot simpler, I'd say, than having a couple of tens of
helpers. And those PATTR flags should have good, readable names, btw.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
```
