aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2021-08-17 09:11:25 +0100
committerMarc Zyngier <maz@kernel.org>2021-08-20 11:12:17 +0100
commit1460b4b25fde52cbee746c11a4b1d3185f2e2847 (patch)
tree136a126e1827173d15a76b6e8a9ab2052410e427 /arch/arm64/include/asm/kvm_host.h
parentKVM: arm64: Refactor sys_regs.h,c for nVHE reuse (diff)
downloadlinux-dev-1460b4b25fde52cbee746c11a4b1d3185f2e2847.tar.xz
linux-dev-1460b4b25fde52cbee746c11a4b1d3185f2e2847.zip
KVM: arm64: Restore mdcr_el2 from vcpu
On deactivating traps, restore the value of mdcr_el2 from the newly created and preserved host value vcpu context, rather than directly reading the hardware register. Up until and including this patch the two values are the same, i.e., the hardware register and the vcpu one. A future patch will be changing the value of mdcr_el2 on activating traps, and this ensures that its value will be restored. No functional change intended. Signed-off-by: Fuad Tabba <tabba@google.com> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210817081134.2918285-7-tabba@google.com
Diffstat (limited to 'arch/arm64/include/asm/kvm_host.h')
-rw-r--r--arch/arm64/include/asm/kvm_host.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 4d2d974c1522..76462c6a91ee 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -287,10 +287,13 @@ struct kvm_vcpu_arch {
/* Stage 2 paging state used by the hardware on next switch */
struct kvm_s2_mmu *hw_mmu;
- /* HYP configuration */
+ /* Values of trap registers for the guest. */
u64 hcr_el2;
u64 mdcr_el2;
+ /* Values of trap registers for the host before guest entry. */
+ u64 mdcr_el2_host;
+
/* Exception Information */
struct kvm_vcpu_fault_info fault;