什麼是敏感指令

1974年,Popek和Goldberg在美國电脑協會的通訊期刊上發表了一篇論文"虛擬化第三代架構的一般性要求"(Formal Requirements for Virtualizable Third Generation Architectures)。在這篇文章中,提出了敏感指令的概念。

敏感指令(Sensitive Instructions)的定義: 敏感指令是這樣一組指令,這些指令的行為取決於指令執行時處理器的工作模式,以及指令在記憶體中的位置。

——-

對敏感指令的處理是虛擬化技術的一個關鍵點。在用戶態執行的敏感指令如果總會造成陷入(always generates a trap),這樣的敏感指令也屬於特權 指令。在不使用Wmware提出的動態二進制翻譯機制的情況下,除非所有的敏感指令都是特權指令,虛擬機管理程式才能保證正確運行。換言之,如果某種處理器架構的所有的敏感指令都是特權指令的一個子集,我們就可以說這種處理器架構是可虛擬化的。在這種情況下,我們就可以肜經典的“陷入後模擬“(trap-and-emulate)的方法實現虛擬化。按照這個定義,在嵌入式工業中最常見的ARM架構則不是可虛擬化的,因為ARM的敏感指令有些是特權指令,有些則不是。

原文 from the paper "KVM for ARM" by Christoffer Dall and Jason Nieh, Columbia University:Popek and Goldberg define sensitive instructions as the group of instructions where the effect of their execution depends on the mode of the processor or the location of the instruction in physical memory. A sensitive instruction is also privileged if it always generates a trap, when executed in user mode. The VMM can only guarantee correct execution without the use of dynamic translation if all sensitive instructions are also privileged. In other words, an architecture is virtualizable if and only if the set of sensitive instrucctions is a subset of the seet of privileged instructions. If that is the case, the VMM can be implemented using a classic trap-and-emulate solution. Unfortunately, ARM is not virtualizable as the architecture defines both sensitive privileged instructions and sensitive non-privileged instructions.

ykyi.net 翻译

Leave a Reply

Your email address will not be published. Required fields are marked *