# US 2021/0334125 A1 · Method and Apparatus for Resuming Running of Application, and Computer

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0334125 A1
- Document ID: US20210334125A1
- Status: Published application
- Kind: A1
- Application number: 17/369,546
- Filed: 2021-07-07
- Published: 2021-10-28
- Earliest claimed: 2019-01-18
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Wei Xiao; Yangyang Jiang; Zichang Lin
- Web page: https://patentgrep.com/patent/US20210334125A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/445: Program loading or initiating (bootstrapping G06F9/4401; security arrangements for program loading or initiating G06F21/57)
- G06F 9/45541: {Bare-metal, i.e. hypervisor runs directly on hardware}
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 9/461: {Saving or restoring of program or task context}
- G06F 9/485: {Task life-cycle, e.g. stopping, restarting, resuming execution (G06F9/4881 takes precedence)}
- G06F 11/301: {where the computing system is a virtual computing platform, e.g. logically partitioned systems (virtual machines G06F9/45533; logical partitioning of resources G06F9/5077)}
- G06F 11/302: {where the computing system component is a software system}
- G06F 11/362: Debugging of software
- G06F 2009/45575: {Starting, stopping, suspending or resuming virtual machine instances}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- G06F 2009/45591: {Monitoring or debugging support}
- G06F 2201/815: Virtual
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and an apparatus for resuming running of an application include after running of an application is suspended, the virtual machine monitor stores a context of the application such that when a resumption request of the application is detected, the context of the application is directly restored by the virtual machine monitor.

## Claims

### Claim 1

A method applied to a computer, wherein the method comprises:
obtaining, by a guest operating system of the computer, an exit request;
suspending, by the guest operating system in response to the exit request, an application to cause an exit to a virtual machine monitor of the computer, wherein the application runs on the guest operating system, and wherein the guest operating system runs on the virtual machine monitor;
storing, by the virtual machine monitor, resumption information of the application, wherein the resumption information comprises a first context of the application or a first storage address of the first context;
obtaining, by the virtual machine monitor, a resumption request of the application; and
restoring, by the virtual machine monitor in response to the resumption request, the first context based on the resumption information.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
obtaining, by the guest operating system, the resumption information; and
transferring, by the guest operating system, the resumption information to the virtual machine monitor.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
writing the resumption information into a register accessible to the virtual machine monitor; or
invoking an interface of the virtual machine monitor to transfer the resumption information to the virtual machine monitor.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
transferring, by the guest operating system, a second storage address of a second context of the guest operating system to the virtual machine monitor;
determining, by the virtual machine monitor, the first storage address based on the second storage address and a relationship between the second storage address and the first storage address; and
storing, by the virtual machine monitor, the first storage address or the first context based on the first storage address.

### Claim 5 (depends on 1)

The method of claim 1, wherein the resumption information is the first context, and wherein the method further comprises storing, by the virtual machine monitor, the first context in at least one of:
a control structure of a virtual machine to which the application belongs;
a management structure of a process corresponding to a virtual processor to which the application belongs; or
a storage location other than the control structure and the management structure in a memory of the computer.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
storing the first context in the management structure;
detecting, by a debugging tool that is installed in a host operating system of the computer, a debugging instruction for the application; and
debugging, by the debugging tool, the application based on a third storage address of the first context in the management structure.

### Claim 7 (depends on 1)

The method of claim 1, further comprising storing, by the virtual machine monitor, the first context in a corresponding register.

### Claim 8 (depends on 1)

The method of claim 1, wherein the exit request is based on one of:
a system call triggered by the application;
an exception triggered by the application; or
an interrupt reported by a hardware layer of the computer.

### Claim 9

A computer comprising:
a hardware layer; and
a virtual machine monitor that runs on the hardware layer and configured to:
run a guest operating system;
obtain, using the guest operating system, an exit request;
run an application on the guest operating system, wherein the application comprises resumption information, and wherein the resumption information comprises a first context of the application or a first storage address of the first context;
suspend, using the guest operating system in response to the exit request, the application to cause an exit to the virtual machine monitor;
store the resumption information;
obtain a resumption request of the application; and
restore, in response to the resumption request, the first context based on the resumption information.

### Claim 10 (depends on 9)

The computer of claim 9, wherein the virtual machine monitor is further configured to run the guest operating system to:
obtain the resumption information before causing the exit to the virtual machine monitor; and
transfer the resumption information to the virtual machine monitor.

### Claim 11 (depends on 10)

The computer of claim 10, wherein the virtual machine monitor is further configured to run the guest operating system to:
write the resumption information into a register accessible to the virtual machine monitor; or
invoke an interface of the virtual machine monitor to transfer the resumption information to the virtual machine monitor.

### Claim 12 (depends on 9)

The computer of claim 9, wherein the virtual machine monitor is further configured to run the guest operating system to transfer a second storage address of a second context of the guest operating system to the virtual machine monitor, and wherein the virtual machine monitor is further configured to:
determine the first storage address based on the second storage address and a relationship between the second storage address and the first storage address; and
store the first storage address or the first context based on the first storage address.

### Claim 13 (depends on 9)

The computer of claim 9, wherein the resumption information is the first context, and wherein the virtual machine monitor is further configured to store the first context in at least one of:
a control structure of a virtual machine to which the application belongs;
a management structure of a process corresponding to a virtual processor to which the application belongs; or
a storage location other than the control structure and the management structure in a memory of the computer.

### Claim 14 (depends on 13)

The computer of claim 13, wherein the virtual machine monitor is further configured to store the first context in the management structure, and wherein the virtual machine monitor is further configured to run a host operating system, wherein the host operating system comprises a debugging tool, and wherein the debugging tool is configured to:
detect a debugging instruction for the application; and
debug the application based on a third storage address of the first context in the management structure.

### Claim 15 (depends on 9)

The computer of claim 9, wherein the virtual machine monitor is further configured to store the first context in a corresponding register.

### Claim 16 (depends on 9)

The computer of claim 9, wherein the exit request is based on one of:
a system call triggered by the application;
an exception triggered by the application; or
an interrupt reported by the hardware layer of the computer.

### Claim 17

A computer comprising:
a memory configured to store a computer program; and
a processor coupled to the memory, wherein the computer program causes the processor to be configured to:
obtain an exit request;
suspend, using a guest operating system in response to the exit request, running of an application and cause an exit to a virtual machine monitor;
store, using the virtual machine monitor, resumption information of the application, wherein the resumption information comprises a first context of the application or a first storage address of the first context;
obtain a resumption request of the application; and
restore, using the virtual machine monitor in response to the resumption request, the first context based on the resumption information.

### Claim 18 (depends on 17)

The computer of claim 17, wherein the computer program further causes the processor to be configured to:
obtain, using the guest operating system, the resumption information; and
transfer, using the guest operating system, the resumption information to the virtual machine monitor.

### Claim 19 (depends on 17)

The computer of claim 17, wherein the computer program further causes the processor to be configured to:
transfer, using the guest operating system, a second storage address of a second context of the guest operating system to the virtual machine monitor;
determine, using the virtual machine monitor, the first storage address based on the second storage address and a relationship between the second storage address and the first storage address; and
store, using the virtual machine monitor, the first storage address or the first context based on the first storage address.

### Claim 20

A computer program product comprising computer-executable instructions stored on a non-transitory computer-readable medium that, when executed by a processor, cause an apparatus to:
obtain, using a guest operating system of the apparatus, an exit request;
suspend, using the guest operating system in response to the exit request, an application that runs on the guest operating system and cause an exit to a virtual machine monitor of the apparatus, wherein the guest operating system runs on the virtual machine monitor;
store, using the virtual machine monitor, resumption information of the application, wherein the resumption information comprises a context of the application or a storage address of the context;
obtain, using the virtual machine monitor, a resumption request of the application; and
restore, using the virtual machine monitor in response to the resumption request, the context based on the resumption information.
