mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@amd.com>
To: Alistair Francis <Alistair.Francis@wdc.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"alistair23@gmail.com" <alistair23@gmail.com>
Cc: "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"ojeda@kernel.org" <ojeda@kernel.org>,
	"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
	"a.hindborg@kernel.org" <a.hindborg@kernel.org>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	Wilfred Mallawa <wilfred.mallawa@wdc.com>,
	"tmgross@umich.edu" <tmgross@umich.edu>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"benno.lossin@proton.me" <benno.lossin@proton.me>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"jgg@nvidia.com" <jgg@nvidia.com>,
	"bjorn3_gh@protonmail.com" <bjorn3_gh@protonmail.com>,
	"lukas@wunner.de" <lukas@wunner.de>,
	"alex.gaynor@gmail.com" <alex.gaynor@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"aliceryhl@google.com" <aliceryhl@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"gary@garyguo.net" <gary@garyguo.net>
Subject: Re: [PATCH v6 01/25] virt: coco: change tsm_register() to use a const struct
Date: Fri, 20 Nov 2026 15:28:39 +1100	[thread overview]
Message-ID: <25cc74e4-9d30-46b9-b6bd-59b3d43707b6@amd.com> (raw)
In-Reply-To: <ced5751ca6fb905c73d0ec61510a65ad859cfa8c.camel@wdc.com>

On 12/11/26 14:16, Alistair Francis wrote:
> On Thu, 2026-11-12 at 02:39 +0000, Jonathan Cameron wrote:
>> On Tue, 10 Nov 2026 14:18:08 +1000
>> alistair23@gmail.com wrote:
>>
>>> From: Alistair Francis <alistair.francis@wdc.com>
>>>
>>> The tsm_register() function takes a struct pci_tsm_ops *ops
>>> argument.
>>> This eventually is stored in struct tsm_dev as a const, so we
>>> should
>>> just change the tsm_register() register function argument to be a
>>> const.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
>> An ops structure that is just function pointers definitely wants to
>> be const (and it would be a less than ideal design if it mixed
>> other things with those function pointers!).
>>
>> Makes sense as a stand alone change.  Maybe one that can be picked
>> up sooner than the rest?
> 
> I sent it out previously, but no traction:
> 
> https://patchew.org/linux/20260911024707.3485954-1-alistair.francis@wdc.com/


I'll pick it up, thanks!


> 
> Alistair
> 
>>
>> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
>>> ---
>>>   drivers/crypto/ccp/sev-dev-tsm.c | 2 +-
>>>   drivers/virt/coco/tsm-core.c     | 4 ++--
>>>   include/linux/tsm.h              | 2 +-
>>>   3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/crypto/ccp/sev-dev-tsm.c
>>> b/drivers/crypto/ccp/sev-dev-tsm.c
>>> index 46f2539d2d5ab..48df8c579c74d 100644
>>> --- a/drivers/crypto/ccp/sev-dev-tsm.c
>>> +++ b/drivers/crypto/ccp/sev-dev-tsm.c
>>> @@ -339,7 +339,7 @@ static void dsm_disconnect(struct pci_dev
>>> *pdev)
>>>   	streams_teardown(dev_data->ide);
>>>   }
>>>   
>>> -static struct pci_tsm_ops sev_tsm_ops = {
>>> +static const struct pci_tsm_ops sev_tsm_ops = {
>>>   	.probe = dsm_probe,
>>>   	.remove = dsm_remove,
>>>   	.connect = dsm_connect,
>>> diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-
>>> core.c
>>> index e784993353d8f..6b735ac2a814e 100644
>>> --- a/drivers/virt/coco/tsm-core.c
>>> +++ b/drivers/virt/coco/tsm-core.c
>>> @@ -57,7 +57,7 @@ static struct tsm_dev *alloc_tsm_dev(struct
>>> device *parent)
>>>   }
>>>   
>>>   static struct tsm_dev *tsm_register_pci_or_reset(struct tsm_dev
>>> *tsm_dev,
>>> -						 struct
>>> pci_tsm_ops *pci_ops)
>>> +						 const struct
>>> pci_tsm_ops *pci_ops)
>>>   {
>>>   	int rc;
>>>   
>>> @@ -78,7 +78,7 @@ static struct tsm_dev
>>> *tsm_register_pci_or_reset(struct tsm_dev *tsm_dev,
>>>   	return tsm_dev;
>>>   }
>>>   
>>> -struct tsm_dev *tsm_register(struct device *parent, struct
>>> pci_tsm_ops *pci_ops)
>>> +struct tsm_dev *tsm_register(struct device *parent, const struct
>>> pci_tsm_ops *pci_ops)
>>>   {
>>>   	struct tsm_dev *tsm_dev __free(put_tsm_dev) =
>>> alloc_tsm_dev(parent);
>>>   	struct device *dev;
>>> diff --git a/include/linux/tsm.h b/include/linux/tsm.h
>>> index 381c53244c835..6ac12de8c4d36 100644
>>> --- a/include/linux/tsm.h
>>> +++ b/include/linux/tsm.h
>>> @@ -120,7 +120,7 @@ DEFINE_FREE(put_tsm_dev, struct tsm_dev *,
>>>   
>>>   int tsm_report_register(const struct tsm_report_ops *ops, void
>>> *priv);
>>>   int tsm_report_unregister(const struct tsm_report_ops *ops);
>>> -struct tsm_dev *tsm_register(struct device *parent, struct
>>> pci_tsm_ops *ops);
>>> +struct tsm_dev *tsm_register(struct device *parent, const struct
>>> pci_tsm_ops *ops);
>>>   void tsm_unregister(struct tsm_dev *tsm_dev);
>>>   struct tsm_dev *find_tsm_dev(int id);
>>>   #endif /* __TSM_H */

-- 
Alexey


  reply	other threads:[~2026-11-20  4:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  4:18 [PATCH v6 00/25] lib: Rust implementation of SPDM alistair23
2026-11-10  4:18 ` [PATCH v6 01/25] virt: coco: change tsm_register() to use a const struct alistair23
2026-11-12  2:39   ` Jonathan Cameron
2026-11-12  3:16     ` Alistair Francis
2026-11-20  4:28       ` Alexey Kardashevskiy [this message]
2026-11-10  4:18 ` [PATCH v6 02/25] rust: create basic untrusted data API alistair23
2026-11-10  4:18 ` [PATCH v6 03/25] rust: validate: add `Validate` trait alistair23
2026-11-10  4:18 ` [PATCH v6 04/25] X.509: Make certificate parser public alistair23
2026-11-10  4:18 ` [PATCH v6 05/25] X.509: Parse Subject Alternative Name in certificates alistair23
2026-11-10  4:18 ` [PATCH v6 06/25] X.509: Move certificate length retrieval into new helper alistair23
2026-11-10  4:18 ` [PATCH v6 07/25] rust: add bindings for hash.h alistair23
2026-11-10  4:18 ` [PATCH v6 08/25] rust: device: Expose Device as_raw() publicly alistair23
2026-11-10  4:18 ` [PATCH v6 09/25] lib: rspdm: Initial commit of Rust SPDM alistair23
2026-11-10  4:18 ` [PATCH v6 10/25] PCI/TSM: Rename pf0 to host alistair23
2026-11-10  4:18 ` [PATCH v6 11/25] PCI/TSM: Support connecting to PCIe CMA devices alistair23
2026-11-10  4:18 ` [PATCH v6 12/25] PCI/CMA: Add a PCI TSM CMA driver using SPDM alistair23
2026-11-10  4:18 ` [PATCH v6 13/25] PCI/CMA: Validate Subject Alternative Name in certificates alistair23
2026-11-10  4:18 ` [PATCH v6 14/25] lib: rspdm: Support SPDM get_version alistair23
2026-11-10  4:18 ` [PATCH v6 15/25] lib: rspdm: Support SPDM get_capabilities alistair23
2026-11-10  4:18 ` [PATCH v6 16/25] rust: kernel: Add crypto hash bindings alistair23
2026-11-10  4:18 ` [PATCH v6 17/25] lib: rspdm: Support SPDM negotiate_algorithms alistair23
2026-11-10  4:18 ` [PATCH v6 18/25] lib: rspdm: Support SPDM get_digests alistair23
2026-11-10  4:18 ` [PATCH v6 19/25] lib: rspdm: Support SPDM get_certificate alistair23
2026-11-10  4:18 ` [PATCH v6 20/25] rust: public_key: Add crypto public key bindings alistair23
2026-11-10  4:18 ` [PATCH v6 21/25] keys: Guard asymmetric-type.h behind CONFIG_KEYS alistair23
2026-11-10  4:18 ` [PATCH v6 22/25] rust: x509: Add X509 certificate bindings alistair23
2026-11-10  4:18 ` [PATCH v6 23/25] lib: rspdm: Support SPDM certificate validation alistair23
2026-11-10  4:18 ` [PATCH v6 24/25] lib: rspdm: Support SPDM challenge alistair23
2026-11-10  4:18 ` [PATCH v6 25/25] lib: rspdm: Expose public Rust API alistair23

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25cc74e4-9d30-46b9-b6bd-59b3d43707b6@amd.com \
    --to=aik@amd.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=a.hindborg@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=alistair23@gmail.com \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@nvidia.com \
    --cc=jic23@kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=wilfred.mallawa@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®