projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23afc82
)
KVM: arm64: Add some more comments in kvm_hyp_handle_fpsimd()
author
Mark Brown
<broonie@kernel.org>
Mon, 24 Jan 2022 15:57:20 +0000
(15:57 +0000)
committer
Marc Zyngier
<maz@kernel.org>
Tue, 8 Feb 2022 14:42:59 +0000
(14:42 +0000)
The handling for FPSIMD/SVE traps is multi stage and involves some trap
manipulation which isn't quite so immediately obvious as might be desired
so add a few more comments.
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link:
https://lore.kernel.org/r/20220124155720.3943374-3-broonie@kernel.org
arch/arm64/kvm/hyp/include/hyp/switch.h
patch
|
blob
|
blame
|
history
diff --git
a/arch/arm64/kvm/hyp/include/hyp/switch.h
b/arch/arm64/kvm/hyp/include/hyp/switch.h
index 701cfb964905df6384168380505408b0fc4be0a1..667654bd373482806acb9bc2aa4a2afbe278d663 100644
(file)
--- a/
arch/arm64/kvm/hyp/include/hyp/switch.h
+++ b/
arch/arm64/kvm/hyp/include/hyp/switch.h
@@
-173,6
+173,8
@@
static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code)
return false;
/* Valid trap. Switch the context: */
+
+ /* First disable enough traps to allow us to update the registers */
if (has_vhe()) {
reg = CPACR_EL1_FPEN;
if (sve_guest)
@@
-188,11
+190,13
@@
static bool kvm_hyp_handle_fpsimd(struct kvm_vcpu *vcpu, u64 *exit_code)
}
isb();
+ /* Write out the host state if it's in the registers */
if (vcpu->arch.flags & KVM_ARM64_FP_HOST) {
__fpsimd_save_state(vcpu->arch.host_fpsimd_state);
vcpu->arch.flags &= ~KVM_ARM64_FP_HOST;
}
+ /* Restore the guest state */
if (sve_guest)
__hyp_sve_restore_guest(vcpu);
else