OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [virtio-comment] Comments on RPMB config space chapter 5.2.14


Hello,

the RPMB specification chapter 5.2.14 "Device configuration layout" says the following:

All fields of this configuration are always available and read-only for the driver.

struct virtio_rpmb_config {
 u8 capacity;
 u8 max_wr_cnt;
 u8 max_rd_cnt;
}

capacity is the capacity of the device (expressed in 128KB units). The values MUST range between 0x00
and 0x80 inclusive.

max_wr_cnt and max_rd_cnt are the maximum numbers of RPMB block count (256B) that can be performed
to device in one request. 0 implies no limitation.

==

1.) We have an underlying physical RPMB device we would like to forward to a virtual machine via virtio RPMB. Looks like the physical device has a capacity of 256. 256 > 0x80. And 256 also does not fit in the u8 capacity of the structure. Thinking now of cutting to 0x80 to fulfill the exact wording of the specification. Alternatively we might violate the specification and cut to 255 which is the biggest value still fitting in u8 capacity. But nothing of this is satisfying.

2.) Looking at the specification the maximum RPMB block count is 256. In our case the physical device seems to have a max_wr_cnt and max_wr_cnt of 1 so we actually don't have a problem here with the value range of an u8. But strictly speaking 256 which is still an allowed value does also not fit into an u8 so for a physical device allowing a block count of 256 a cut down to 255 would have to be done. Nice is different.

It would have been better if all the u8 in the config space were le16 not to have those value range problems now. But now it is as it is so I've to cut down now (still unsure which capacity limit to choose) in our implementation. But this is now only working around a specification flaw which should be addressed at some time in the specification itself.

Looking forward to get some comments on this.

Regards
Harald

--
Dipl.-Ing. Harald Mommer
Senior Software Engineer

OpenSynergy GmbH
Rotherstr. 20, 10245 Berlin

Phone:  +49 (30) 60 98 540-0 <== Zentrale
Fax:    +49 (30) 60 98 540-99
E-Mail: harald.mommer@opensynergy.com

www.opensynergy.com

Handelsregister: Amtsgericht Charlottenburg, HRB 108616B
GeschÃftsfÃhrer/Managing Director: Regis Adjamah



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]