GNU Linux-libre 5.4.274-gnu1
[releases.git] / arch / arm / kvm / coproc_a15.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2012 - Virtual Open Systems and Columbia University
4  * Authors: Rusty Russell <rusty@rustcorp.au>
5  *          Christoffer Dall <c.dall@virtualopensystems.com>
6  */
7 #include <linux/kvm_host.h>
8 #include <asm/kvm_coproc.h>
9 #include <asm/kvm_emulate.h>
10 #include <linux/init.h>
11
12 #include "coproc.h"
13
14 /*
15  * A15-specific CP15 registers.
16  * CRn denotes the primary register number, but is copied to the CRm in the
17  * user space API for 64-bit register access in line with the terminology used
18  * in the ARM ARM.
19  * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
20  *            registers preceding 32-bit ones.
21  */
22 static const struct coproc_reg a15_regs[] = {
23         /* SCTLR: swapped by interrupt.S. */
24         { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
25                         access_vm_reg, reset_val, c1_SCTLR, 0x00C50078 },
26 };
27
28 static struct kvm_coproc_target_table a15_target_table = {
29         .target = KVM_ARM_TARGET_CORTEX_A15,
30         .table = a15_regs,
31         .num = ARRAY_SIZE(a15_regs),
32 };
33
34 static int __init coproc_a15_init(void)
35 {
36         kvm_register_target_coproc_table(&a15_target_table);
37         return 0;
38 }
39 late_initcall(coproc_a15_init);