1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2016 - ARM Ltd
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
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)
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
);