On Mon, Sep 07, 2020 at 02:52:08PM -0700, James Bottomley wrote: > On Mon, 2020-09-07 at 16:23 +0300, Jarkko Sakkinen wrote: > > On Mon, Sep 07, 2020 at 07:38:24AM +0200, Greg KH wrote: > > > Please just use a binary blob format. Binary sysfs files are > > > exactly what this is for, you are just passing the data through the > > > kernel from the hardware to userspace. > > > > > > You can have 24 binary files if that makes it easier, but the > > > existing format really is an abuse of sysfs. > > There is no existing format for TPM 2.0 ... that's part of the problem > since we certainly didn't want to carry over the TPM 1.2 format. Ok, then no, if there is not already a binary format then you should not use a binary sysfs file as you are then just sending a kernel structure to userspace, not a hardware structure. > I've got to say I think binary attributes are actively evil. I can see > they're a necessity when there's no good way to represent the data they > contain, like the bios measurement log or firmware code or a raw > interface like we do for the SMP frame code in libsas. But when > there's a well understood and easy to produce user friendly non-binary > representation, I think dumping binary is inimical to being a good API. Agreed. thanks, greg k-h