Weekly-report:20170227-20170305: Difference between revisions

From Xen
Jump to navigationJump to search
Line 1: Line 1:
='''QEMU Process Space Mirroring'''=
='''QEMU Process Space Mirroring'''=


==Design of Process Space Mirror==
==Memory Layout of Our Design Architecture==


[[File:Mirror-process-idea.jpg|900px]]
[[File:Mirror-process-idea.jpg|900px]]
: '''Figure 1: Idea for process mirroring''' <br>
: '''Figure 1: Idea for process mirroring''' <br>

Figure 1 shows a memory layout in our idea. Our architecture occupies the highest virtual addresses. QEMU process has its own related mirrored area. The native and the mirrored virtual area are mapped to different physical memory to ensure that data is replicated physically. This figure is a simple layout, the actual memory layout will be more complicated, e.g., a multi-threaded program has more stack areas, and the dynamic link area is also not shown in this figure.

==Design of Process Space Mirror==


In our previous work, we sucessfully partition memory layout as: reliable zone, normal zone and DMA zone. Thus, based on this work, we can set original memory in the normal zone, and the mirror memory in the DMA zone. The key idea is: when memory management module (MMU) allocates memory space for a process, it creates the mirror space for the same process. We hope to guarantee the write synchronization using binary translation technique.
In our previous work, we sucessfully partition memory layout as: reliable zone, normal zone and DMA zone. Thus, based on this work, we can set original memory in the normal zone, and the mirror memory in the DMA zone. The key idea is: when memory management module (MMU) allocates memory space for a process, it creates the mirror space for the same process. We hope to guarantee the write synchronization using binary translation technique.
Line 10: Line 14:
===Initialization Workflow===
===Initialization Workflow===


The process of creation mirror space:
According to Figure 1, the process of creation mirror space:


* When QEMU process is initialized, a block of physical memory space is reserved as a mirror area in the reliable zone. The size of this area is the same as the memory size to the QEMU memory space (this can be implemented with malloc(), kmalloc(), mmap() etc.).
* When QEMU process is initialized, a block of physical memory space is reserved as a mirror area in the reliable zone. The size of this area is the same as the memory size to the QEMU memory space (this can be implemented with malloc(), kmalloc(), mmap() etc.).
Line 23: Line 27:
* Remap the new page: Corrupted PTE is rewritten and mapped to the new page that was just allocated.
* Remap the new page: Corrupted PTE is rewritten and mapped to the new page that was just allocated.
* Data is copied from mva (mirror virtual address) to nva (native virtual address). After error recovery, the program continues to execute.
* Data is copied from mva (mirror virtual address) to nva (native virtual address). After error recovery, the program continues to execute.

==Memory Layout of Our Design Architecture==

Figure 1 also shows a memory layout in our idea. Our architecture occupies the highest virtual addresses. QEMU process has its own related mirrored area. The native and the mirrored virtual area are mapped to different physical memory to ensure that data is replicated physically. This figure is a simple layout, the actual memory layout will be more complicated, e.g., a multi-threaded program has more stack areas, and the dynamic link area is also not shown in this figure.


='''Mirror VM for QEMU process'''=
='''Mirror VM for QEMU process'''=

Revision as of 21:04, 5 March 2017

QEMU Process Space Mirroring

Memory Layout of Our Design Architecture

Mirror-process-idea.jpg

Figure 1: Idea for process mirroring

Figure 1 shows a memory layout in our idea. Our architecture occupies the highest virtual addresses. QEMU process has its own related mirrored area. The native and the mirrored virtual area are mapped to different physical memory to ensure that data is replicated physically. This figure is a simple layout, the actual memory layout will be more complicated, e.g., a multi-threaded program has more stack areas, and the dynamic link area is also not shown in this figure.

Design of Process Space Mirror

In our previous work, we sucessfully partition memory layout as: reliable zone, normal zone and DMA zone. Thus, based on this work, we can set original memory in the normal zone, and the mirror memory in the DMA zone. The key idea is: when memory management module (MMU) allocates memory space for a process, it creates the mirror space for the same process. We hope to guarantee the write synchronization using binary translation technique.

Initialization Workflow

According to Figure 1, the process of creation mirror space:

  • When QEMU process is initialized, a block of physical memory space is reserved as a mirror area in the reliable zone. The size of this area is the same as the memory size to the QEMU memory space (this can be implemented with malloc(), kmalloc(), mmap() etc.).
  • We modify the MMU to intercepts the page table-related operations of a process. When a native page table is created, the related mirror page table is also created.
  • If occuring process write in the native space, mirror write instruction is then replicated in the mirror space by binary translation, and redundant data is written by the mirror instruction.

Recovery Workflow

When memory failure occurs, error detection mechanism (e.g., ECC, healthlog and stresslog) notifies the host by invoking a machine check exception (MCE). We can modify MCE mechnaism to refuse to restart the whole system, the system quickly and effectively retrieves the corrupted data using the following steps:

  • A new page is allocated to recover the data in the normal zone.
  • Remap the new page: Corrupted PTE is rewritten and mapped to the new page that was just allocated.
  • Data is copied from mva (mirror virtual address) to nva (native virtual address). After error recovery, the program continues to execute.

Mirror VM for QEMU process

Design

Implementation

Checkpoint Setting

Next Week Plan