lkml.org 
[lkml]   [2019]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 11/15] arm64: KVM/debug: trap all accesses to SPE controls at EL1
    Date
    Now that we have all the save/restore mechanism in place, lets enable
    trapping of accesses to SPE profiling buffer controls at EL1 to EL2.
    This will also change the translation regime used by buffer from EL2
    stage 1 to EL1 stage 1 on VHE systems.

    Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
    ---
    arch/arm64/kvm/hyp/switch.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
    index 844f0dd7a7f0..881901825a85 100644
    --- a/arch/arm64/kvm/hyp/switch.c
    +++ b/arch/arm64/kvm/hyp/switch.c
    @@ -110,6 +110,7 @@ static void activate_traps_vhe(struct kvm_vcpu *vcpu)

    write_sysreg(val, cpacr_el1);

    + write_sysreg(vcpu->arch.mdcr_el2 | 2 << MDCR_EL2_E2PB_SHIFT, mdcr_el2);
    write_sysreg(kvm_get_hyp_vector(), vbar_el1);
    }
    NOKPROBE_SYMBOL(activate_traps_vhe);
    @@ -127,6 +128,7 @@ static void __hyp_text __activate_traps_nvhe(struct kvm_vcpu *vcpu)
    __activate_traps_fpsimd32(vcpu);
    }

    + write_sysreg(vcpu->arch.mdcr_el2 | 2 << MDCR_EL2_E2PB_SHIFT, mdcr_el2);
    write_sysreg(val, cptr_el2);
    }

    --
    2.17.1
    \
     
     \ /
      Last update: 2019-05-23 12:37    [W:6.971 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site