Re: [RFC PATCH 10/13] fwctl/cxl: Add support for fwctl RPC command to enable CXL feature commands

Jonathan Cameron
2024-11-19T11:41:47Z

On Wed, 13 Nov 2024 08:41:15 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> On 7/29/24 4:29 AM, Jonathan Cameron wrote:
> > On Thu, 18 Jul 2024 14:32:28 -0700
> > Dave Jiang <dave.jiang@intel.com> wrote:
> >
> >> fwctl provides a fwctl_ops->fw_rpc() callback in order to issue ioctls
> >> to a device. The cxl fwctl driver will start by supporting the CXL
> >> feature commands: Get Supported Features, Get Feature, and Set Feature.
> >
> > I'll come back to this in reply to the cover letter, but this is
> > problematic because some of those features will almost certainly be
> > covered by standard kernel drivers and if Set Feature is enabled
> > those drivers will need to be hardened against the state mysteriously
> > changing under them.
>
> Do we need to have an exclusive_features mask just like exclusive_cmds to block kernel managed features like RAS? That may be the best way to deal with things happening behind kernel's back.

Agreed. Something along those lines should work.
My understandin is we are fine 'breaking' backwards compatibility in
FWCTL interfaces if we decide later that something isn't safe for it to access.

Mind you we can probably make a reasonable starting guess + restrict anything
in the non-vendor ranges that isn't yet defined.
Things get messier for defacto standards if any of them surface as we may
have kernel support upstream for those in the future but not initially.

>
> >
> > This corner is the bit that worries me most about fwctl in general.
> > Anyhow, one for the cover letter / policy discussion not deep
> > in the patch series.
>
> Need to add a documentation patch and maybe we can put policies and rules in there?

Even better.

Jonathan