From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5E7818054 for ; Fri, 4 Aug 2023 16:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691165979; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Onl29uqYKQczYTkd1xGh14ew9gorV8noJaPJyrbKPr0=; b=iWvYqIwxVq4UcF1a3G2oZPoGKpqsJmDKkMbKrJejZUUK7k7eBACGltnd5S4M8P0Zqb3x7P Kw7nqfvrjPA2SUKQFQtUiPlzVuHf87gfIT+RZx1TnE2sXP/HH4lnYM0uXJ/5c4JDGndRgo KdImHhSc/Qf0xG3vC2CqRYBHEIC8VbI= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-K9vtuh7SNyya7lbxdn1nIw-1; Fri, 04 Aug 2023 12:19:36 -0400 X-MC-Unique: K9vtuh7SNyya7lbxdn1nIw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F0888280D59E; Fri, 4 Aug 2023 16:19:34 +0000 (UTC) Received: from redhat.com (unknown [10.42.28.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A59A9200A7CA; Fri, 4 Aug 2023 16:19:32 +0000 (UTC) Date: Fri, 4 Aug 2023 17:19:30 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: "Huang, Kai" Cc: "Williams, Dan J" , "James.Bottomley@HansenPartnership.com" , "dhowells@redhat.com" , "sameo@rivosinc.com" , "linux-kernel@vger.kernel.org" , "jarkko@kernel.org" , "bp@alien8.de" , "gregkh@linuxfoundation.org" , "peterz@infradead.org" , "akpm@linux-foundation.org" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "thomas.lendacky@amd.com" , "dionnaglaze@google.com" , "keyrings@vger.kernel.org" , "brijesh.singh@amd.com" , "linux-coco@lists.linux.dev" , "x86@kernel.org" Subject: Re: [PATCH 0/4] keys: Introduce a keys frontend for attestation reports Message-ID: Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <169057265210.180586.7950140104251236598.stgit@dwillia2-xfh.jf.intel.com> <64c5ed6eb4ca1_a88b2942a@dwillia2-xfh.jf.intel.com.notmuch> <6dec442c64faf2fecd21bcc77e4a6350e88948b9.camel@intel.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6dec442c64faf2fecd21bcc77e4a6350e88948b9.camel@intel.com> User-Agent: Mutt/2.2.9 (2022-11-12) X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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 > /sys/kernel/coco/tdx/attest/reportdata > cat /sys/kernel/coco/tdx/attest/tdreport > > Each "echo " 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() 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. With regards, Daniel [1] https://www.amd.com/system/files/TechDocs/58019_1.00.pdf -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|