Jailhouse inter-partition communication method

By combining static configuration of FIFO ring buffer and ivshmem virtual PCI devices, the real-time and security problems of jailhouse inter-partition communication are solved, and efficient and controllable inter-partition communication is achieved, which is suitable for multi-partition embedded systems.

CN120256030AActive Publication Date: 2025-07-04KYLIN CORP

Patent Information

Application Number
CN202510757417.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-07-04
Estimated Expiration
2045-06-09

AI Technical Summary

Technical Problem

The existing jailhouse inter-partition communication mechanism has shortcomings in real-time, certainty and security, especially in communication environments such as embedded, industrial control and edge computing, which are difficult to meet high requirements.

Method used

The statically configured FIFO ring buffer structure is adopted, combined with the ivshmem virtual PCI device and the Doorbell interrupt mechanism, and the unified communication interface is encapsulated through the ivshm_que_driver to realize lock-free and non-blocking inter-partition communication.

Benefits of technology

It significantly improves the real-time, certainty and security of communications, and is suitable for high-frequency, small data volume, and low latency security critical scenarios, meeting strict requirements in the fields of aerospace and industrial control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256030A_ABST
    Figure CN120256030A_ABST
Patent Text Reader

Abstract

The invention discloses a method for communication between jailhome partitions. The method comprises the following steps: configuring a jailhome cell configuration file according to hardware platform resources and task requirements in a cell; compiling and operating jailhouse, starting an inmate cell, and completing registration of a destination port and a source port and memory mapping of an FIFO annular buffer area; sending data to the virtual PCI device through a source port, filling in a Doorbell register after data sending is completed, and sending an interrupt signal to a destination port through a Hypervisor; reading data from the virtual PCI device through the destination port; and after the application program of the destination port receives the data, executing the predefined task. According to the method, the controllability, verifiability and adaptation flexibility of communication behaviors are enhanced, and the method is suitable for safety key scenes with strict requirements for high-frequency, small-data-volume, low-delay and deterministic communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of communication architectures in virtualized environments, and particularly to a method for inter-partition communication in Jailhouse. Background Art

[0002] Jailhouse is an open-source virtualization monitor designed specifically for multi-core embedded platforms. Through the static cell mechanism, CPU cores, memory regions, and peripheral resources are allocated to each isolated "cell" to achieve hardware-level security isolation and efficient reuse. Ivshmem is a commonly used inter-partition communication mechanism in Jailhouse. Based on the PCI BAR, a physical memory segment is mapped into a pollable or interrupt-driven shared buffer, which can not only provide a direct data exchange channel between different cells but also allow triggering an interrupt by writing a Doorbell to reduce the polling overhead and achieve timely response to data arrival. The ARINC 653 APEX Queuing Port communication specification is widely used in the aerospace and industrial control fields. It encapsulates message sending and receiving operations in a configurable FIFO circular buffer through port-channel abstraction, with built-in strict boundary checking, message counting, and status code feedback mechanisms, and supports adjustable message lengths, timeout policies, and priority control, thus ensuring the determinism, real-time performance, and security isolation of communication in a multi-task or multi-core partition environment.

[0003] In the Jailhouse virtualized environment, inter-partition communication mainly relies on the ivshmem mechanism. However, the implementation methods of ivshmem communication include directly using ivshmem and ivshmem-net encapsulated based on Virtio-ring, and there are still many limitations in practical applications. Directly using ivshmem only maps the shared memory segment as a PCI device to each cell, lacking any high-level protocol or metadata format, without any unified message boundary or frame header definition, and lacking a unified API. Developers need to design frame headers, write offsets, read offsets, and lock / unlock logic for each message type. Although ivshmem-net encapsulated based on Virtio-ring encapsulates certain communication protocols, it depends on a complete network protocol stack, requires the Guest OS in the inmate cell to transplant the network protocol stack, increasing the development workload; and due to the introduction of the network protocol stack, the scheduling delay and interrupt jitter are significant, not meeting the deterministic communication requirements of real-time scenarios.

[0004] Currently, Jaihouse does not have an inter - partition communication mechanism that takes into account high real - time performance, low overhead, secure isolation, and ease of use. The communication method based on ivshmem either has an exposed protocol and rough interfaces, or is overly dependent on a complex software stack, making it difficult to be competent in scenarios with high requirements for real - time performance, determinism, and security in communication environments such as embedded systems, industrial control, and edge computing. Summary of the Invention

[0005] To overcome the above - mentioned defects, the present invention is proposed to solve the technical problems of low real - time performance, determinism, and security in the communication environment.

[0006] The present invention provides a jailhouse inter - partition communication method, which includes the following steps: S1, Configure the jailhouse cell configuration file according to the hardware platform resources and the task requirements in the cell; the jailhouse cell configuration file includes the root cell configuration file and the inmate cell configuration file; the operating system in the root cell is Linux, and the operating system in the inmate cell is KylinRTOS; S2, Compile and run jailhouse, start the inmate cell, and run the application program of KylinRTOS; complete the registration of the destination port and the memory mapping of the FIFO circular buffer by calling a preset creation function through the application program of Linux, and complete the registration of the source port and the memory mapping of the FIFO circular buffer by calling a preset creation function through the application program of KylinRTOS; S3, Call a preset sending function through the source port to send data to the virtual PCI device, that is, write data into the node of the FIFO circular buffer; after the data is sent, fill in the Doorbell register to notify the Hypervisor to send an interrupt signal to the destination port; S4, According to the interrupt number in the inmate cell configuration file, send an interrupt signal to the destination port through the Hypervisor, and notify the destination port to read the data; S5, When the destination port receives the interrupt signal, call a preset receiving function through the destination port to read data from the virtual PCI device, that is, read data from the node of the FIFO circular buffer; S6, When the application program of the destination port receives the data, execute the predefined task.

[0007] A further improvement of the present invention lies in that configuring the jailhouse cell configuration file according to the hardware platform resources and the task requirements in the cell specifically includes: S101, Configure the port parameters of queue communication according to the hardware platform resources and the task requirements in the cell; S102, Calculate the size of the ivshmem shared memory area according to the port parameters of queue communication; S103, Configure the jailhouse cell configuration file according to the size of the ivshmem shared memory area.

[0008] A further improvement of the present invention lies in that configuring the jailhouse cell configuration file according to the size of the ivshmem shared memory area includes: S104, Configure the first ivshmem memory area configuration item in the root cell configuration file according to the size of the ivshmem shared memory area; S105, Configure the first parameter of the virtual PCI device according to the first ivshmem memory area configuration item.

[0009] A further improvement of the present invention lies in that the root cell has the read permission for the ivshmem shared memory area.

[0010] A further improvement of the present invention lies in that configuring the jailhouse cell configuration file according to the size of the ivshmem shared memory area further includes: S106, Define the interrupt number of the FIFO circular buffer in the inmate cell configuration file; S107, Configure the second ivshmem memory area configuration item in the inmate cell configuration file according to the size of the ivshmem shared memory area; S108, Configure the second parameter of the virtual PCI device according to the second ivshmem memory area configuration item.

[0011] A further improvement of the present invention lies in that the inmate cell has the read permission and the write permission for the ivshmem shared memory area.

[0012] A further improvement of the present invention lies in that the FIFO circular buffer is located in the ivshmem shared memory.

[0013] A further improvement of the present invention lies in that both Linux and KylinRTOS are pre-integrated with the driver ivshm_que_driver, and the ivshm_que_driver is responsible for the static configuration of the FIFO circular buffer; and the preset creation function, the preset sending function and the preset receiving function are encapsulated through the ivshm_que_driver.

[0014] Advantages of the present invention: The present invention adopts a statically configured FIFO circular buffer structure, realizing a lock-free and non-blocking communication path throughout the whole process, greatly reducing resource competition and latency fluctuations during operation; through the ivshmem virtual PCI device and BAR mapping mechanism, it ensures access isolation and permission control of the shared memory area among partitions; at the same time, a Doorbell interrupt notification mechanism is introduced to enhance the system's response ability to sudden communications, significantly improving the communication response efficiency in high-real-time scenarios. On the one hand, the present invention maintains the low complexity and trusted computing baseline of the jailhouse Hypervisor, and on the other hand, enhances the controllability, verifiability and adaptation flexibility of communication behaviors, and is applicable to security-critical scenarios with strict requirements for high-frequency, small data volume, low latency and deterministic communication in multi-partition embedded systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a logical architecture diagram of a jailhouse inter-partition communication method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] In order to further understand the technical solutions and beneficial effects of the present invention, the technical solutions of the present invention and the beneficial effects produced thereby will be described in detail below with reference to the accompanying drawings.

[0017] Figure 1 It is a logical architecture diagram of a jailhouse inter-partition communication method of the present invention. As Figure 1 shown, the operating system in the inmate cell is KylinRTOS (i.e., the Guest OS corresponding to Figure 1 ), which is a hard real-time RTOS, running services sensitive to real-time and determinism, and is the source port of Queuing Port communication; the operating system in the root cell is Linux (i.e., the Host OS corresponding to Figure 1 ), mainly performing non-real-time services such as data processing and HMI, and is the destination port of Queuing Port communication. After the application program at the destination port in linux receives the data, it will execute predefined tasks, such as processing, displaying, reporting, etc. on the data (status reports, commands or monitoring data) sent from the source port.

[0018] A jailhouse inter-partition communication method of the present invention includes the following steps: S1, configuring the jailhouse cell configuration file according to the hardware platform resources and the task requirements in the cell. The configuration process is as follows: S101. Configure the port parameters for queue communication according to the hardware platform resources and the task requirements in the cell. The hardware platform resources include available shared memory capacity, interrupt resources, etc. The task requirements in the cell refer to the amount of tasks running in the inmate cell (KylinRTOS). For the available shared memory capacity, for example, whether the system can provide a continuous 0x2000 - byte shared memory segment. If the memory is small, it may not be possible to configure as many messages or as large a message size. For the interrupt resources, whether the system has sufficient interrupt signal resources to support the destination port receiving interrupt notifications. For the task requirements in the cell, when the tasks running in the inmate cell (KylinRTOS) are high - frequency, small - packet, and highly real - time tasks, a shorter MAX_MESSAGE_SIZE and a larger MAX_NB_MESSAGE are required to ensure high concurrency and low latency. If the tasks running in the inmate cell (KylinRTOS) are low - frequency, large - packet, throughput - oriented tasks, a larger MAX_MESSAGE_SIZE can be set and MAX_NB_MESSAGE can be relatively reduced. For example, if the task may generate 200 messages per second, each not exceeding 128 bytes, then at least: MAX_NB_MESSAGE ≥ 200; MAX_MESSAGE_SIZE ≥ 128. Therefore, the process of further configuring the port parameters for queue communication by integrating the hardware platform resources and the task requirements in the cell is as follows: queuing.h is the common header file for queue communication. The common functions and macro definitions involved in queue communication are jointly defined by both communication parties (i.e., the source port and the destination port) (refer to the ARINC 653 APEX standard).

[0019] The port parameters for queue communication defined in queuing.h are the number of nodes in the FIFO circular buffer (MAX_NB_MESSAGE, 256) and the size of each node in the FIFO circular buffer (MAX_MESSAGE_SIZE, 256 Byte). The code example is as follows: #define MAX_NB_MESSAGE 256 / / The number of nodes in the FIFO circular buffer (i.e., the queue length) #define MAX_MESSAGE_SIZE 256 / / The size of each node in the FIFO circular buffer, unit Byte (i.e., the message size) S102. The process of calculating the size of the ivshmem shared memory area based on the port parameters defined in queuing.h is as follows: size = MAX_NB_MESSAGE MAX_MESSAGE_SIZE = 8192 (Bytes); that is, the size of the ivshmem shared memory area is 0x2000 (8192 Bytes, and 0x2000 is the hexadecimal form of 8192).

[0020] The advantages of using static configuration here are as follows: 1. Avoid dynamic memory allocation: Dynamically allocating shared memory during the operation of an embedded system not only consumes time but also introduces risks of failure and issues with uncontrollable real-time performance. 2. Complete all resource allocation and mapping at system startup: This means that during system operation, all communication resources are determined and controllable. 3. Static configuration parameters reflect the resource planning results during the system architecture design phase: The queue size and message length are actually mappings of "platform capabilities" and "business models".

[0021] Thus, better achieve the determinacy of communication behavior.

[0022] S103, and configure the root cell and inmate cell configuration files according to the size of the ivshmem shared memory area. The configuration process is as follows: S104, configure the first ivshmem memory area configuration item in the root cell configuration file according to the size of the ivshmem shared memory area; The application running on the destination port of the root cell has read permission for the ivshmem shared memory area, that is,.flags (permission flag bit) = JAILHOUSE_MEM_READ (read permission). The code example for the ivshmem shared memory area configuration of the.mem_regions structure in the root cell configuration file (that is, the first ivshmem memory area configuration item, here it is distinguished from the ivshmem shared memory area configuration item in the inmate cell by using "first" and "second", and is called the first ivshmem memory area configuration item) is as follows: / ivshmem shared memory regions / { / / Store the status of the shared memory area, all cells are read-only .phys_start = 0xb1000000, .virt_start = 0xb1000000, .size = 0x1000, .flags = JAILHOUSE_MEM_READ, }, { / / Public read-write area, optional, not involved in this method, but the format must be retained 0 }, { / / Exclusive output area assigned by the ivshmem method to the root cell, not used in this method, but needs to be configured, and the size needs to be the same as the FIFO circular buffer memory .phys_start = 0xb1001000, .virt_start = 0xb1001000, .size = 0x2000, / / The size of the ivshmem output area needs to be the same .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE, }, { .phys_start = 0xb1003000, / / Partition communication FIFO circular buffer .virt_start = 0xb1003000, .size = 0x2000, / / MAX_NB_MESSAGE MAX_MESSAGE_SIZE .flags = JAILHOUSE_MEM_READ, / / The root cell is the destination port, read-only permission }, S105, the code example of defining ivshmem as the first parameter of the virtual PCI device in the.pci_devices structure in the root cell configuration file (here, to distinguish from the parameters of the virtual PCI device in the inmate cell, "first" and "second" are used for distinction, and here it is called the first parameter) is as follows: / ivshmem 0001:00:00.0(queuing) / .pci_devices = { { .type = JAILHOUSE_PCI_TYPE_IVSHMEM, .domain = 1, .bdf = 0 << 3, .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, .shmem_regions_start = 0, .shmem_dev_id = 0, .shmem_peers = 2, .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED, }, } S106. In the inmate cell configuration file, the.interrupt number of the FIFO circular buffer is defined in the.domain structure as follows: .vpci_irq_base = 101 / / This interrupt number has been default configured in the.irqchips structure of the root cell configuration file The operating system KylinRTOS in the inmate cell runs the application of the source port and has the read and write permissions for the ivshmem shared memory region, that is,.flags (permission flag bit) = JAILHOUSE_MEM_READ (read permission) | JAILHOUSE_MEM_WRITE (write permission).

[0023] S107. The process of configuring the second ivshmem memory region configuration item in the inmate cell configuration file according to the size of the ivshmem shared memory region is as follows: In the inmate cell configuration file, the code example of the ivshmem shared memory region configuration in the.mem_regions structure is as follows: / ivshmem shared memory regions / { / / Store the status of the shared memory region, all cells are read-only .phys_start = 0xb1000000, .virt_start = 0xb1000000, .size = 0x1000, .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED, }, { / / Common read-write area, optional, not involved in this method, but the format needs to be retained 0 }, { / / Exclusive output area assigned by the ivshmem method to the root cell, not used in this method, but needs to be configured, and the size needs to be the same as the FIFO circular buffer memory .phys_start = 0xb1001000, .virt_start = 0xb1001000, .size = 0x2000, .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED, }, { / / Partition communication FIFO circular buffer .phys_start = 0xb1003000, .virt_start = 0xb1003000, .size = 0x2000, / / MAX_NB_MESSAGE MAX_MESSAGE_SIZE .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE | JAILHOUSE_MEM_ROOTSHARED, / / The inmate cell is the source port and has read and write permissions }, S108, The code example of defining ivshmem as the second parameter of the virtual PCI device in the.pci_devices structure in the inmate cell configuration file is as follows: / ivshmem 0001:00:00.0(queuing) / .pci_devices = { { .type = JAILHOUSE_PCI_TYPE_IVSHMEM, .domain = 1, .bdf = 0x0e << 3, .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX, .shmem_regions_start = 0, .shmem_dev_id = 1, / / Specify the ivshmem shared memory region of the FIFO circular buffer .shmem_peers = 2, .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED, }, } The advantages of this are as follows: At the physical implementation level, the present invention provides a shared memory area for each Guest OS in the form of a virtual PCI device based on the ivshmem mechanism provided by the Jailhouse Hypervisor. Each partition completes access isolation and resource boundary control of the shared memory through static mapping of the PCI configuration space, thereby ensuring the security and determinacy of multi-partition communication. This communication system adopts a static configuration method, and completes the sharing memory division, queue structure initialization, and access permission configuration at the system startup stage, avoiding the synchronization overhead and potential uncertainties brought by dynamic resource management during runtime, and further improving the predictability of the system communication behavior.

[0024] S2. Compile and run jailhouse, start the inmate cell partition, and run the application program of KylinRTOS, where both Linux and KylinRTOS are pre-integrated with the driver ivshm_que_driver, as Figure 1 shown. The ivshm_que_driver is responsible for the static configuration of the FIFO circular buffer; and encapsulates the preset creation function (i.e., CREATE_QUEUING_PORT()), the preset sending function (i.e., SEND_QUEUING_MESSAGE()), and the preset receiving function (i.e., RECEIVE_QUEUING_MESSAGE()) through the ivshm_que_driver.

[0025] The advantage of this approach is that communication entities are uniformly managed by the ivshm_que_driver driver within each Guest OS. This driver is registered in the form of a standard PCI device driver, providing a unified port interface upwards (i.e., a unified preset creation function for port registration, a unified preset sending function for data writing, and a unified preset receiving function for data reading, etc.), and encapsulating the ivshmem shared memory area into a lightweight FIFO circular buffer structure downwards. The FIFO circular buffer is based on a lock-free design, using atomic operations to maintain the head and tail pointers, enabling non-blocking concurrent read and write access, and effectively reducing the scheduling latency and resource contention risks common in real-time systems.

[0026] Linux application programs call the CREATE_QUEUING_PORT() function to complete the registration of the destination port and the memory mapping of the FIFO circular buffer (i.e., the arrow labeled 1 in the root cell part corresponding to Figure 1 ); KylinRTOS application programs call the CREATE_QUEUING_PORT() function to complete the registration of the source port and the memory mapping of the FIFO circular buffer (i.e., the arrow labeled 1 in the inmate cell part corresponding to Figure 1 ).

[0027] In S3, the application program of the source port calls the SEND_QUEUING_MESSAGE() function to send data to the virtual PCI device, that is, to write data into the node of the FIFO circular buffer (i.e., the arrow labeled 2 in the inmate cell part corresponding to Figure 1 ); after the data is sent, the Doorbell register is filled to notify the Hypervisor to send an interrupt signal to the partition where the destination port is located.

[0028] The advantage of this is that by using the Doorbell interrupt mechanism provided by ivshmem, fast notification of QueuingPort communication events between partitions is achieved, avoiding continuous occupation of the CPU by the traditional polling method. While ensuring high-throughput and low-latency communication performance, it meets the strict requirements of embedded hybrid-criticality systems for real-time, security, and determinism.

[0029] In S4, the Hypervisor sends an interrupt signal to the partition where the destination port is located according to the interrupt number allocated in the inmate cell configuration file to notify the destination port to read the data (i.e., the arrow labeled 3 in the corresponding Figure 1 ).

[0030] S5. When the destination port receives an interrupt signal, the destination port calls the RECEIVE_QUEUING_MESSAGE() function to read data from the virtual PCI device, that is, to read data from the node of the FIFO circular buffer (i.e., the arrow labeled 4 in Figure 1 ).

[0031] S6. After the application program of the destination port receives the data, it executes predefined tasks (such as processing, displaying, reporting, etc.).

[0032] This invention draws on the ARINC 653 APEX queuing communication model, constructs a lightweight structured FIFO circular buffer channel on the ivshmem shared memory area, encapsulates the standardized CREATE_QUEUING_PORT, SEND_QUEUING_MESSAGE, and RECEIVE_QUEUING_MESSAGE interfaces through the driver, realizes efficient, real-time, and secure communication of messages between different partitions, and ensures deterministic behavior and traffic control by statically configuring the queue length and message size to meet strict real-time timing constraints.

[0033] This invention draws on the design concept of Virtio-ring, adopts a hierarchical design strategy of "shifting the control logic upward and sinking the data path", and significantly reduces the implementation complexity of the Hypervisor by delegating all core operations such as memory management, descriptor maintenance, and transceiver index update of the FIFO circular buffer to the Guest OS for execution, while enhancing the scalability and cross-platform portability of the system.

[0034] The beneficial effects of this invention are as follows: The core design of the present invention lies in completely shifting the queue control logic to the internal part of the Guest OS. The ivshm_que_driver is responsible for managing the statically configured FIFO circular buffer to achieve lock-free and non-blocking read and write access. On the one hand, this method maintains the low complexity of the jailhouse Hypervisor and the trusted computing baseline. On the other hand, it enhances the controllability, verifiability, and adaptation flexibility of communication behaviors, and is applicable to security-critical scenarios with strict requirements for high-frequency, small data volume, low latency, and deterministic communication in multi-partition embedded systems. Moreover, by introducing the APEX Queuing Port communication mechanism based on ivshmem in the jailhouse virtualization environment, the real-time performance, determinism, and security of inter-partition communication are significantly improved. Specifically, by completely placing the Virtio-ring-style queue control logic inside the Guest OS and leveraging the ivshmem virtual PCI device and BAR permission control mechanism, secure isolation and fine-grained access control of communication memory are achieved, ensuring system stability. Combining with the Doorbell interrupt mechanism enhances the system's response ability to sudden communication. In addition, resource allocation and mapping are completed at system startup without the need for dynamic initialization during runtime, thus significantly improving the predictability and deployment controllability of the communication link. It is particularly suitable for hybrid-critical embedded scenarios such as aerospace and industrial control with extremely high requirements for communication reliability and system determinism. At the same time, by drawing on the design concept of the ARINC 653 queue port communication model, the standard compatibility and cross-platform transplantation efficiency of the solution in fields such as aerospace are significantly improved, providing a lightweight, efficient, and controllable implementation path for the communication mechanism of high-security and high-real-time systems.

[0035] It should be noted that the terms "first", "second", etc. in the specification of this application are used to distinguish similar objects and do not represent a limitation on a specific order or sequence. In appropriate cases, the order of use of similar objects can be interchanged so that the embodiments of the present application described here can be implemented in an order other than the illustrated or described order.

[0036] Although the present invention has been described using the above preferred embodiments, it is not intended to limit the protection scope of the present invention. Any person skilled in the art, without departing from the spirit and scope of the present invention, making various changes and modifications to the above embodiments still falls within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be defined by the claims.

Claims

1. A jailhouse inter - zone communication method, characterized in that, Including: S1. Configure the Jailhouse cell configuration file according to the hardware platform resources and the task requirements in the cell. The Jailhouse cell configuration file includes the root cell configuration file and the inmate cell configuration file. The operating system in the root cell is Linux, and the operating system in the inmate cell is KylinRTOS; S2. Compile and run Jailhouse, start the inmate cell, and run the application program of KylinRTOS. Complete the destination port registration and the memory mapping of the FIFO circular buffer by calling the preset creation function through the application program of Linux, and complete the source port registration and the memory mapping of the FIFO circular buffer by calling the preset creation function through the application program of KylinRTOS; S3. Call the preset sending function through the source port to send data to the virtual PCI device, that is, write data to the node of the FIFO circular buffer; After the data sending is completed, fill in the Doorbell register to notify the Hypervisor to send an interrupt signal to the destination port; S4. According to the interrupt number in the inmate cell configuration file, send an interrupt signal to the destination port through the Hypervisor, and notify the destination port to read the data; S5. When the destination port receives the interrupt signal, call the preset receiving function through the destination port to read data from the virtual PCI device, that is, read data from the node of the FIFO circular buffer; S6. When the application program of the destination port receives the data, execute the predefined task.

2. The jailhouse inter - zone communication method according to claim 1, wherein Configure the Jailhouse cell configuration file according to the hardware platform resources and the task requirements in the cell, specifically including: S101. Configure the port parameters of the queue communication according to the hardware platform resources and the task requirements in the cell; S102. Calculate the size of the ivshmem shared memory area according to the port parameters of the queue communication; S103. Configure the Jailhouse cell configuration file according to the size of the ivshmem shared memory area.

3. The jailhouse partition communication method according to claim 2, wherein, Configure the Jailhouse cell configuration file according to the size of the ivshmem shared memory area, including: S104. Configure the first ivshmem memory area configuration item in the root cell configuration file according to the size of the ivshmem shared memory area; S105. Configure the first parameter of the virtual PCI device according to the first ivshmem memory area configuration item.

4. The jailhouse inter - zone communication method according to claim 3, wherein, The root cell has the read permission for the ivshmem shared memory area.

5. The jailhouse partition communication method according to claim 2, characterized in that, Configuring the Jailhouse cell configuration file according to the size of the ivshmem shared memory area further includes: S106. Define the interrupt number of the FIFO circular buffer in the inmate cell configuration file; S107, configure the second ivshmem memory area configuration item in the inmate cell configuration file according to the size of the ivshmem shared memory area; S108, configure the second parameter of the virtual PCI device according to the second ivshmem memory area configuration item.

6. The jailhouse inter - zone communication method according to claim 5, characterized in that, The inmate cell has read and write permissions for the ivshmem shared memory area.

7. The jailhouse inter - zone communication method according to claim 2, wherein, The FIFO circular buffer is located in the ivshmem shared memory area.

8. The jailhouse inter - zone communication method according to claim 1, characterized in that, Both Linux and KylinRTOS are pre-integrated with the driver ivshm_que_driver, which is responsible for the static configuration of the FIFO circular buffer; and encapsulates the preset creation function, preset sending function, and preset receiving function through ivshm_que_driver.

Citation Information

Patent Citations

  • RTOS network sharing method based on virtual machine monitor

    CN115599502A

  • Data transceiving method and device based on embedded serial port module

    CN116257206A

  • Method for realizing PCIE (Peripheral Component Interface Express) equipment isolation in jailhome

    CN116431293A

  • Interdomain communication method based on jailhome smmu

    CN117857253A

  • Secure communication method and device, processor, electronic equipment and readable storage medium

    CN118246054A

Cited By

  • Method for realizing use of virtual serial port by bare computer program through Jailhouse

    CN122173206A

  • Jailhouse implements a method for using virtual serial ports in bare-metal programs.

    CN122173206B