[go: up one dir, main page]

CN118444987A - Jailhouse non-root cell internal OS restart method, system and storage medium - Google Patents

Jailhouse non-root cell internal OS restart method, system and storage medium Download PDF

Info

Publication number
CN118444987A
CN118444987A CN202410423583.2A CN202410423583A CN118444987A CN 118444987 A CN118444987 A CN 118444987A CN 202410423583 A CN202410423583 A CN 202410423583A CN 118444987 A CN118444987 A CN 118444987A
Authority
CN
China
Prior art keywords
root cell
jailhouse
restart
root
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410423583.2A
Other languages
Chinese (zh)
Other versions
CN118444987B (en
Inventor
王诚超
胡勇强
柯善风
耿文杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Hong Kong Macao Greater Bay Area Guangdong National Innovation Center
Original Assignee
Guangdong Hong Kong Macao Greater Bay Area Guangdong National Innovation Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Hong Kong Macao Greater Bay Area Guangdong National Innovation Center filed Critical Guangdong Hong Kong Macao Greater Bay Area Guangdong National Innovation Center
Priority to CN202410423583.2A priority Critical patent/CN118444987B/en
Publication of CN118444987A publication Critical patent/CN118444987A/en
Application granted granted Critical
Publication of CN118444987B publication Critical patent/CN118444987B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4403Processor initialisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本发明提供了一种jailhouse non‑root cell内部os重启方法、系统以及存储介质,该os重启方法包括以下步骤:基于jailhouse用户态工具启动non‑root cell,得到备份区域;其中,备份区域不属于non‑root cell可访问的内存区域范围,所述备份区域中备份有启动资源;在hypervisor层监听non‑root cell的操作指令,当guest os执行reboot命令时,触发指令,陷入到jailhouse hyperviosr中;hyperviosr层接收到预设操作指令时,从所述备份区域复制guest启动资源到启动区域,执行启动操作流程。通过对启动资源进行备份设置,从而在不破坏jailhouse隔离性的情况下,实现了non‑root cell os的内部重启,同时,通过在hypervisor层监听non‑root cell的操作指令,当non‑root cell的内部操作指令时,在hypervisor层可以对指令操作进行限制和保护,增强os的安全性和隔离性。

The present invention provides a jailhouse non-root cell internal OS restart method, system and storage medium, the OS restart method comprises the following steps: starting the non-root cell based on the jailhouse user mode tool to obtain a backup area; wherein the backup area does not belong to the memory area range accessible to the non-root cell, and the backup area has startup resources backed up; monitoring the operation instructions of the non-root cell at the hypervisor layer, and when the guest OS executes the reboot command, triggering the instruction, and falling into the jailhouse hyperviosr; when the hyperviosr layer receives the preset operation instruction, copying the guest startup resources from the backup area to the startup area, and executing the startup operation process. By backing up the startup resources, the internal restart of the non-root cell OS is realized without destroying the isolation of the jailhouse. At the same time, by monitoring the operation instructions of the non-root cell at the hypervisor layer, when the internal operation instructions of the non-root cell are issued, the instruction operation can be restricted and protected at the hypervisor layer, thereby enhancing the security and isolation of the OS.

Description

jailhouse non-root cell内部os重启方法、系统及存储介质Jailhouse non-root cell internal OS restart method, system and storage medium

技术领域Technical Field

本发明属于计算机技术领域,具体涉及jailhouse non-root cell内部os重启方法、系统及存储介质。The present invention belongs to the field of computer technology, and in particular relates to a jailhouse non-root cell internal OS restart method, system and storage medium.

背景技术Background technique

Jailhouse是一个嵌入式系统的虚拟化工具,它非常强调partition。实时性比较好,隔离的安全性也比较好。由德国西门子开发,始于2013年11月。是一种Type 1类型分区管理程序,其关注于隔离而非虚拟化,旨在创建针对工业级应用程序的小型轻量级管理程序。Jailhouse是从Linux中加载的,并要求Linux提供管理接口,这使得整体代码量相对较小。但在启动后,Jailhouse会完全控制硬件资源并将硬件资源分成独立的cell,这些cell之间完全专用于Guest(inmate),有一个特殊的cell为root cell,其上运行着Linux操作系统。Jailhouse is a virtualization tool for embedded systems, which places great emphasis on partitions. It has better real-time performance and better isolation security. It was developed by Siemens in Germany and started in November 2013. It is a Type 1 partition hypervisor that focuses on isolation rather than virtualization, and aims to create small, lightweight hypervisors for industrial applications. Jailhouse is loaded from Linux and requires Linux to provide a management interface, which makes the overall code size relatively small. But after startup, Jailhouse will fully control the hardware resources and divide the hardware resources into independent cells, which are completely dedicated to the Guest (inmate). There is a special cell called the root cell, which runs the Linux operating system.

在jailhouse中,每个cell(root cell/non-root cell)必须在启动之前进行静态配置。non-root cell的管理都是在linux中进行的,non-root cell中的guest os启动依赖的内核镜像、设备树、文件系统都需要通过root cell中的linux预先加载到non-root cell控制的RAM空间中,guest os启动后,这块RAM空间就会被重置。所以目前jailhouse non-root cell中的guest os,无法像通用os一般在内部通过reboot命令进行重启操作。In jailhouse, each cell (root cell/non-root cell) must be statically configured before startup. Non-root cells are managed in Linux. The kernel image, device tree, and file system that the guest OS in non-root cells rely on for startup need to be pre-loaded into the RAM space controlled by the non-root cell through Linux in the root cell. After the guest OS is started, this RAM space will be reset. Therefore, the guest OS in jailhouse non-root cell cannot be restarted through the reboot command like a general OS.

发明内容Summary of the invention

为了克服现有技术的不足,本发明提供jailhouse non-root cell内部os重启方法、系统及存储介质,以解决现有技术中jailhouse non-root cell中的guest os,无法像通用os一般在内部通过reboot命令进行重启操作的问题。In order to overcome the deficiencies of the prior art, the present invention provides a jailhouse non-root cell internal OS restart method, system and storage medium to solve the problem in the prior art that the guest OS in the jailhouse non-root cell cannot be restarted by internally using a reboot command like a general OS.

本发明其中一个实施例提供了一种jailhouse non-root cell内部os重启方法,包括以下步骤:One embodiment of the present invention provides a method for restarting an internal OS of a jailhouse non-root cell, comprising the following steps:

基于jailhouse用户态工具启动non-root cell,得到备份区域;其中,备份区域不属于non-root cell可访问的内存区域范围,所述备份区域中备份有启动资源,所述启动资源包括guest os内核镜像、设备树和文件系统;Based on the jailhouse user mode tool, the non-root cell is started to obtain a backup area; wherein the backup area does not belong to the memory area range accessible to the non-root cell, and the backup area backs up startup resources, and the startup resources include a guest OS kernel image, a device tree, and a file system;

在hypervisor层监听non-root cell的操作指令,当guest os执行reboot命令时,触发指令,陷入到jailhouse hyperviosr中;Monitor the operation instructions of non-root cells at the hypervisor layer. When the guest OS executes the reboot command, the instruction is triggered and the system falls into the jailhouse hyperviosr.

hyperviosr层接收到预设操作指令时,从所述备份区域复制guest启动资源到启动区域,执行启动操作流程。When the hyperviosr layer receives the preset operation instruction, it copies the guest startup resources from the backup area to the startup area and executes the startup operation process.

本发明提供的jailhouse non-root cell内部os重启方法具有以下有益效果:通过对启动资源进行备份设置,从而在不破坏jailhouse隔离性的情况下,实现了non-rootcell os的内部重启,由于备份区域不属于non-root cell可访问的内存区域范围,确保non-root cell在运行过程中不会变更备份区域的内存块信息。同时,通过在hypervisor层监听non-root cell的操作指令,当non-root cell的内部操作指令时,在hypervisor层可以对指令操作进行限制和保护,增强os的安全性和隔离性。The jailhouse non-root cell internal OS restart method provided by the present invention has the following beneficial effects: by backing up the startup resources, the internal restart of the non-root cell OS is realized without destroying the jailhouse isolation. Since the backup area does not belong to the memory area accessible to the non-root cell, it is ensured that the non-root cell will not change the memory block information of the backup area during operation. At the same time, by monitoring the operation instructions of the non-root cell at the hypervisor layer, when the internal operation instructions of the non-root cell are issued, the instruction operation can be restricted and protected at the hypervisor layer, thereby enhancing the security and isolation of the OS.

在其中一个实施例中,基于jailhouse用户态工具启动non-root cell,包括:In one embodiment, starting a non-root cell based on a jailhouse user mode tool includes:

基于non-root cell配置文件和资源配置文件操作,得到备份区域;Based on the non-root cell configuration file and resource configuration file operations, the backup area is obtained;

在non-root cell启动资源加载过程中,对加载资源的内存区域进行备份至所述备份区域,得到所述guest启动资源。During the non-root cell startup resource loading process, the memory area of the loaded resource is backed up to the backup area to obtain the guest startup resource.

在其中一个实施例中,基于non-root cell配置文件和资源配置文件操作,得到备份区域,包括:In one embodiment, the backup area is obtained based on the non-root cell configuration file and the resource configuration file operation, including:

在所述non-root cell配置文件中增加一块内存配置,用于备份non-root cellos启动依赖的资源文件;Add a memory configuration in the non-root cell configuration file to back up the resource files that the non-root cell os startup depends on;

在所述资源配置文件中,新增内存块配置,并使用宏定义标识对所述内存块进行用途区分。In the resource configuration file, a memory block configuration is newly added, and a macro definition identifier is used to distinguish the usage of the memory block.

在其中一个实施例中,对加载资源的内存区域进行备份至所述备份区域,包括:In one embodiment, backing up the memory area for loading resources to the backup area includes:

在cell load_image加载流程中,增加分支流程,并加载资源到内存空间。In the cell load_image loading process, add a branch process and load resources into the memory space.

在其中一个实施例中,包括:所述加载资源到内存空间的load过程有多次。In one of the embodiments, the process of loading resources into the memory space is repeated multiple times.

在其中一个实施例中,在hypervisor层监听non-root cell的操作指令,包括:In one embodiment, monitoring the operation instructions of the non-root cell at the hypervisor layer includes:

对接收到的指令进行区分处理,判断指令是否为相关指令;Distinguish and process the received instructions to determine whether the instructions are relevant instructions;

对指令再次进行细分,若为重启指令,则增加重启指令处理逻辑;The command is further subdivided. If it is a restart command, the restart command processing logic is added;

当接收到重启sgi消息后,在配置中查找是否存在有配置重启资源块;When receiving the restart sgi message, check whether there is a configured restart resource block in the configuration;

若存在,对重启相关物理块进行内存空间映射,获取虚拟地址;If it exists, perform memory space mapping on the restart-related physical blocks to obtain the virtual address;

若不存在,则直接退出,提示重启失败。If it does not exist, exit directly and prompt that the restart failed.

在其中一个实施例中,增加重启指令处理逻辑,包括:发送sgi消息,通知rootcell调用重启流程代码。In one of the embodiments, a restart instruction processing logic is added, including: sending an sgi message to notify the rootcell to call the restart process code.

在其中一个实施例中,执行启动操作流程,包括:In one embodiment, the startup operation process is performed, including:

先判断当前cell为non-root cell,从列表中获取cell指针对象,发送sgi中断消息,挂起root cell当前cell的cpu;First determine whether the current cell is a non-root cell, obtain the cell pointer object from the list, send an SGI interrupt message, and suspend the CPU of the current cell of the root cell;

将JAILHOUSE_MEM_LOADABLE mem_region从root cell中解除映射;Unmap the JAILHOUSE_MEM_LOADABLE mem_region from the root cell;

重置pci、cell信息,设备启动入口;Reset PCI, cell information, and device startup entry;

恢复cpu,设置reset状态为true。Restore the CPU and set the reset state to true.

本发明其中一个实施例还提供了一种系统,包括包括互相连接的微处理器和存储介质,所述微处理器被编程或配置以执行如上任一项所述的jailhouse non-root cell内部os重启方法。One embodiment of the present invention further provides a system, comprising a microprocessor and a storage medium connected to each other, wherein the microprocessor is programmed or configured to execute the jailhouse non-root cell internal OS restart method as described in any one of the above items.

本发明其中一个实施例还提供了一种存储介质,所述存储介质中存储有计算机程序,其特征在于,所述计算机程序用于被微处理器编程或配置以执行如上任一项所述的jailhouse non-root cell内部os重启方法。One embodiment of the present invention further provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is used to be programmed or configured by a microprocessor to execute the jailhouse non-root cell internal OS restart method as described in any one of the above items.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

图1为本发明其中一实施例提供的jailhouse non-root cell内部os重启方法的流程示意图;FIG1 is a schematic flow chart of a method for restarting an internal OS of a jailhouse non-root cell provided by one embodiment of the present invention;

图2为本发明其中一实施例提供的jailhouse non-root cell内部os重启方法的工作原理示意图;FIG2 is a schematic diagram showing the working principle of a jailhouse non-root cell internal OS restart method provided by one embodiment of the present invention;

图3为图1中S100的子流程示意图;FIG3 is a schematic diagram of a sub-process of S100 in FIG1 ;

图4为图1中S200的子流程示意图;FIG4 is a schematic diagram of a sub-process of S200 in FIG1 ;

图5为本发明其中一实施例提供的电子设备的工作原理示意图。FIG. 5 is a schematic diagram showing the working principle of an electronic device provided by one embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

需要说明,若本发明实施例中有涉及方向性指示(诸如上、下、左、右、前、后……),则该方向性指示仅用于解释在某一特定姿态下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.

另外,若本发明实施例中有涉及“第一”、“第二”等的描述,则该“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,若全文中出现的“和/或”或者“及/或”,其含义包括三个并列的方案,以“A和/或B”为例,包括A方案、或B方案、或A和B同时满足的方案。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features limited to "first" and "second" may explicitly or implicitly include at least one of the features. In addition, if "and/or" or "and/or" appears in the full text, its meaning includes three parallel schemes. Taking "A and/or B" as an example, it includes scheme A, or scheme B, or a scheme that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

请参阅图1-4,本发明其中一个实施例提供了一种jailhouse non-root cell内部os重启方法,包括以下步骤:Referring to FIG. 1-4 , one embodiment of the present invention provides a method for restarting an OS in a jailhouse non-root cell, including the following steps:

S100、基于jailhouse用户态工具启动non-root cell,得到备份区域;其中,备份区域不属于non-root cell可访问的内存区域范围,所述备份区域中备份有启动资源,所述启动资源包括guest os内核镜像、设备树和文件系统;S100, starting the non-root cell based on the jailhouse user mode tool to obtain a backup area; wherein the backup area does not belong to the memory area range accessible to the non-root cell, and the backup area backs up startup resources, and the startup resources include a guest OS kernel image, a device tree, and a file system;

在本实施例中,由于备份区域不属于non-root cell可访问的内存区域范围,从而确保non-root cell在运行过程中不会变更备份区域的内存块信息,增强os的安全性和隔离性。In this embodiment, since the backup area does not belong to the memory area range accessible to the non-root cell, it is ensured that the non-root cell will not change the memory block information of the backup area during operation, thereby enhancing the security and isolation of the OS.

请参阅图3,在其中一个实施例中,基于jailhouse用户态工具启动non-rootcell,包括:Referring to FIG. 3 , in one embodiment, starting a non-root cell based on a jailhouse user mode tool includes:

S110、基于non-root cell配置文件和资源配置文件操作,得到备份区域;具体的,包括:S110, based on the non-root cell configuration file and the resource configuration file, obtain a backup area; specifically, including:

S111、在所述non-root cell配置文件中增加一块内存配置,用于备份non-rootcell os启动依赖的资源文件;S111, adding a memory configuration in the non-root cell configuration file, for backing up resource files that the non-root cell OS depends on for startup;

在本实施例中,在非根单元(non-root cell)的配置文件中增加一块内存配置,用于备份非根单元操作系统启动所需的资源文件,可以通过以下步骤实现:In this embodiment, a memory configuration is added to the configuration file of the non-root cell to back up the resource files required for the startup of the operating system of the non-root cell, which can be achieved by the following steps:

打开该非根单元的配置文件,通常是一个文本文件,可能具有类似JSON或INI格式的结构。在配置文件中找到关于内存分配的部分;在内存部分添加一个新的条目,用来指定备份资源文件所需的内存大小和位置在这个新添加的"backup-region"中,确保设置了适当的大小(size)和起始地址(start),以确保足够的空间用于备份资源文件。你可能需要根据实际情况调整内存大小和位置;保存并关闭配置文件。接下来,在非根单元的启动过程中,该备份内存区域将被用来存储操作系统启动所需的资源文件,提供额外的安全性和备份功能。Open the configuration file of the non-root unit, which is usually a text file and may have a structure similar to JSON or INI format. Find the section about memory allocation in the configuration file; add a new entry in the memory section to specify the memory size and location required for the backup resource file. In this newly added "backup-region", make sure to set the appropriate size (size) and starting address (start) to ensure that there is enough space for the backup resource file. You may need to adjust the memory size and location according to actual conditions; save and close the configuration file. Next, during the startup process of the non-root unit, this backup memory area will be used to store the resource files required for the operating system to start, providing additional security and backup functions.

S112、在所述资源配置文件中,新增内存块配置,并使用宏定义标识对所述内存块进行用途区分。S112: Add a memory block configuration in the resource configuration file, and use a macro definition identifier to distinguish the usage of the memory block.

在本实施例中,在资源配置文件中新增内存块配置并使用宏定义标识用途,可以通过以下步骤实现:打开资源配置文件,通常是一个描述系统硬件资源布局和分配情况的文本文件。在文件中找到描述内存资源分配的部分,在内存块配置中,新增一项用来区分此块内存区域用途的宏定义,在这个新增的配置中,添加了一个名为"usage"的字段,用来指定该内存块的用途。在这里我们使用了"BACKUP"作为示例,你可以根据需求自定义更具体的用途标识,保存并关闭配置文件。这样,在系统运行时,内存管理模块可以根据不同的用途标识来识别和区分各个内存区域,从而更有效地管理和利用系统资源。In this embodiment, adding a new memory block configuration to the resource configuration file and using a macro definition to identify the purpose can be achieved through the following steps: Open the resource configuration file, which is usually a text file that describes the layout and allocation of system hardware resources. Find the part that describes the memory resource allocation in the file, and in the memory block configuration, add a new macro definition to distinguish the purpose of this block of memory area. In this newly added configuration, add a field called "usage" to specify the purpose of the memory block. Here we use "BACKUP" as an example. You can customize a more specific purpose identification according to your needs, save and close the configuration file. In this way, when the system is running, the memory management module can identify and distinguish each memory area according to different purpose identifications, so as to more effectively manage and utilize system resources.

S120、在non-root cell启动资源加载过程中,对加载资源的内存区域进行备份至所述备份区域,得到所述guest启动资源。S120. During the non-root cell startup resource loading process, the memory area of the loaded resource is backed up to the backup area to obtain the guest startup resource.

在本实施例中,请参阅图2,resource-load指的是系统或软件中资源加载(resource loading)的过程。在计算机领域中,资源加载通常指的是将程序执行所需的各种资源(如库文件、配置文件、图像、音频等)从存储介质(如硬盘、网络等)加载到内存中以供程序访问和使用的操作。即,在加载过程中,先在OS resource region中加载资源,并将加载资源备份至bak_region中,从而实现资源备份。In this embodiment, please refer to FIG. 2 , resource-load refers to the process of resource loading in a system or software. In the computer field, resource loading generally refers to the operation of loading various resources (such as library files, configuration files, images, audio, etc.) required for program execution from storage media (such as hard disk, network, etc.) into memory for program access and use. That is, in the loading process, resources are first loaded in the OS resource region, and the loaded resources are backed up in the bak_region, thereby realizing resource backup.

在其中一个实施例中,对加载资源的内存区域进行备份至所述备份区域,包括:In one embodiment, backing up the memory area for loading resources to the backup area includes:

S121、在cell load_image加载流程中,增加分支流程,并加载资源到内存空间。S121. In the cell load_image loading process, add a branch process and load resources into the memory space.

具体的,所述加载资源到内存空间的load过程有多次。Specifically, the process of loading resources into the memory space may be repeated multiple times.

在本实施例中,由于RTOS只有一个bin镜像文件,所以load过程一般只有一次,但是linux启动需要资源内核镜像、设备树、文件系统等,因此load过程会有多次。In this embodiment, since RTOS has only one bin image file, the loading process is generally only once, but Linux startup requires resources such as kernel image, device tree, file system, etc., so the loading process may occur multiple times.

请参阅图3,S200、在hypervisor层监听non-root cell的操作指令,当guest os执行reboot命令时,触发指令,陷入到jailhouse hyperviosr中;Please refer to FIG. 3 , S200 , monitoring the operation instructions of the non-root cell at the hypervisor layer, when the guest OS executes the reboot command, the instruction is triggered and falls into the jailhouse hyperviosr;

在本实施例中,在hypervisor层的cell_create中,需要排除对备份mem_region的映射操作。以保证内存块的隔离性、独立性,non root cell中guest os无法访问此内存块数据。这样可以提高系统的安全性和隔离性,防止非授权访问和数据泄露。实现这一目标的方法包括以下几个步骤:In this embodiment, in the cell_create of the hypervisor layer, the mapping operation of the backup mem_region needs to be excluded. To ensure the isolation and independence of the memory block, the guest OS in the non-root cell cannot access the data of this memory block. This can improve the security and isolation of the system and prevent unauthorized access and data leakage. The method to achieve this goal includes the following steps:

识别备份内存区域:在cell_create函数中,首先需要明确定义和识别出用于备份的特定内存区域。Identify the backup memory area: In the cell_create function, you first need to clearly define and identify the specific memory area for backup.

排除备份内存区域映射:在创建非根单元时,需要排除对备份内存区域的映射操作,即不将备份内存区域映射到非根单元的地址空间中。Exclude backup memory area mapping: When creating a non-root unit, you need to exclude the mapping operation of the backup memory area, that is, do not map the backup memory area to the address space of the non-root unit.

限制访问权限:确保在非根单元中的Guest OS无法直接访问备份内存区域,可以通过设置合适的访问权限、内存映射规则或者其他安全机制来实现。Restrict access permissions: Ensure that the Guest OS in the non-root unit cannot directly access the backup memory area. This can be achieved by setting appropriate access permissions, memory mapping rules, or other security mechanisms.

维护隔离性:持续监控和维护备份内存区域的隔离性,确保只有经过授权的操作才能访问和修改备份数据,避免信息泄露和安全风险。Maintain isolation: Continuously monitor and maintain the isolation of the backup memory area to ensure that only authorized operations can access and modify the backup data, avoiding information leakage and security risks.

在其中一个实施例中,在hypervisor层监听non-root cell的操作指令,包括:In one embodiment, monitoring the operation instructions of the non-root cell at the hypervisor layer includes:

S210、对接收到的指令进行区分处理,判断指令是否为相关指令;S210, distinguishing and processing the received instructions to determine whether the instructions are relevant instructions;

具体的,可以按照以下步骤进行:确保Hypervisor层能够有效地监听来自不同源头的操作指令,可以通过中断、事件轮询或其他方式实现。根据系统设计和需要,将不同类型的指令进行分类,区分出相关指令和非相关指令。相关指令可能与特定功能或安全检查相关,需要特殊处理。针对接收到的指令,编写相应的处理逻辑。对于相关指令,执行相应的操作;对于非相关指令,可以忽略或进行默认处理。在处理指令之前,进行指令匹配判断,验证接收到的指令是否为相关指令。可以通过比较指令内容、操作码等方式进行判断。在处理相关指令时,要考虑安全性因素,确保只有经过授权的指令才会执行相关操作,防止恶意指令的影响。对接收到的指令和处理结果进行日志记录,以便后续审计和故障排查。最后,进行充分的测试和验证,确保指令的分类和判断逻辑正确无误,能够有效地识别并处理相关指令。Specifically, the following steps can be followed: Ensure that the Hypervisor layer can effectively monitor operation instructions from different sources, which can be achieved through interrupts, event polling or other methods. According to system design and needs, classify different types of instructions to distinguish relevant instructions from irrelevant instructions. Relevant instructions may be related to specific functions or security checks and require special processing. Write corresponding processing logic for received instructions. For relevant instructions, perform corresponding operations; for irrelevant instructions, ignore or perform default processing. Before processing instructions, perform instruction matching judgment to verify whether the received instructions are relevant instructions. Judgment can be made by comparing instruction content, operation code, etc. When processing relevant instructions, security factors must be considered to ensure that only authorized instructions will perform relevant operations to prevent the influence of malicious instructions. Log the received instructions and processing results for subsequent auditing and troubleshooting. Finally, conduct sufficient testing and verification to ensure that the classification and judgment logic of instructions are correct and can effectively identify and process relevant instructions.

S220、对指令再次进行细分,若为重启指令,则增加重启指令处理逻辑;S220, further subdividing the instruction, if it is a restart instruction, adding restart instruction processing logic;

在其中一个实施例中,增加重启指令处理逻辑,包括:S221、发送sgi消息,通知root cell调用重启流程代码。In one of the embodiments, a restart instruction processing logic is added, including: S221, sending an sgi message to notify the root cell to call the restart process code.

在本实施例中,由于non-root cell的重启操作是需要通过root cell去控制的,所以需要进行核间通信。In this embodiment, since the restart operation of the non-root cell needs to be controlled by the root cell, inter-core communication is required.

以下是一种可能的实现方式,具体的:在接收到指令后,进一步细分指令类型,判断是否为重启指令。为重启指令编写相应的处理逻辑。在处理重启指令时,需考虑到跨核心重启的特殊性,确保安全可靠地完成重启流程。使用系统提供的核间通信机制,比如SGI消息(Software Generated Interrupt),来实现根单元与非根单元之间的通信。当非根单元需要执行重启操作时,向根单元发送SGI消息作为触发信号。在根单元中实现监听SGI消息的功能,一旦接收到来自非根单元的重启请求,根单元根据情况调用相应的重启流程代码。根单元接收到重启请求后,根据设计需求执行重启流程控制,可能包括保存状态、清理资源、重置系统等操作。在设计核间通信和重启流程时,要考虑系统的安全性和可靠性,防止未经授权的重启操作或意外情况导致系统异常。对核间通信和重启流程进行日志记录,以便后续追踪和排查问题,并可以实时监控通信状态和执行结果。The following is a possible implementation method. Specifically: After receiving the instruction, further subdivide the instruction type to determine whether it is a restart instruction. Write the corresponding processing logic for the restart instruction. When processing the restart instruction, the particularity of cross-core restart must be taken into account to ensure that the restart process is completed safely and reliably. Use the inter-core communication mechanism provided by the system, such as SGI message (Software Generated Interrupt), to implement communication between the root unit and the non-root unit. When the non-root unit needs to perform a restart operation, it sends an SGI message to the root unit as a trigger signal. Implement the function of listening to SGI messages in the root unit. Once a restart request is received from a non-root unit, the root unit calls the corresponding restart process code according to the situation. After receiving the restart request, the root unit executes the restart process control according to the design requirements, which may include operations such as saving status, cleaning up resources, and resetting the system. When designing inter-core communication and restart processes, the security and reliability of the system must be considered to prevent unauthorized restart operations or unexpected situations from causing system abnormalities. Log the inter-core communication and restart process for subsequent tracking and troubleshooting, and monitor the communication status and execution results in real time.

S230、当接收到重启sgi消息后,在配置中查找是否存在有配置重启资源块;S230, after receiving the restart sgi message, search in the configuration whether there is a configured restart resource block;

S240、若存在,对重启相关物理块进行内存空间映射,获取虚拟地址;方便后续内存操作;其中,可以按照以下步骤进行:在系统中确定哪些物理块是与重启相关的,这些物理块可能包含了重启所需的状态、数据或其他信息。使用适当的内核函数或方法,在Hypervisor层将这些重启相关的物理块映射到虚拟地址空间中。通过内存映射操作,获取用于访问这些物理块的虚拟地址。在映射完成后,系统会返回虚拟地址,以便后续对这些物理块的读写操作。一旦获得了虚拟地址,可以在非根单元中进行必要的内存操作,如读取、写入或其他处理。S240. If it exists, perform memory space mapping on the restart-related physical blocks to obtain the virtual address; to facilitate subsequent memory operations; wherein, the following steps can be followed: determine which physical blocks in the system are related to the restart, and these physical blocks may contain the status, data or other information required for the restart. Use appropriate kernel functions or methods to map these restart-related physical blocks to the virtual address space at the Hypervisor layer. Through the memory mapping operation, obtain the virtual address for accessing these physical blocks. After the mapping is completed, the system will return the virtual address for subsequent read and write operations on these physical blocks. Once the virtual address is obtained, necessary memory operations such as reading, writing or other processing can be performed in the non-root unit.

S250、若不存在,则直接退出,提示重启失败。S250, if it does not exist, exit directly and prompt that the restart failed.

根据需要,以下是一种可能的实现步骤:根单元在接收到非根单元发送的重启SGI消息后,触发重启操作。根据系统设计,在配置信息中查找是否存在配置了重启资源块。重启资源块通常包括需要在重启过程中保留或恢复的数据、状态等信息。According to the needs, the following is a possible implementation step: after receiving the restart SGI message sent by the non-root unit, the root unit triggers the restart operation. According to the system design, it is checked whether there is a restart resource block configured in the configuration information. The restart resource block usually includes data, status and other information that need to be retained or restored during the restart process.

若存在配置了重启资源块,则说明系统支持通过这些资源块来完成重启操作所需的相关数据和状态保存;若未找到配置,则表示无法执行完整的重启操作。若存在配置了重启资源块,根据配置信息继续执行重启流程,包括保存和加载相关资源等操作。若未找到配置的重启资源块,立即退出重启流程,并向根单元发送失败通知,以便进一步处理或记录失败原因。在执行重启操作前应考虑数据的完整性和安全性,确保重启资源块的合法性和正确性,防止潜在的漏洞或数据损坏。记录重启操作的执行情况,包括查找重启资源块的结果、是否成功继续处理流程、以及最终的重启成功或失败状态等信息,以便后续分析和审计。If there are configured restart resource blocks, it means that the system supports the use of these resource blocks to save the relevant data and status required for the restart operation; if the configuration is not found, it means that the complete restart operation cannot be performed. If there are configured restart resource blocks, continue to execute the restart process according to the configuration information, including operations such as saving and loading related resources. If the configured restart resource block is not found, exit the restart process immediately and send a failure notification to the root unit for further processing or recording the cause of the failure. Before performing a restart operation, the integrity and security of the data should be considered to ensure the legitimacy and correctness of the restart resource block to prevent potential vulnerabilities or data corruption. Record the execution of the restart operation, including the results of finding the restart resource block, whether the process continues successfully, and the final restart success or failure status, etc., for subsequent analysis and auditing.

S300、hyperviosr层接收到预设操作指令时,从所述备份区域复制guest启动资源到启动区域,执行启动操作流程S300: When the hyperviosr layer receives the preset operation instruction, it copies the guest startup resources from the backup area to the startup area and executes the startup operation process.

在本实施例中,通过将备份区域的信息复制到guest os ram空间后,执行启动操作流程,其中启动代码可参考现有的cell_start代码。In this embodiment, after the information of the backup area is copied to the guest os ram space, the startup operation process is executed, wherein the startup code can refer to the existing cell_start code.

将备份区域的信息复制到guest OS(客户操作系统)的RAM(随机存取存储器)空间,通常需要经过以下步骤:首先需要确定备份区域的位置和内容,这些信息包括备份数据所在的物理块或存储设备。使用合适的内核函数或方法,在Hypervisor层将备份区域所在的物理块映射到虚拟地址空间中,获取备份区域的虚拟地址。在Guest OS中为备份数据分配相应大小的内存空间,用于存放从备份区域复制过来的数据。通过内存操作,将备份数据从备份区域的虚拟地址复制到Guest OS的RAM空间中。这可以通过简单的内存复制操作或者更高级的数据传输机制实现。在完成数据复制后,进行数据完整性的验证,确保数据正确地被复制到了RAM空间中。可以通过校验和或其他校验算法来验证数据的一致性。The following steps are usually required to copy the information in the backup area to the RAM (random access memory) space of the guest OS (client operating system): First, the location and content of the backup area need to be determined, including the physical block or storage device where the backup data is located. Use appropriate kernel functions or methods to map the physical block where the backup area is located to the virtual address space at the Hypervisor layer to obtain the virtual address of the backup area. Allocate a memory space of the corresponding size for the backup data in the Guest OS to store the data copied from the backup area. Through memory operations, copy the backup data from the virtual address of the backup area to the RAM space of the Guest OS. This can be achieved through simple memory copy operations or more advanced data transfer mechanisms. After the data is copied, verify the integrity of the data to ensure that the data is correctly copied to the RAM space. The consistency of the data can be verified by checksum or other verification algorithms.

在其中一个实施例中,执行启动操作流程,包括:In one embodiment, the startup operation process is performed, including:

S310、先判断当前cell为non-root cell,从列表中获取cell指针对象,发送sgi中断消息,挂起root cell当前cell的cpu;S310, first determine whether the current cell is a non-root cell, obtain the cell pointer object from the list, send an SGI interrupt message, and suspend the CPU of the current cell of the root cell;

S320、将JAILHOUSE_MEM_LOADABLE mem_region从root cell中解除映射;S320, unmap the JAILHOUSE_MEM_LOADABLE mem_region from the root cell;

S330、重置pci、cell信息,设备启动入口;S330, reset PCI, cell information, and device startup entry;

S340、恢复cpu,设置reset状态为true。S340, restore the CPU and set the reset state to true.

本发明提供的jailhouse non-root cell内部os重启方法具有以下有益效果:通过对启动资源进行备份设置,从而在不破坏jailhouse隔离性的情况下,实现了non-rootcell os的内部重启,由于备份区域不属于non-root cell可访问的内存区域范围,确保non-root cell在运行过程中不会变更备份区域的内存块信息。同时,通过在hypervisor层监听non-root cell的操作指令,当non-root cell的内部操作指令时,在hypervisor层可以对指令操作进行限制和保护,增强os的安全性和隔离性。The jailhouse non-root cell internal OS restart method provided by the present invention has the following beneficial effects: by backing up the startup resources, the internal restart of the non-root cell OS is realized without destroying the jailhouse isolation. Since the backup area does not belong to the memory area accessible to the non-root cell, it is ensured that the non-root cell will not change the memory block information of the backup area during operation. At the same time, by monitoring the operation instructions of the non-root cell at the hypervisor layer, when the internal operation instructions of the non-root cell are issued, the instruction operation can be restricted and protected at the hypervisor layer, thereby enhancing the security and isolation of the OS.

请参阅图2,本发明所采用的技术方案具体如下:Please refer to FIG2 , the technical solution adopted by the present invention is specifically as follows:

1、用户通过jailhouse用户态工具启动non-root cell;1. The user starts the non-root cell through the jailhouse user mode tool;

2、在non-root cell启动资源加载过程中,对加载资源的内存区域(包含guest os内核镜像、设备树、文件系统等)进行备份。备份区域不属于non-root cell可访问的内存区域范围,以确保non-root cell在运行过程中不会变更备份区域的内存块信息。其中,rootcell ram指的是根Cell(Root Cell)中的内存空间。在虚拟化环境中,根Cell通常是系统中的主要控制单元,负责管理整个虚拟化平台的资源分配、调度和监控。因此,根Cell中的内存是整个虚拟化系统中最重要的资源之一。non-root cell ram指非根Cell(Non-RootCell)中的内存空间。在虚拟化环境中,非根Cell是指不同于根Cell的其他虚拟化单元,通常用于承载客户操作系统或应用程序。OS resource region指的是操作系统(OS)中用于管理和分配资源的内存区域。在操作系统的设计和实现中,资源管理是一个重要的方面,包括内存、CPU时间、设备、文件系统等各种资源的分配和控制。bak_region是指备份区域,以对加载资源的内存区域(包含guest os内核镜像、设备树、文件系统等)进行备份。resource-load指的是系统或软件中资源加载(resource loading)的过程。在计算机领域中,资源加载通常指的是将程序执行所需的各种资源(如库文件、配置文件、图像、音频等)从存储介质(如硬盘、网络等)加载到内存中以供程序访问和使用的操作。即,在加载过程中,先在OSresource region中加载资源,并将加载资源备份至bak_region中;另外,cpu_reset_address是指CPU在执行复位(reset)、重置时跳转到的特定地址。当CPU接收到复位、重置信号时,会执行一系列操作将系统恢复到初始状态,其中一个关键的步骤就是确定CPU应该从哪个地址开始执行指令。2. During the resource loading process of the non-root cell startup, the memory area of the loaded resources (including the guest OS kernel image, device tree, file system, etc.) is backed up. The backup area does not belong to the memory area accessible to the non-root cell to ensure that the non-root cell will not change the memory block information of the backup area during operation. Among them, rootcell ram refers to the memory space in the root cell. In a virtualized environment, the root cell is usually the main control unit in the system, responsible for managing the resource allocation, scheduling and monitoring of the entire virtualization platform. Therefore, the memory in the root cell is one of the most important resources in the entire virtualization system. Non-root cell ram refers to the memory space in the non-root cell. In a virtualized environment, non-root cells refer to other virtualization units different from the root cell, which are usually used to host client operating systems or applications. OS resource region refers to the memory area in the operating system (OS) used to manage and allocate resources. In the design and implementation of the operating system, resource management is an important aspect, including the allocation and control of various resources such as memory, CPU time, devices, and file systems. bak_region refers to the backup area, which is used to back up the memory area where resources are loaded (including guest os kernel image, device tree, file system, etc.). Resource-load refers to the process of resource loading in the system or software. In the computer field, resource loading usually refers to the operation of loading various resources (such as library files, configuration files, images, audio, etc.) required for program execution from storage media (such as hard disk, network, etc.) into memory for program access and use. That is, during the loading process, resources are first loaded in the OSresource region, and the loaded resources are backed up to the bak_region; in addition, cpu_reset_address refers to the specific address that the CPU jumps to when performing a reset. When the CPU receives a reset signal, it will perform a series of operations to restore the system to its initial state. One of the key steps is to determine the address from which the CPU should start executing instructions.

3、在hypervisor层监听non-root cell的操作指令,当guest os执行reboot命令时,会触发指令,陷入到jailhouse hyperviosr中。其中,OS restart是指操作系统(OS)重新启动的过程。在计算机系统中,操作系统的重新启动(restart)是指让操作系统停止当前运行状态,重新初始化系统并重新加载操作系统内核,使其从头开始运行。(tools)是指用于完成特定任务或达到特定目的工具、软件或方法。在计算机领域,工具可以是各种软件程序、编程工具、调试工具等,用于帮助开发人员、系统管理员或用户完成各种操作和任务。jailhouse restaet是指Jailhouse虚拟化中的重新启动(restart)操作。3. Listen to the operation instructions of the non-root cell at the hypervisor layer. When the guest OS executes the reboot command, the instruction will be triggered and the system will fall into the jailhouse hyperviosr. Among them, OS restart refers to the process of restarting the operating system (OS). In a computer system, restarting the operating system means stopping the current running state of the operating system, reinitializing the system and reloading the operating system kernel so that it can start running from the beginning. (Tools) refers to tools, software or methods used to complete specific tasks or achieve specific purposes. In the computer field, tools can be various software programs, programming tools, debugging tools, etc., which are used to help developers, system administrators or users complete various operations and tasks. Jailhouse restaet refers to the restart operation in jailhouse virtualization.

4、hyperviosr层接收到重启操作指令(或者其它的触发方式),从备份区域复制guest启动资源到启动区域,然后执行启动操作流程。4. The hyperviosr layer receives the restart operation instruction (or other triggering methods), copies the guest startup resources from the backup area to the startup area, and then executes the startup operation process.

其中,RAM指的是随机存取存储器(Random Access Memory),是计算机中用于临时存储数据和程序的一种主要内存类型。RAM是一种易失性存储器,即当计算机关闭或断电时,其中存储的数据会丢失。RAM refers to Random Access Memory, which is a main type of memory used in computers to temporarily store data and programs. RAM is a volatile memory, which means that when the computer is turned off or the power is cut off, the data stored in it will be lost.

RAM主要用于存储正在运行的程序、操作系统和相关数据,以及处理器需要快速访问的临时数据。它与硬盘等永久性存储介质相比,具有更快的读写速度,使得计算机能够更快地执行程序和处理数据。RAM is mainly used to store running programs, operating systems and related data, as well as temporary data that the processor needs to access quickly. Compared with permanent storage media such as hard disks, it has faster read and write speeds, allowing the computer to execute programs and process data faster.

以下是RAM的几个重要特点和作用:The following are several important features and functions of RAM:

临时存储:RAM用于临时存储当前正在运行的程序和数据,包括操作系统、应用程序和用户数据等。Temporary storage: RAM is used to temporarily store currently running programs and data, including operating systems, applications, and user data.

快速访问:由于RAM具有较快的读写速度,处理器可以更快地访问存储在RAM中的数据,从而提高系统性能。Faster access: Since RAM has faster read and write speeds, the processor can access data stored in RAM more quickly, thereby improving system performance.

多任务处理:RAM可以同时存储多个程序的数据,支持多任务处理,使得用户能够同时运行多个应用程序。Multitasking: RAM can store data for multiple programs at the same time, supporting multitasking, allowing users to run multiple applications at the same time.

缓存功能:部分RAM被用作缓存,用于存储常用的数据和指令,以加快对这些数据和指令的访问速度。Cache function: Part of the RAM is used as cache to store frequently used data and instructions to speed up access to these data and instructions.

易失性:RAM是一种易失性存储器,断电或重新启动时其中的数据会丢失,因此通常不用于长期数据存储。Volatility: RAM is a volatile memory that loses data when power is removed or restarted, so it is not usually used for long-term data storage.

扩展能力:计算机的RAM容量可以通过添加额外的RAM模块进行扩展,以满足更多内存需求。Expandability: The RAM capacity of a computer can be expanded by adding additional RAM modules to meet more memory needs.

本发明其中一个实施例还提供了一种计算机系统,包括包括互相连接的微处理器和计算机可读存储介质,所述微处理器被编程或配置以执行如上任一项所述的jailhousenon-root cell内部os重启方法。One embodiment of the present invention further provides a computer system, comprising a microprocessor and a computer-readable storage medium connected to each other, wherein the microprocessor is programmed or configured to execute the jailhouse non-root cell internal OS restart method as described in any one of the above items.

本发明其中一个实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其特征在于,所述计算机程序用于被微处理器编程或配置以执行如上任一项所述的jailhouse non-root cell内部os重启方法。One embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is used to be programmed or configured by a microprocessor to execute the jailhouse non-root cell internal OS restart method as described in any one of the above items.

本发明其中一个实施例还提供了一种电子设备,包括:处理器和存储器,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器执行所述计算机指令时,电子设备执行如上所述的jailhouse non-root cell内部os重启方法的步骤。One of the embodiments of the present invention further provides an electronic device, including: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes the steps of the jailhouse non-root cell internal OS restart method as described above.

请参阅图5,图5为本发明实施例提供的一种电子设备的硬件结构示意图。Please refer to FIG. 5 , which is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.

该电子设备2包括处理器21,存储器22,输入装置23,输出装置24。该处理器21、存储器22、输入装置23和输出装置24通过连接器相耦合,该连接器包括各类接口、传输线或总线等等,本发明实施例对此不作限定。应当理解,本发明的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。The electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

处理器21可以是一个或多个图形处理器(graphics processing unit,GPU),在处理器21是一个GPU的情况下,该GPU可以是单核GPU,也可以是多核GPU。可选的,处理器21可以是多个GPU构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。可选的,该处理器还可以为其他类型的处理器等等,本发明实施例不作限定。The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

存储器22可用于存储计算机程序指令,以及用于执行本发明方案的程序代码在内的各类计算机程序代码。可选地,存储器包括但不限于是随机存储记忆体(random accessmemory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasableprogrammable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器用于相关指令及数据。The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

输入装置23用于输入数据和/或信号,以及输出装置24用于输出数据和/或信号。输出装置23和输入装置24可以是独立的器件,也可以是一个整体的器件。The input device 23 is used to input data and/or signals, and the output device 24 is used to output data and/or signals. The output device 23 and the input device 24 can be independent devices or an integrated device.

可理解,本发明实施例中,存储器22不仅可用于存储相关指令,本发明实施例对于该存储器中具体所存储的数据不作限定。It is understandable that in the embodiment of the present invention, the memory 22 can be used not only to store relevant instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.

可以理解的是,图5仅仅示出了一种电子设备的简化设计。在实际应用中,电子设备还可以分别包含必要的其他元件,包含但不限于任意数量的输入/输出装置、处理器、存储器等,而所有可以实现本发明实施例的视频解析装置都在本发明的保护范围之内。It is understandable that FIG5 only shows a simplified design of an electronic device. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all video analysis devices that can implement the embodiments of the present invention are within the protection scope of the present invention.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。所属领域的技术人员还可以清楚地了解到,本发明各个实施例描述各有侧重,为描述的方便和简洁,相同或类似的部分在不同实施例中可能没有赘述,因此,在某一实施例未描述或未详细描述的部分可以参见其他实施例的记载。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.

在本发明所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序待封口件的形式实现。所述计算机程序待封口件包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digitalsubscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digitalversatiledisc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program to be sealed. The computer program to be sealed includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器(read-only memory,ROM)或随机存储存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是在本发明的发明构思下,利用本发明说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本发明的专利保护范围内。The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly/indirectly applied in other related technical fields are included in the patent protection scope of the present invention.

Claims (10)

1. A jailhouse non-root cell internal os restarting method is characterized by comprising the following steps:
Starting a non-root cell based on jailhouse user mode tools to obtain a backup area; the backup area does not belong to the range of a memory area accessible by the non-root cell, starting resources are backed up in the backup area, and the starting resources comprise a guests os kernel mirror image, an equipment tree and a file system;
monitoring an operation instruction of a non-root cell in a hypervisor layer, and triggering the instruction to sink into jailhouse hyperviosr when a deboot command is executed by a gust os;
And when receiving a preset operation instruction, the hyperviosr layer copies the gust starting resource from the backup area to the starting area and executes a starting operation flow.
2. The jailhouse non-root cell internal os restart method of claim 1, wherein starting a non-root cell based on a jailhouse user state tool comprises:
operating based on the non-root cell configuration file and the resource configuration file to obtain a backup area;
and in the non-root cell starting resource loading process, backing up the memory area loading the resources to the backup area to obtain the gust starting resources.
3. The jailhouse non-root cell internal os restart method of claim 2, wherein obtaining a backup area based on non-root cell configuration file and resource configuration file operations comprises:
Adding a memory configuration in the non-root cell configuration file for backing up the resource file on which the non-root cell os is started to depend;
And in the resource configuration file, newly adding memory block configuration, and using macro definition identification to distinguish the purposes of the memory blocks.
4. The jailhouse non-root cell internal os restart method of claim 2, wherein backing up a memory area loading a resource to the backup area comprises:
in the cell load_image loading process, a branch process is added, and resources are loaded into a memory space.
5. The jailhouse non-root cell internal os restart method of claim 4, comprising: the load process of loading the resource into the memory space is multiple times.
6. The jailhouse non-root cell internal os restart method of claim 1, wherein monitoring the operation instruction of the non-root cell at the hypervisor layer comprises:
Distinguishing the received instructions, and judging whether the instructions are related instructions or not;
subdividing the instruction again, and if the instruction is restarted, adding a restarting instruction processing logic;
After receiving the restart sgi message, searching whether a configuration restart resource block exists in the configuration;
if the virtual address exists, performing memory space mapping on the restarting related physical block to acquire the virtual address;
if not, the method directly exits to prompt the restarting failure.
7. The jailhouse non-root cell internal os restart method of claim 6, wherein adding restart instruction processing logic comprises: and sending sgi a message to inform the root cell to call the restart flow code.
8. The jailhouse non-root cell internal os restart method of claim 1, wherein executing a startup operation flow comprises:
Firstly judging the current cell as a non-root cell, acquiring a cell pointer object from a list, sending sgi an interrupt message, and suspending the cpu of the current cell of the root cell;
Demapping JAILHOUSE _mem_ LOADABLE MEM _region from the root cell;
Resetting the information of the PCi and the cell, and starting an inlet by the equipment;
And restoring the cpu, and setting the reset state as true.
9. A system comprising a microprocessor and a storage medium interconnected, wherein the microprocessor is programmed or configured to perform the jailhouse non-root cell internal os restart method of any one of claims 1-8.
10. A storage medium having a computer program stored therein, wherein the computer program is for programming or configuring by a microprocessor to perform the jailhouse non-root cell internal os restart method of any one of claims 1-8.
CN202410423583.2A 2024-04-09 2024-04-09 Jailhouse non-root cell internal OS restart method, system and storage medium Active CN118444987B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410423583.2A CN118444987B (en) 2024-04-09 2024-04-09 Jailhouse non-root cell internal OS restart method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410423583.2A CN118444987B (en) 2024-04-09 2024-04-09 Jailhouse non-root cell internal OS restart method, system and storage medium

Publications (2)

Publication Number Publication Date
CN118444987A true CN118444987A (en) 2024-08-06
CN118444987B CN118444987B (en) 2025-03-11

Family

ID=92317128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410423583.2A Active CN118444987B (en) 2024-04-09 2024-04-09 Jailhouse non-root cell internal OS restart method, system and storage medium

Country Status (1)

Country Link
CN (1) CN118444987B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118796293A (en) * 2024-09-14 2024-10-18 麒麟软件有限公司 Multi-system hibernation method, device and storage medium
CN119311478A (en) * 2024-11-28 2025-01-14 深圳砺驰半导体科技有限公司 Multi-core heterogeneous SOC STR function implementation method and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020014955A1 (en) * 1999-11-15 2002-02-07 Klitsgaard Niels Christian Object detection system
CN104025047A (en) * 2012-01-05 2014-09-03 三菱电机株式会社 Information Processing Device, Information Processing Method, And Computer Program
US20210049263A1 (en) * 2018-03-22 2021-02-18 Trulyprotect Oy Systems and methods for hypervisor-based protection of code
US11113400B1 (en) * 2017-12-26 2021-09-07 Virtuozzo International Gmbh System and method for providing distributed compute platform on untrusted hardware
CN115543545A (en) * 2022-11-25 2022-12-30 麒麟软件有限公司 Method for realizing equipment isolation by Jailhouse using ACPI
CN117648245A (en) * 2023-11-14 2024-03-05 麒麟软件有限公司 Method for debugging jailhouse by using gdb based on qemu

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020014955A1 (en) * 1999-11-15 2002-02-07 Klitsgaard Niels Christian Object detection system
CN104025047A (en) * 2012-01-05 2014-09-03 三菱电机株式会社 Information Processing Device, Information Processing Method, And Computer Program
US20140365823A1 (en) * 2012-01-05 2014-12-11 Mitsubishi Electric Corporation Information processing device, information processing method, and computer program
US11113400B1 (en) * 2017-12-26 2021-09-07 Virtuozzo International Gmbh System and method for providing distributed compute platform on untrusted hardware
US20210049263A1 (en) * 2018-03-22 2021-02-18 Trulyprotect Oy Systems and methods for hypervisor-based protection of code
CN115543545A (en) * 2022-11-25 2022-12-30 麒麟软件有限公司 Method for realizing equipment isolation by Jailhouse using ACPI
CN117648245A (en) * 2023-11-14 2024-03-05 麒麟软件有限公司 Method for debugging jailhouse by using gdb based on qemu

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MICHAEL GLENN HINTON: "Inter-Core Interference Mitigation in a Mixed Criticality System", GOOGLE SCHOLAR, 4 August 2020 (2020-08-04) *
曹宏鹏: "Jailhouse中基于Soft-RoCE的虚拟机间通信研究", 中国优秀硕士学位论文全文数据库 信息科技辑, 15 December 2022 (2022-12-15) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118796293A (en) * 2024-09-14 2024-10-18 麒麟软件有限公司 Multi-system hibernation method, device and storage medium
CN118796293B (en) * 2024-09-14 2025-01-07 麒麟软件有限公司 Multi-system hibernation method, device and storage medium
CN119311478A (en) * 2024-11-28 2025-01-14 深圳砺驰半导体科技有限公司 Multi-core heterogeneous SOC STR function implementation method and electronic device

Also Published As

Publication number Publication date
CN118444987B (en) 2025-03-11

Similar Documents

Publication Publication Date Title
JP6310061B2 (en) Selective retention of application program data migrated from system memory to non-volatile data storage
US10387261B2 (en) System and method to capture stored data following system crash
US9158628B2 (en) Bios failover update with service processor having direct serial peripheral interface (SPI) access
CN118444987B (en) Jailhouse non-root cell internal OS restart method, system and storage medium
US10067692B2 (en) Method and apparatus for backing up and restoring cross-virtual machine application
US20070180206A1 (en) Method of updating a duplicate copy of an operating system on the same disk
JP7586895B2 (en) Data storage using memory aperture flash order
US11126575B1 (en) Interrupt recovery management
US20160314002A1 (en) Caching unified extensible firmware interface (uefi) and/or other firmware instructions in a non-volatile memory of an information handling system (ihs)
JP2017507431A (en) Compute device initialization trace
CN106777394B (en) a cluster file system
US9235426B2 (en) Multicore processor system, computer product, and notification method for updating operating system
US20060005003A1 (en) Method for guest operating system integrity validation
US7284084B2 (en) ROM scan memory expander
JP2013191090A (en) Backup control program, backup control method and information processing apparatus
US9158550B2 (en) Caching based operating system installation
JPWO2004081791A1 (en) Virtual machine system and firmware update method in virtual machine system
US12124866B2 (en) Fast virtual machine resume at host upgrade
TWI662419B (en) A network system with local disks for pooled physical resources
US10838737B1 (en) Restoration of memory content to restore machine state
CN113950673B (en) Non-volatile storage partition identifier
US10613850B1 (en) Performant and secure storage and retrieval of firmware variables
US10509662B1 (en) Virtual devices in a reliable distributed computing system
US20230025126A1 (en) Virtualization layer assisted upgrading of in-guest agents
JP5713089B2 (en) Multi-core processor system, control program, and control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant