Thread (112 messages) 112 messages, 10 authors, 2018-02-19
STALE3040d

[PATCH v3 18/41] KVM: arm64: Move userspace system registers into separate function

From: Julien Grall <hidden>
Date: 2018-02-09 18:50:14
Also in: kvm, kvmarm

Hi Christoffer,

On 01/12/2018 12:07 PM, Christoffer Dall wrote:
quoted hunk ↗ jump to hunk
There's a semantic difference between the EL1 registers that control
operation of a kernel running in EL1 and EL1 registers that only control
userspace execution in EL0.  Since we can defer saving/restoring the
latter, move them into their own function.

We also take this chance to rename the function saving/restoring the
remaining system register to make it clear this function deals with
the EL1 system registers.

No functional change.

Reviewed-by: Andrew Jones <redacted>
Signed-off-by: Christoffer Dall <redacted>
---
  arch/arm64/kvm/hyp/sysreg-sr.c | 46 +++++++++++++++++++++++++++++++-----------
  1 file changed, 34 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/kvm/hyp/sysreg-sr.c b/arch/arm64/kvm/hyp/sysreg-sr.c
index 848a46eb33bf..99dd50ce483b 100644
--- a/arch/arm64/kvm/hyp/sysreg-sr.c
+++ b/arch/arm64/kvm/hyp/sysreg-sr.c
@@ -34,18 +34,27 @@ static void __hyp_text __sysreg_do_nothing(struct kvm_cpu_context *ctxt) { }
  
  static void __hyp_text __sysreg_save_common_state(struct kvm_cpu_context *ctxt)
  {
-	ctxt->sys_regs[ACTLR_EL1]	= read_sysreg(actlr_el1);
I am a bit confused, the comment on top of the function says the host 
must save ACTLR_EL1 in the VHE case. But AFAICT, after this patch the 
register will not get saved in the host context. Did I miss anything?

Cheers,

-- 
Julien Grall
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help