A communication method between jailhouse partitions

By introducing a statically configured FIFO ring buffer and doorbell interrupt mechanism in jailhouse inter-partition communication, the real-time and security issues of existing communication mechanisms are resolved, and efficient, deterministic and secure inter-partition communication is achieved, which is suitable for embedded systems.

CN120256030BActive Publication Date: 2025-09-12KYLIN CORP
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing communication mechanism between jailhouse partitions has deficiencies in real-time, deterministic and security, and is particularly difficult to meet high requirements in scenarios such as embedded and industrial control.

Method used

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

Benefits of technology

It significantly improves the real-time, deterministic and security of communications, is suitable for high-frequency, small data volume, low-latency safety-critical scenarios, and meets the strict requirements of embedded systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256030B_ABST
    Figure CN120256030B_ABST
Patent Text Reader

Abstract

A method for communication between jailhouse partitions includes: configuring a jailhouse cell configuration file based on hardware platform resources and task requirements in the cell; compiling and running the jailhouse, starting the inmate cell, completing the registration of the destination port and source port, and memory mapping of the FIFO ring buffer; sending data to a virtual PCI device via the source port, filling in the doorbell register after data transmission is completed, and sending an interrupt signal to the destination port via the hypervisor; reading data from the virtual PCI device via the destination port; and executing a predefined task when the application at the destination port receives the data. This invention enhances the controllability, verifiability, and adaptability of communication behavior and is suitable for safety-critical scenarios with strict requirements for high-frequency, small-data-volume, low-latency, 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 virtualized environment communication architecture, and in particular to a method for communication between jailhouse partitions. Background Art

[0002] Jailhouse is an open-source virtualization monitor designed for multi-core embedded platforms. It uses a static cell partitioning mechanism to partition CPU cores, memory regions, and peripheral resources into isolated "cells," achieving hardware-level security isolation and efficient reuse. ivshmem is a commonly used inter-cell communication mechanism in jailhouse. Based on PCI BARs, it maps a physical memory segment into a pollable or interrupt-driven shared buffer. This provides a direct data exchange channel between cells and allows interrupts to be triggered by writing to doorbells, reducing polling overhead and ensuring timely response to incoming data. The ARINC 653 APEX Queuing Port specification, widely adopted in aerospace and industrial control, encapsulates message sending and receiving operations in a configurable FIFO ring buffer through the port-channel abstraction. It incorporates strict bounds checking, message counting, and status code feedback mechanisms, and supports adjustable message length, timeout policies, and priority control. This ensures deterministic, real-time, and secure communication in multi-tasking or multi-core partitioned environments.

[0003] In a jailhouse virtualization environment, inter-partition communication primarily relies on the ivshmem mechanism. However, ivshmem communication implementations, including direct ivshmem and ivshmem-net, a Virtio-ring encapsulation method, still have many limitations in practical applications. Direct ivshmem simply maps shared memory segments to each cell as PCI devices, lacking any high-level protocols or metadata formats, unified message boundaries or frame header definitions, and a unified API. Developers must design frame headers, write offsets, read offsets, and lock / unlock logic for each message type. While ivshmem-net, a Virtio-ring encapsulation method, encapsulates certain communication protocols, it relies on a complete network protocol stack, requiring the guest OS in the inmate cell to port the network protocol stack, increasing development workload. Furthermore, the inclusion of the network protocol stack results in significant scheduling delays and interrupt jitter, failing to meet the deterministic communication requirements of real-time scenarios.

[0004] Currently, Jaihouse does not have a communication mechanism between partitions that combines high real-time performance, low overhead, secure isolation, and ease of use. The communication method based on ivshmem either has exposed protocols and rough interfaces, or is overly dependent on complex software stacks. It is difficult to be competent in scenarios with high requirements for real-time, determinism, and security in communication environments such as embedded, industrial control, and edge computing. Summary of the Invention

[0005] In order 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 a communication environment.

[0006] The present invention provides a method for communication between jailhouse partitions, comprising the following steps:

[0007] S1: Configure the jailhouse cell configuration file based on the hardware platform resources and 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.

[0008] S2: Compile and run jailhouse, start the inmate cell, and run the KylinRTOS application. The Linux application calls the preset creation function to complete the destination port registration and the memory mapping of the FIFO ring buffer. The KylinRTOS application calls the preset creation function to complete the source port registration and the memory mapping of the FIFO ring buffer.

[0009] S3, calls the preset send function through the source port to send data to the virtual PCI device, that is, writes data to the node of the FIFO ring buffer; after the data is sent, fills the Doorbell register and notifies the Hypervisor to send an interrupt signal to the destination port;

[0010] S4, according to the interrupt number in the inmate cell configuration file, sends an interrupt signal to the destination port through the Hypervisor and notifies the destination port to read the data;

[0011] S5, when the destination port receives an interrupt signal, the preset receiving function is called through the destination port to read data from the virtual PCI device, that is, read data from the node of the FIFO ring buffer;

[0012] S6, when the application of the destination port receives the data, it executes the predefined task.

[0013] A further improvement of the present invention is to configure the jailhouse cell configuration file based on the hardware platform resources and the task requirements in the cell, specifically including:

[0014] S101, configure the port parameters for queue communication based on the hardware platform resources and task requirements in the cell;

[0015] S102, calculating the size of the ivshmem shared memory area according to the port parameters of the queue communication;

[0016] S103: Configure the jailhouse cell configuration file according to the size of the ivshmem shared memory area.

[0017] A further improvement of the present invention is to configure the jailhouse cell configuration file according to the size of the ivshmem shared memory area, including:

[0018] S104, configuring the first ivshmem memory area configuration item in the root cell configuration file according to the size of the ivshmem shared memory area;

[0019] S105: Configure a first parameter of the virtual PCI device according to the first ivshmem memory area configuration item.

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

[0021] A further improvement of the present invention is that the jailhouse cell configuration file is configured according to the size of the ivshmem shared memory area, and further includes:

[0022] S106, defining the interrupt number of the FIFO ring buffer in the inmate cell configuration file;

[0023] S107, configuring the second ivshmem memory area configuration item in the inmate cell configuration file according to the size of the ivshmem shared memory area;

[0024] S108: Configure the second parameter of the virtual PCI device according to the second ivshmem memory area configuration item.

[0025] A further improvement of the present invention is that the inmate cell has read permission and write permission of the ivshmem shared memory area.

[0026] A further improvement of the present invention is that the FIFO ring buffer is located in the ivshmem shared memory.

[0027] A further improvement of the present invention is that both Linux and KylinRTOS pre-integrate the driver ivshm_que_driver, which is responsible for the static configuration of the FIFO ring buffer; and encapsulates the preset creation function, preset sending function and preset receiving function through ivshm_que_driver.

[0028] Beneficial effects of the present invention:

[0029] This invention uses a statically configured FIFO ring buffer structure to achieve a lock-free and non-blocking communication path throughout, significantly reducing resource contention and latency fluctuations during runtime. Through the ivshmem virtual PCI device and BAR mapping mechanism, access isolation and permission control of shared memory areas between partitions are ensured. Furthermore, the introduction of a Doorbell interrupt notification mechanism enhances the system's responsiveness to burst communications, significantly improving communication response efficiency in high-real-time scenarios. While maintaining the low complexity and trusted computing baseline of the jailhouse hypervisor, this invention also enhances the controllability, verifiability, and adaptability of communication behavior. It is suitable for safety-critical scenarios in multi-partition embedded systems that have strict requirements for high-frequency, small-data-volume, low-latency, and deterministic communications. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is a logical architecture diagram of a method for communication between jailhouse partitions according to the present invention. DETAILED DESCRIPTION

[0031] In order to have a further understanding of the technical solution and beneficial effects of the present invention, the technical solution and beneficial effects of the present invention are described in detail below with reference to the accompanying drawings.

[0032] Figure 1 FIG. 1 is a logical architecture diagram of a method for communication between jailhouse partitions according to the present invention. Figure 1 As shown, the operating system in inmatecell is KylinRTOS (corresponding to Figure 1 The Guest OS in the root cell is a hard real-time RTOS that runs services that are sensitive to real-time and determinism and is the source port for Queuing Port communication. The operating system in the root cell is Linux (i.e., the corresponding Figure 1The host OS in the Linux kernel primarily performs non-real-time services such as data processing and HMI, and is the destination port for queuing port communications. Upon receiving data, the application on the destination port in Linux performs predefined tasks, such as processing, displaying, and reporting the data (status reports, commands, or monitoring data) sent by the source port.

[0033] A method for communication between jailhouse partitions of the present invention comprises the following steps:

[0034] S1, configure the jailhouse cell configuration file based on the hardware platform resources and the task requirements in the cell. The configuration process is as follows:

[0035] S101 configures the port parameters for queue communication based on hardware platform resources and task requirements within the cell. Hardware platform resources include available shared memory capacity and interrupt resources. Task requirements within the cell refer to the number of tasks running within the inmate cell (KylinRTOS). For example, regarding available shared memory capacity, consider whether the system can provide a continuous 0x2000-byte shared memory segment. If the memory is too small, configuring such a large number of messages or message sizes may not be possible. Regarding interrupt resources, consider whether the system has sufficient interrupt signal resources to support the destination port receiving interrupt notifications. Regarding the task requirements within the cell, if the inmate cell (KylinRTOS) is running high-frequency, small-packet, and 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 inmate cell (KylinRTOS) is running low-frequency, large-packet, throughput-oriented tasks, a larger MAX_MESSAGE_SIZE can be set, while a relatively smaller MAX_NB_MESSAGE can be used. For example, if a task may generate 200 messages per second, each no larger than 128 bytes, then at least MAX_NB_MESSAGE ≥ 200 and MAX_MESSAGE_SIZE ≥ 128 are required. Therefore, considering the hardware platform resources and the task requirements within the cell, the process for further configuring the port parameters for queue communication is as follows:

[0036] queuing.h is a public header file for queue communication. The communicating parties (source port and destination port) jointly define the common functions and macro definitions involved in queue communication (referring to the ARINC 653 APEX standard).

[0037] The port parameters for queue communication defined in queuing.h are the number of nodes in the FIFO ring buffer (MAX_NB_MESSAGE, 256) and the node size in the FIFO ring buffer (MAX_MESSAGE_SIZE, 256Byte). The code example is as follows:

[0038] #define MAX_NB_MESSAGE 256 / / Number of nodes in the FIFO ring buffer (i.e. queue length)

[0039] #define MAX_MESSAGE_SIZE 256 / / Node size in FIFO ring buffer, unit Byte (i.e. message size)

[0040] S102, the process of calculating the size of the ivshmem shared memory area according to the port parameters defined in queuing.h is as follows:

[0041] size = MAX_NB_MESSAGE MAX_MESSAGE_SIZE = 8192 (Bytes); that is, the size of the ivshmem shared memory area is 0x2000 (8192 Bytes, 0x2000 is the hexadecimal form of 8192).

[0042] The benefits of using static configuration here are:

[0043] 1. Avoid dynamic memory allocation: Dynamically allocating shared memory during runtime in embedded systems not only consumes time but also introduces failure risks and uncontrollable real-time performance issues.

[0044] 2. All resource allocation and mapping are completed when the system starts: This means that all communication resources are determined and controllable during system operation.

[0045] 3. Static configuration parameters reflect the resource planning results during the system architecture design phase: queue size and message length are actually a mapping of "platform capabilities" and "business models."

[0046] This can better achieve the certainty of communication behavior.

[0047] S103 configures the root cell and inmate cell configuration files based on the size of the ivshmem shared memory area. The configuration process is as follows:

[0048] S104, configuring the first ivshmem memory area configuration item in the root cell configuration file according to the size of the ivshmem shared memory area;

[0049] The root cell runs the application on the destination port and has read permission for the ivshmem shared memory region, that is, .flags (permission flag) = JAILHOUSE_MEM_READ (read permission). The following is a code example for the ivshmem shared memory region configuration in the .mem_regions structure in the root cell configuration file (the first ivshmem memory region configuration item, distinguished from the ivshmem shared memory region configuration item in the inmate cell by using "first" and "second" to distinguish them, and referred to here as the first ivshmem memory region configuration item):

[0050] / ivshmem shared memory regions /

[0051] { / / Store the status of the shared memory area, all cells are read-only

[0052] .phys_start = 0xb1000000,

[0053] .virt_start = 0xb1000000,

[0054] .size = 0x1000,

[0055] .flags = JAILHOUSE_MEM_READ,

[0056] },

[0057] { / / Public read-write area, optional, not involved in this method, but the format must be preserved 0

[0059] },

[0060] { / / The ivshmem method allocates the exclusive output area to the root cell. This method is not used, but needs to be configured. The size must be consistent with the FIFO ring buffer memory.

[0061] .phys_start = 0xb1001000,

[0062] .virt_start = 0xb1001000,

[0063] .size = 0x2000, / / ivshmem output area size must be consistent

[0064] .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,

[0065] },

[0066] {

[0067] .phys_start = 0xb1003000, / / Partition communication FIFO ring buffer

[0068] .virt_start = 0xb1003000,

[0069] .size = 0x2000, / / MAX_NB_MESSAGE MAX_MESSAGE_SIZE

[0070] .flags = JAILHOUSE_MEM_READ, / / root cell is the destination port, read-only permission

[0071] },

[0072] In step S105, the .pci_devices structure in the root cell configuration file defines ivshmem as the first parameter of the virtual PCI device (to distinguish it from the parameters of the virtual PCI device in the inmate cell, the terms "first" and "second" are used to distinguish it, and it is referred to as the first parameter here). The following is a code example:

[0073] / ivshmem 0001:00:00.0(queuing) /

[0074] .pci_devices = {

[0075] {

[0076] .type = JAILHOUSE_PCI_TYPE_IVSHMEM,

[0077] .domain = 1,

[0078] .bdf = 0 << 3,

[0079] .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,

[0080] .shmem_regions_start = 0,

[0081] .shmem_dev_id = 0,

[0082] .shmem_peers = 2,

[0083] .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,

[0084] },

[0085] }

[0086] S106, in the inmate cell configuration file, the .domain structure defines the interrupt number of the FIFO ring buffer as follows:

[0087] .vpci_irq_base = 101 / / This interrupt number has been configured by default in the root cell configuration file .irqchips structure

[0088] KylinRTOS, the operating system in the inmate cell, runs the source port application and has read and write permissions for the ivshmem shared memory area, that is, .flags (permission flags) = JAILHOUSE_MEM_READ (read permission) | JAILHOUSE_MEM_WRITE (write permission).

[0089] S107, the process of configuring the second ivshmem memory area configuration item in the inmate cell configuration file according to the size of the ivshmem shared memory area is as follows:

[0090] In the inmate cell configuration file, the code example for configuring the ivshmem shared memory region in the .mem_regions structure is as follows:

[0091] / ivshmem shared memory regions /

[0092] { / / Store the status of the shared memory area, all cells are read-only

[0093] .phys_start = 0xb1000000,

[0094] .virt_start = 0xb1000000,

[0095] .size = 0x1000,

[0096] .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,

[0097] },

[0098] { / / Public read-write area, optional, not involved in this method, but the format must be preserved 0

[0100] },

[0101] { / / The ivshmem method allocates the exclusive output area to the root cell. This method is not used, but needs to be configured. The size must be consistent with the FIFO ring buffer memory.

[0102] .phys_start = 0xb1001000,

[0103] .virt_start = 0xb1001000,

[0104] .size = 0x2000,

[0105] .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,

[0106] },

[0107] { / / Partition communication FIFO ring buffer

[0108] .phys_start = 0xb1003000,

[0109] .virt_start = 0xb1003000,

[0110] .size = 0x2000, / / MAX_NB_MESSAGE MAX_MESSAGE_SIZE

[0111] .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |

[0112] JAILHOUSE_MEM_ROOTSHARED, / / inmate cell is the source port and has read and write permissions

[0113] },

[0114] S108, the .pci_devices structure in the inmate cell configuration file defines ivshmem as the second parameter of the virtual PCI device as follows:

[0115] / ivshmem 0001:00:00.0(queuing) /

[0116] .pci_devices = {

[0117] {

[0118] .type = JAILHOUSE_PCI_TYPE_IVSHMEM,

[0119] .domain = 1,

[0120] .bdf = 0x0e << 3,

[0121] .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,

[0122] .shmem_regions_start = 0,

[0123] .shmem_dev_id = 1, / / Specify the ivshmem shared memory area of ​​the FIFO ring buffer

[0124] .shmem_peers = 2,

[0125] .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,

[0126] },

[0127] }

[0128] The benefits of this approach are: at the physical implementation level, the present invention, based on the ivshmem mechanism provided by the Jailhouse Hypervisor, provides shared memory areas for each guest OS in the form of virtual PCI devices. Each partition completes shared memory access isolation and resource boundary control through static mapping of the PCI configuration space, thereby ensuring the security and certainty of communication between multiple partitions. This communication system uses a static configuration method to complete shared memory partitioning, queue structure initialization, and access permission configuration during the system startup phase, avoiding the synchronization overhead and potential uncertainty caused by dynamic resource management at runtime, and further improving the predictability of system communication behavior.

[0129] S2, compile and run jailhouse, start the inmate cell partition, and run the KylinRTOS application. Both Linux and KylinRTOS have pre-integrated drivers ivshm_que_driver, such as Figure 1 As shown in the figure, ivshm_que_driver is responsible for the static configuration of the FIFO ring buffer; and ivshm_que_driver 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()).

[0130] The advantage of this approach is that communication entities are centrally managed by the ivshm_que_driver driver within each guest OS. This driver registers as a standard PCI device driver, providing a unified port interface (i.e., a unified preset create function for port registration, a unified preset send function for data writing, and a unified preset receive function for data reading). Downward, it encapsulates the ivshmem shared memory area into a lightweight FIFO ring buffer structure. The FIFO ring buffer is based on a lock-free design and uses atomic operations to maintain head and tail pointers, enabling non-blocking concurrent read and write access, effectively reducing scheduling delays and resource contention risks commonly found in real-time systems.

[0131] The Linux application calls the CREATE_QUEUING_PORT() function to complete the destination port registration and the memory mapping of the FIFO ring buffer (that is, the corresponding Figure 1 The root cell part in the KylinRTOS is marked with arrow 1); the KylinRTOS application calls the CREATE_QUEUING_PORT() function to complete the source port registration and the memory mapping of the FIFO ring buffer (that is, the corresponding Figure 1 The inmate cell part is marked with arrow 1).

[0132] S3, the source port application calls the SEND_QUEUING_MESSAGE() function to send data to the virtual PCI device, that is, write data to the node of the FIFO ring buffer (that is, the corresponding Figure 1 After data transmission is completed, the Doorbell register is filled in and the Hypervisor is notified to send an interrupt signal to the partition where the destination port is located.

[0133] The benefits of this are: utilizing the Doorbell interrupt mechanism provided by ivshmem to achieve rapid notification of QueuingPort communication events between partitions, avoiding the continuous CPU occupation of traditional polling methods, while ensuring high throughput and low-latency communication performance while meeting the strict real-time, security, and deterministic requirements of embedded mixed-criticality systems.

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

[0135] S5, when the destination port receives the interrupt signal, the destination port calls the RECEIVE_QUEUING_MESSAGE() function to read data from the virtual PCI device, that is, read data from the node of the FIFO ring buffer (that is, the corresponding Figure 1 (arrow number 4 in the figure).

[0136] S6: After receiving the data, the application at the destination port executes predefined tasks (such as processing, displaying, reporting, etc.).

[0137] Abstract: In order to improve the communication efficiency of message partitions, a lightweight structured FIFO ring buffer channel is proposed in this paper, which draws on the ARINC 653 APEX queue communication model and builds a lightweight structured FIFO ring buffer channel on the ivshmem shared memory area. The driver encapsulates the standardized CREATE_QUEUING_PORT, SEND_QUEUING_MESSAGE and RECEIVE_QUEUING_MESSAGE interfaces to achieve efficient, real-time and secure communication of messages between different partitions. The static configuration of queue length and message size ensures deterministic behavior and flow control to meet strict real-time timing constraints.

[0138] This invention draws on the design concept of Virtio-ring and adopts a layered design strategy of "moving control logic upward and sinking data path". By delegating all core operations such as memory management, descriptor maintenance, and transmit and receive index updates of the FIFO ring buffer to the internal execution of the Guest OS, it significantly reduces the implementation complexity of the Hypervisor and improves the scalability and cross-platform portability of the system.

[0139] The beneficial effects of the present invention are as follows:

[0140] The core design of the present invention is to completely move the queue control logic to the guest OS, with the ivshm_que_driver responsible for managing the statically configured FIFO ring buffer, achieving lock-free, non-blocking read and write access. On the one hand, this method maintains the low complexity and trusted computing baseline of the jailhouse hypervisor, and on the other hand, it enhances the controllability, verifiability, and adaptability of communication behavior. It is suitable for security-critical scenarios in multi-partition embedded systems that have strict requirements for high-frequency, small data volume, low latency, and deterministic communication. In addition, by introducing the ivshmem-based APEX Queuing Port communication mechanism in the jailhouse virtualization environment, the real-time, deterministic, and security of inter-partition communication are significantly improved. Specifically, by completely placing the Virtio-ring queue control logic within the guest OS and leveraging the ivshmem virtual PCI device and BAR permission control mechanism, secure isolation and refined access control of communication memory are achieved, ensuring system stability; combined with the Doorbell interrupt mechanism, the system's responsiveness to bursty communications is enhanced. In addition, resource allocation and mapping are completed as soon as the system starts, without the need for dynamic initialization at runtime, thereby significantly improving the predictability and deployment controllability of the communication link. It is particularly suitable for mixed-criticality embedded scenarios such as aerospace and industrial control, which have 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 solution's standard compatibility and cross-platform porting efficiency in fields such as aerospace have been significantly improved, providing a lightweight, efficient, and controllable implementation path for the communication mechanism of high-security, high-real-time systems.

[0141] It should be noted that the terms "first," "second," and the like in the description of this application are used to distinguish similar objects and do not imply a specific order or precedence. The order used for similar objects may be interchanged where appropriate, such that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0142] Although the present invention has been described using the above preferred embodiments, they are not intended to limit the scope of protection of the present invention. Any person skilled in the art may make various changes and modifications to the above embodiments without departing from the spirit and scope of the present invention. These changes and modifications are still within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be based on the definition of the claims.

Claims

1. A method for communication between jailhouse partitions, characterized in that: include: S1, configure the jailhouse cell configuration file based on the hardware platform resources and 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 KylinRTOS application. The Linux application calls the preset creation function to complete the destination port registration and the memory mapping of the FIFO ring buffer. The KylinRTOS application calls the preset creation function to complete the source port registration and the memory mapping of the FIFO ring buffer. S3, calls the preset sending function through the source port to send data to the virtual PCI device, that is, writes data to the node of the FIFO ring buffer; After data transmission is completed, the Doorbell register is filled and the Hypervisor is notified to send an interrupt signal to the destination port; S4, according to the interrupt number in the inmate cell configuration file, sends an interrupt signal to the destination port through the Hypervisor and notifies the destination port to read the data; S5, when the destination port receives an interrupt signal, the preset receiving function is called through the destination port to read data from the virtual PCI device, that is, read data from the node of the FIFO ring buffer; S6, when the application of the destination port receives the data, it executes the predefined task; In step S1, the jailhouse cell configuration file is configured based on the hardware platform resources and the task requirements in the cell. Specifically, it includes: S101, configure the port parameters for queue communication based on the hardware platform resources and task requirements in the cell; S102, calculating the size of the ivshmem shared memory area according to the port parameters of the queue communication; S103, configuring the jailhouse cell configuration file according to the size of the ivshmem shared memory area; Both Linux and KylinRTOS have pre-integrated driver ivshm_que_driver, which is responsible for static configuration of FIFO ring buffer; and encapsulates preset creation function, preset sending function and preset receiving function through ivshm_que_driver.

2. A method for communication between jailhouse partitions as claimed in claim 1, characterized in that: Configure the jailhouse cell configuration file based on the size of the ivshmem shared memory area, including: S104, configuring 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 a first parameter of the virtual PCI device according to the first ivshmem memory area configuration item.

3. A method for communication between jailhouse partitions as claimed in claim 2, characterized in that: The root cell has read permission for the ivshmem shared memory area.

4. A method for communication between jailhouse partitions as claimed in claim 1, characterized in that: Configure the jailhouse cell configuration file based on the size of the ivshmem shared memory area, including: S106, defining the interrupt number of the FIFO ring buffer in the inmate cell configuration file; S107, configuring 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.

5. A method for communication between jailhouse partitions as claimed in claim 4, characterized in that: The inmate cell has read and write permissions for the ivshmem shared memory area.

6. A method for communication between jailhouse partitions as claimed in claim 1, characterized in that: The FIFO ring buffer is located in the ivshmem shared memory region.

Citation Information

Patent Citations

  • RTOS network sharing method based on virtual machine monitor

    CN115599502A