Home | History | Annotate | only in /device/google/cuttlefish_common/host/libs/ivserver
Up to higher level directory
NameDateSize
Android.bp21-Aug-20181.4K
hald_client.cc21-Aug-20184.3K
hald_client.h21-Aug-20181.6K
hald_client_test.cc21-Aug-20185.4K
ivserver.cc21-Aug-20182.8K
ivserver.h21-Aug-20181.4K
options.cc21-Aug-20181.3K
options.h21-Aug-20181.4K
qemu_client.cc21-Aug-20184.6K
qemu_client.h21-Aug-20182.8K
README.md21-Aug-20182.5K
shm_layout.txt21-Aug-201810K
vsocsharedmem.cc21-Aug-20185.3K
vsocsharedmem.h21-Aug-20181.8K
vsocsharedmem_mock.h21-Aug-20181.1K

README.md

      1 ## Overview
      2 
      3 This is the native ivshmem-server implementation catering to the GCE CVD
      4 vSoC project.
      5 
      6 We are breaking from the general philosophy of ivshmem-server inter-vm
      7 communication.
      8 
      9 There is no concept of inter-vm communication. The server itself is meant to
     10 run on the L1 Guest (or L0 even). We will call this domain as 'host-side'. The
     11 following functions are envisoned:
     12 
     13 * Create the shared-memory window, listen for VM connection (and subsequent
     14   disconnection). Note that the server can only accomodate one VM connection at
     15   a time. This may need to be enforced as there may be mulitple VMs (but each
     16   of them need a dedicated shared_memory and VM <--> server UNIX Domain
     17   sockets).
     18 
     19 * Parse a JSON file describing memory layout and other information. Use
     20   this information to initialize the shared memory.
     21 
     22 * Create two UNIX Domain sockets. One to communicate with QEMU and the other
     23   to communicate with host clients.
     24 
     25 * For QEMU, speak the ivshmem protocol, i.e. pass a vmid, pass the shm fd
     26   to the qemu VM along with event fds. One for host to guest signalling and the
     27   other for guest to host signalling. Please see:
     28   QEMU_SRC/docs/specs/ivshmem-spec.txt. The only twist is that the server
     29   pretends to be another peer VM to comply to the ivshmem protocol.
     30 
     31 * For the client, speak the ad-hoc client protocol:
     32 
     33    ivshmem_client <--> ivshmem_server handshake.
     34 
     35    Client -> 'GET PROTOCOL_VER'
     36    Server -> 'PROTOCOL_VER 0'
     37    Client -> INFORM REGION_NAME_LEN: 0x0000000a
     38    Client -> GET REGION: HW_COMPOSER
     39    Server -> 0xffffffff(If region name not found)
     40    Server -> 0xAABBC000 (region start offset)
     41    Server -> 0xAABBC0000 (region end offset)
     42    Server -> <Send cmsg with guest_to_host eventfd>
     43    Server -> <Send cmsg with host_to_guest eventfd>
     44    Server -> <Send cmsg with shmfd>
     45 
     46  * This also launches QEMU with the appropriate parameters
     47 
     48 Building:
     49   From this directory issue the following in the command line
     50   `bazel build src:ivserver`
     51 
     52 Running:
     53   Once the binary is built using bazel. Just run it from this directory
     54   as the default options expect the JSON files under conf directory.
     55   e.g.
     56   `./bazel-bin/src/ivserver`
     57 
     58   If you encounter either
     59   * Error in creating shared_memory file: File exists
     60   * Bind failed: Address already in use
     61 
     62   Please run the following commands and retry launching.
     63   `rm /dev/shm/ivshmem`
     64   `rm /tmp/ivsh*`
     65 
     66 TODO:
     67  * Refactor.
     68  * Separate the JSON configuration into QEMU and mem-layout specific files.
     69  * Conform to Google coding standards.
     70  * Add some documentation on the default options.
     71  * Fault Tolerance.
     72 
     73