• Sukadev Bhattiprolu's avatar
    powerpc: Introduce the MSR_S bit · 7f70c381
    Sukadev Bhattiprolu authored
    Protected Execution Facility (PEF) is an architectural change for
    POWER 9 that enables Secure Virtual Machines (SVMs). When enabled,
    PEF adds a new higher privileged mode, called Ultravisor mode, to
    POWER architecture.
    
    The hardware changes include the following:
    
      * There is a new bit in the MSR that determines whether the current
        process is running in secure mode, MSR(S) bit 41. MSR(S)=1, process
        is in secure mode, MSR(s)=0 process is in normal mode.
    
      * The MSR(S) bit can only be set by the Ultravisor.
    
      * HRFID cannot be used to set the MSR(S) bit. If the hypervisor needs
        to return to a SVM it must use an ultracall. It can determine if
        the VM it is returning to is secure.
    
      * The privilege of a process is now determined by three MSR bits,
        MSR(S, HV, PR). In each of the tables below the modes are listed
        from least privilege to highest privilege. The higher privilege
        modes can access all the resources of the lower privilege modes.
    
        **Secure Mode MSR Settings**
    
           +---+---+---+---------------+
           | S | HV| PR|Privilege      |
           +===+===+===+===============+
           | 1 | 0 | 1 | Problem       |
           +---+---+---+---------------+
           | 1 | 0 | 0 | Privileged(OS)|
           +---+---+---+---------------+
           | 1 | 1 | 0 | Ultravisor    |
           +---+---+---+---------------+
           | 1 | 1 | 1 | Reserved      |
           +---+---+---+---------------+
    
        **Normal Mode MSR Settings**
    
           +---+---+---+---------------+
           | S | HV| PR|Privilege      |
           +===+===+===+===============+
           | 0 | 0 | 1 | Problem       |
           +---+---+---+---------------+
           | 0 | 0 | 0 | Privileged(OS)|
           +---+---+---+---------------+
           | 0 | 1 | 0 | Hypervisor    |
           +---+---+---+---------------+
           | 0 | 1 | 1 | Problem (HV)  |
           +---+---+---+---------------+
    Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
    Signed-off-by: default avatarRam Pai <linuxram@us.ibm.com>
    [ cclaudio: Update the commit message ]
    Signed-off-by: default avatarClaudio Carvalho <cclaudio@linux.ibm.com>
    Signed-off-by: default avatarThiago Jung Bauermann <bauerman@linux.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20190820021326.6884-7-bauerman@linux.ibm.com
    7f70c381
reg.h 62.7 KB