[HVWS] Sensor access from virtual machines

Gunnar Andersson gandersson at genivi.org
Wed Sep 19 05:12:52 EDT 2018


Artem, and all,

I received from Artem some early proposal of a protocol for communicating
with "virtual sensors"  (Thanks!)  We should look at it together soon.

But I wanted first to open some questions here and ask if they make sense to
you.

This generic protocol definition makes sense to me for a lot of sensors that
will provide data measurement values of different kinds.  (VIRTIO seems to
do this quite well also - to generalize the concepts first and provide a
data transfer principle that can be applied to many different detailed
hardware, instead of being specific for each.)

But I noticed when I was contemplating this I was thinking more low-level... 
How a "sensor" is actually attached to the hardware itself, and then how
does access to that hardware become virtualized?  Could there be, and should
there be a low-level API to it from the VM?

What if you drop down to the level of simple microcontrollers with digital
I/O pins.  Leaving aside for now that small microcontrollers don't usually
run virtual machines, but the same things turn up also on larger SoCs.  SoCs
might at least provide some direct I/O pins.

So, if the sensor is not intelligent enough to provide some kind of network
or serial link, then might it in certain cases it might be as simple as
digital pin I/O?  Is that actual access hidden totally by the Hypervisor and
providing the data through a protocol like the one you propose or is there
interest in a more "direct" access?

Transformed into a concrete question: Is there a virtualization standard for
pin I/O, perhaps mirroring the Linux PINCTRL subsystem?  Maybe I'm
overthinking this and such I/O will simply be set up as "passthrough" - but
that's also something that needs then to be decided, and it still needs a
defined method and API, right?

Other typical I/O on microcontrollers or SoCs would be things like PWM
(output) ports, and A/D (input) or D/A (output) conversion.  What do such
hardware features lead to if we are thinking about the virtual interface to
them?   Do those need to be handled?

Best Regards,
- Gunnar


-- 
Gunnar Andersson <gandersson at genivi.org>
Development Lead
GENIVI Alliance





More information about the genivi-projects mailing list