All of lore.kernel.org
 help / color / mirror / Atom feed
* [virtio-comment] Comments on RPMB config space chapter 5.2.14
@ 2022-03-11 13:49 Harald Mommer
  2022-03-11 16:02 ` Huang, Yang
  0 siblings, 1 reply; 5+ messages in thread
From: Harald Mommer @ 2022-03-11 13:49 UTC (permalink / raw)
  To: Alex Bennée, Huang Yang, virtio-comment; +Cc: Lukasz Zawada

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


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-14 14:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-11 13:49 [virtio-comment] Comments on RPMB config space chapter 5.2.14 Harald Mommer
2022-03-11 16:02 ` Huang, Yang
2022-03-11 16:34   ` Harald Mommer
2022-03-14  3:01     ` Huang, Yang
2022-03-14 14:05     ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.