2022-02-04 14:52:42

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH V5 1/3] platform/x86: Add Intel Software Defined Silicon driver

On Thu, 2022-02-03 at 21:30 -0800, David E. Box wrote:
> Intel Software Defined Silicon (SDSi) is a post manufacturing mechanism for
> activating additional silicon features. Features are enabled through a
> license activation process.

Why isn't this a user process and not a kernel one?

> V5
> - Update kernel version to 5.18 in API doc and copyrights to 2022.
> - Remove unneeded prototypes.
> - In binary attribute handlers where ret is only used for errors,
> replace,
> return (ret < 0) ? ret : size;
> with,
> return ret ?: size;

I think this style overly tricky.

Why not the canonical:

if (ret < 0)
return ret;

return size;



2022-02-08 04:09:37

by David E. Box

[permalink] [raw]
Subject: Re: [PATCH V5 1/3] platform/x86: Add Intel Software Defined Silicon driver

On Fri, 2022-02-04 at 02:14 -0800, Joe Perches wrote:
> On Thu, 2022-02-03 at 21:30 -0800, David E. Box wrote:
> > Intel Software Defined Silicon (SDSi) is a post manufacturing mechanism for
> > activating additional silicon features. Features are enabled through a
> > license activation process.
>
> Why isn't this a user process and not a kernel one?

This is a mechanism for provisioning CPU features during runtime. It requires a
driver to access the functionality. That functionality is discovered on a multi
functional PCI device that is owned by the upstream intel_vsec driver.

>
> > V5
> > - Update kernel version to 5.18 in API doc and copyrights to 2022.
> > - Remove unneeded prototypes.
> > - In binary attribute handlers where ret is only used for errors,
> > replace,
> > return (ret < 0) ? ret : size;
> > with,
> > return ret ?: size;
>
> I think this style overly tricky.
>
> Why not the canonical:
>
> if (ret < 0)
> return ret;
>
> return size;

I can see not using the 2 parameter shortcut of the ternary operator, but the
regular 3 parameter expression is easy to read for simple operations.

David

>
>