linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Huang, Kai" <kai.huang@intel.com>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"dhowells@redhat.com" <dhowells@redhat.com>,
	"sameo@rivosinc.com" <sameo@rivosinc.com>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jarkko@kernel.org" <jarkko@kernel.org>,
	 "bp@alien8.de" <bp@alien8.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	 "peterz@infradead.org" <peterz@infradead.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	 "sathyanarayanan.kuppuswamy@linux.intel.com"
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
	"dionnaglaze@google.com" <dionnaglaze@google.com>,
	 "keyrings@vger.kernel.org" <keyrings@vger.kernel.org>,
	"brijesh.singh@amd.com" <brijesh.singh@amd.com>,
	 "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH 0/4] keys: Introduce a keys frontend for attestation reports
Date: Sat, 05 Aug 2023 07:05:25 -0400	[thread overview]
Message-ID: <a8e491304c28f74d9c8a61de4790e0584c40a19e.camel@HansenPartnership.com> (raw)
In-Reply-To: <ZM0lEvYJ+5IgybLT@redhat.com>

On Fri, 2023-08-04 at 17:19 +0100, Daniel P. Berrangé wrote:
> On Tue, Aug 01, 2023 at 11:45:12AM +0000, Huang, Kai wrote:
> > The IOCTL vs /sysfs isn't discussed.
> > 
> > For instance, after rough thinking, why is the IOCTL better than
> > below approach
> > using /sysfs?
> > 
> > echo <REPORTDATA> > /sys/kernel/coco/tdx/attest/reportdata
> > cat /sys/kernel/coco/tdx/attest/tdreport
> > 
> > Each "echo <REPORTDATA>" to '/sys/.../reportdata' triggers the
> > driver to call
> > TDCALL to get the TDREPORT, which is available at
> > '/sys/.../tdreport'.
> 
> What would you suggest as behaviour with multiple processes writing
> into 'reportdata' and trying to read from 'tdreport' in parallel ?
> Splitting input and output across separate files removes any
> transactional relationship between input and output. This approach
> feels like it could easily result in buggy behaviour from concurrent
> application usage, which would not be an issue with ioctl()

What's the use case where there are multiple outstanding reports?  The
only use case I've currently seen is single external relying party
requesting a report with a challenge.

> Also note, there needs to be scope for more than 1 input and 1 output
> data items. For SNP guests, the VMPL is a input, and if fetching a
> VMPL 0 report from under SVSM [1], an optional service GUID is
> needed. With SVSM, there are three distinct output data blobs -
> attestation report, services manifest and certificate data.

That's quite simple isn't it?  All the possible additional input
parameters appear as files.  If you don't echo anything into them, they
take the default values.  There's usually a single parameter that
causes the transaction to start (usually the nonce) and the transaction
takes the current values from all the files.

I'm not saying sysfs can substitute for all the transactionality of
ioctl, but in this case where everything is low volume and single
threaded it seems a reasonable choice.  For a more volume based
transactional approach, something more configfs like would work better,
so is there a use case for that?

James


  parent reply	other threads:[~2023-08-05 11:05 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 19:30 [PATCH 0/4] keys: Introduce a keys frontend for attestation reports Dan Williams
2023-07-28 19:30 ` [PATCH 1/4] keys: Introduce tsm keys Dan Williams
2023-07-28 19:40   ` Jarkko Sakkinen
2023-07-31 16:33   ` Peter Gonda
2023-07-31 17:48     ` Dan Williams
2023-07-31 18:14       ` Peter Gonda
2023-07-31 18:41         ` Dan Williams
2023-07-31 19:09           ` Dionna Amalie Glaze
2023-07-31 20:10             ` Dan Williams
2023-08-04 16:34           ` Peter Gonda
2023-08-04 22:24             ` Dan Williams
2023-08-05  5:11             ` Dan Williams
2023-08-01 18:01     ` Jarkko Sakkinen
2023-08-04  2:40       ` Dan Williams
2023-08-04 16:37         ` Dionna Amalie Glaze
2023-08-04 16:46           ` James Bottomley
2023-08-04 17:07             ` Dionna Amalie Glaze
2023-08-04 17:12               ` James Bottomley
2023-07-28 19:31 ` [PATCH 2/4] virt: sevguest: Prep for kernel internal {get, get_ext}_report() Dan Williams
2023-07-28 19:31 ` [PATCH 3/4] mm/slab: Add __free() support for kvfree Dan Williams
2023-07-28 19:31 ` [PATCH 4/4] virt: sevguest: Add TSM key support for SNP_{GET, GET_EXT}_REPORT Dan Williams
2023-07-31 16:45   ` Peter Gonda
2023-07-31 18:05     ` Dan Williams
2023-07-31 18:28       ` Peter Gonda
2023-07-28 19:34 ` [PATCH 0/4] keys: Introduce a keys frontend for attestation reports Jarkko Sakkinen
2023-07-28 19:44   ` Dan Williams
2023-07-31 10:09     ` Jarkko Sakkinen
2023-07-31 17:33       ` Dan Williams
2023-07-31 22:41       ` Huang, Kai
2023-08-01 18:48         ` Jarkko Sakkinen
2023-07-29 18:17 ` James Bottomley
2023-07-30  4:56   ` Dan Williams
2023-07-30 12:59     ` James Bottomley
2023-07-31 17:24       ` Dan Williams
2023-08-01 11:45       ` Huang, Kai
2023-08-01 12:03         ` James Bottomley
2023-08-01 12:30           ` James Bottomley
2023-08-02  0:10             ` Huang, Kai
2023-08-02 12:41               ` James Bottomley
2023-08-02 23:13                 ` Huang, Kai
2023-08-04  3:53           ` Dan Williams
2023-08-04  2:22         ` Dan Williams
2023-08-04 16:19         ` Daniel P. Berrangé
2023-08-04 21:49           ` Huang, Kai
2023-08-05 11:05           ` James Bottomley [this message]
2023-08-05  2:37       ` Dan Williams
2023-08-05 13:30         ` James Bottomley
2023-08-07 23:33           ` Dan Williams
2023-08-08 14:19             ` James Bottomley
2023-08-08 14:53               ` Peter Gonda
2023-08-08 14:54               ` Sathyanarayanan Kuppuswamy
2023-08-08 15:48                 ` Dan Williams
2023-08-08 16:07                   ` Dionna Amalie Glaze
2023-08-08 16:43                     ` Dan Williams
2023-08-08 17:21                       ` Dionna Amalie Glaze
2023-08-08 18:17                         ` Dan Williams
2023-08-08 23:32                           ` Huang, Kai
2023-08-09  3:27                             ` Dan Williams
2023-08-09 16:14                               ` Peter Gonda
2023-08-08 18:16                     ` James Bottomley
2023-08-08 18:48                       ` Dionna Amalie Glaze
2023-08-08 19:37                         ` James Bottomley
2023-08-08 20:04                           ` Dionna Amalie Glaze
2023-08-08 21:46                             ` James Bottomley
2023-08-08 22:33                               ` Dionna Amalie Glaze
2023-08-08 15:14               ` Dan Williams
2023-08-10 14:50             ` Jarkko Sakkinen

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=a8e491304c28f74d9c8a61de4790e0584c40a19e.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=berrange@redhat.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dhowells@redhat.com \
    --cc=dionnaglaze@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarkko@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sameo@rivosinc.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).