Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1554076
| From | Jintack Lim <jintack@cs.columbia.edu> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 53/55] KVM: arm64: Reflect shadow VMPIDR_EL2 value to MPIDR_EL1 |
| Date | 2017-01-09 07:40 +0100 |
| Message-ID | <sXBMB-zF-11@gated-at.bofh.it> (permalink) |
| References | <sXBCV-wl-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
A non-secure EL0 or EL1 read of MPIDR_EL1 should return the value of VMPIDR_EL2. We emulate this by copying the virtual VMPIDR_EL2 value to MPIDR_EL1 when entering VM's EL0 or EL1. Signed-off-by: Jintack Lim <jintack@cs.columbia.edu> --- arch/arm64/kvm/context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/kvm/context.c b/arch/arm64/kvm/context.c index 9ebc38f..dd79b0e 100644 --- a/arch/arm64/kvm/context.c +++ b/arch/arm64/kvm/context.c @@ -173,6 +173,12 @@ void kvm_arm_setup_shadow_state(struct kvm_vcpu *vcpu) ctxt->hw_pstate = *vcpu_cpsr(vcpu); ctxt->hw_sys_regs = ctxt->sys_regs; ctxt->hw_sp_el1 = ctxt->gp_regs.sp_el1; + + /* + * A non-secure EL0 or EL1 read of MPIDR_EL1 returns + * the value of VMPIDR_EL2. + */ + ctxt->hw_sys_regs[MPIDR_EL1] = ctxt->el2_regs[VMPIDR_EL2]; } vgic_v2_setup_shadow_state(vcpu); -- 1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[RFC 53/55] KVM: arm64: Reflect shadow VMPIDR_EL2 value to MPIDR_EL1 Jintack Lim <jintack@cs.columbia.edu> - 2017-01-09 07:40 +0100
csiph-web