[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discussion] Xen grants and access permissions



On 19.02.23 17:44, Oleksandr Tyshchenko wrote:
Hello Viresh.

[CCed Jürgen who might have some thoughts]
[Sorry for the possible format issues]

On Thu, Feb 16, 2023 at 1:36 PM Andrew Cooper <andrew.cooper3@xxxxxxxxxx <mailto:andrew.cooper3@xxxxxxxxxx>> wrote:

    On 16/02/2023 11:13 am, Viresh Kumar wrote:
     > Hi Oleksandr,
     >
     > As you already know, I am looking at how we can integrate the Xen
     > grants work in our implementation of Rust based Xen vhost frontend [1].
     >
     > The hypervisor independent vhost-user backends [2] talk to
     > xen-vhost-frontend using the standard vhost-user protocol [3]. Every
     > memory region that the backends get access to are sent to it by the
     > frontend as memory region descriptors, which contain only address and
     > size information and lack any permission flags.

There are no permission flags in Xen PV device protocols either. The kind of a
mapping (RO or RW) in the backend is selected via the I/O operation: in case it
is a write type operation (guest writing data to a device), the related grants
are mapper as RO in the backend, in all other cases they are mapped as RW.

The same applies to granted pages for virtio: the frontend side will grant the
page as RO in case the I/O operation is flagged as "DMA_TO_DEVICE", and as RW
in all other cases. The backend should always know, which direction the data is
flowing, so it should be able to do the mapping with the correct access mode.


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.