Patent ID: 7278030

Claim:
A method for virtualizing an access rights protection mechanism and a protection key mechanism in a virtual machine running on a physical hardware system that implements a physical access rights protection mechanism and a physical protection key mechanism, the physical hardware system having a hardware privilege level, the method comprising: providing a guest privilege level for the virtual machine and allowing guest software to operate at any privilege level of the virtual machine while restricting the hardware privilege level at which guest instructions are executed to less than all the possible hardware privilege levels; providing virtual access rights settings and virtual protection key settings to be set by the guest software running on the virtual machine to control the operation of the virtual access rights protection mechanism and the virtual protection key mechanism, respectively; translating the virtual access rights settings into physical access rights settings to control the operation of the physical access rights protection mechanism to permit all attempted memory accesses that should be permitted according to the virtual access rights protection mechanism and to permit one or more memory accesses that should be prevented according to the virtual access rights protection mechanism, the translation of access rights settings being independent of the guest privilege level; and translating both the virtual access rights settings and the virtual protection key settings into physical protection key settings to control the operation of the physical protection key mechanism to prevent all attempted memory accesses that should be prevented according to the virtual access rights protection mechanism, but that are permitted by the physical access rights protection mechanism, as well as preventing all attempted memory accesses that should be prevented according to the virtual protection key mechanism, the translation of protection key settings being dependent on the guest privilege level.