| In the era of industrial 4.0,people’s demand for intelligentization and safety of vehicles gradually increased.The intelligent vehicle control systems often adopt high performance SOC computing platforms.The in-vehicle application software is becoming increasingly complicated.Real-time tasks coexist with non-real-time tasks.Embedded hypervisor can isolate software and hardware with different safety and real-time requirements to prevent fault transmission and improve resource utilization to ensure system reliability.Therefore,embedded virtualization technology is widely used in military,industry and scientific research,and real-time scheduling of virtualization is also a hot issue in research.This thesis takes the embedded hypervisor Xvisor as the research object,and then analyzes and models the Xvisor’s hierarchical scheduling structure with two levels using compositional schedulability analysis(CSA)methods to optimize the periodicity and time slice parameters of VCPU for application scenarios where real-time and non-real-time tasks coexist in embedded systems,with the goal of ensuring real-time performance of the system and saving computing resources.This thesis designs and implements a compositional scheduling analysis software tool for calculating VCPU parameters.Finally,the scheduling strategy of Xvisor is optimized,and an experimental platform is built to verify the effectiveness of the optimization method and test that the real-time performance of the system can be ensured under the calculated parameters.The main work of the thesis is as follows:First,this thesis summarizes the principles of Xvisor’s CPU virtualization,clock virtualization and interrupt virtualization to provide technical support for subsequent real-time scheduling analysis and optimization of Xvisor scheduling strategies.Combined with the hardware support of the ARMv8 CPU architecture for virtualization,I’ve read the source code of Xvisor,and organized its CPU virtualization principle from aspects such as the Xvisor manager,load balancer,scheduler,and VCPU control block.And then,this thesis researches the implementation method of Xvisor clock virtualization and the implementation mechanism of timing interrupt.Last,combined with the virtualization expansion of ARM general interrupt controller,this paper summarizes the Xvisor interrupt virtualization principle from both interrupt and exception aspects.Secondly,real-time analysis of the embedded virtualization system is performed.In order to meet the soft real-time requirements,for a system running an RTOS and a GPOS on the Xvisor,CSA method is used to analyze and model the hierarchical scheduling structure with two levels of the virtualization system.Combining the determined real-time periodic task set,scheduling algorithm,and periodic resource model,the schedulability conditions for the real-time task set are provided.Considering the VCPU switching overhead and RTOS system overhead,the periodicity and time slice parameters of the VCPU are optimized to provide computing resources for non-real-time tasks as much as possible on the basis of ensuring the schedulability of real-time tasks.Thirdly,according to the analysis and modeling of the two-layer scheduling architecture,a Xvisor compositional scheduling analysis software tool was designed and implemented to calculate VCPU parameters,achieving functions such as task set setting,algorithm selection,system parameter setting,schedulable analysis,related image display,and VCPU parameter calculation.Finally,the Xvisor scheduling strategy is optimized in combination with the VCPU periodicity and time slice parameters,an experimental platform is set up,and Xvisor is installed on the Raspberry Pi 3B hardware platform.LITMUSRT and an ordinary Linux kernel are translanted to serve as RTOS and GPOS respectively,the RM scheduling algorithm plug-in is added for LITMUSRT,and the modified liblitmus user space library is used to set up real-time tasks in LITMUSRT and record the execution situation of the tasks.The statistical task loss rate and task timeout rate are used as indicators to measure real-time performance.Comparing the real-time task execution under the original Xvisor and the Xvisor whose scheduling strategy is optimized,it is verified that the optimal parameters calculated according to the CSA method can ensure real-time performance and the Xvisor’s scheduling strategy has been optimized. |