Linux 5.6.13
[linux/fpc-iii.git] / arch / arm / kvm / hyp / s2-setup.c
blob5dfbea5adf65195e0ee8c32f1d3baa3d975fa24a
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Copyright (C) 2016 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 */
7 #include <linux/types.h>
8 #include <asm/kvm_arm.h>
9 #include <asm/kvm_asm.h>
10 #include <asm/kvm_hyp.h>
12 void __hyp_text __init_stage2_translation(void)
14 u64 val;
16 val = read_sysreg(VTCR) & ~VTCR_MASK;
18 val |= read_sysreg(HTCR) & VTCR_HTCR_SH;
19 val |= KVM_VTCR_SL0 | KVM_VTCR_T0SZ | KVM_VTCR_S;
21 write_sysreg(val, VTCR);