Re: [PATCHv3.1 2/32] x86/coco: Explicitly declare type of confidential computing platform

From: Borislav Petkov
Date: Mon Feb 21 2022 - 07:05:38 EST


On Mon, Feb 21, 2022 at 02:44:51PM +0300, Kirill A. Shutemov wrote:
> Hm. Isn't 'vendor' too generic? It may lead to name conflict in the
> future.

It's a static variable visible only in this unit.

> What is wrong with cc_vendor here? I noticed that you don't like name of
> a variable to match type name. Why?

Because when I look at the name I don't know whether it is the type or a
variable of that type. Sure, sure, it depends on the context but let's
make it as non-ambiguous as possible.

> Currently cc_platform_has() relies on hv_is_isolation_supported() which
> checks for !HV_ISOLATION_TYPE_NONE. This is direct transfer to the new
> scheme. It might be wrong, but it is not regression.

I didn't say it is a regression - I'm just wondering why.

Thx.

--
Regards/Gruss,
Boris.

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