Weekly-report:20170227-20170305: Difference between revisions
Binqbu2002 (talk | contribs) |
Binqbu2002 (talk | contribs) |
||
Line 24: | Line 24: | ||
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. |
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'''= |
='''Mirror VM for QEMU process'''= |
||
==Design== |
==Design== |
Revision as of 21:01, 5 March 2017
QEMU Process Space Mirroring
Design of Process Space Mirror
- Figure 1: Idea for process mirroring
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.
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.
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.
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.