David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 - Virtual Open Systems and Columbia University |
| 4 | * Copyright (C) 2013 - ARM Ltd |
| 5 | * |
| 6 | * Authors: Rusty Russell <rusty@rustcorp.au> |
| 7 | * Christoffer Dall <c.dall@virtualopensystems.com> |
| 8 | * Jonathan Austin <jonathan.austin@arm.com> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 9 | */ |
| 10 | #include <linux/kvm_host.h> |
| 11 | #include <asm/kvm_coproc.h> |
| 12 | #include <asm/kvm_emulate.h> |
| 13 | #include <linux/init.h> |
| 14 | |
| 15 | #include "coproc.h" |
| 16 | |
| 17 | /* |
| 18 | * Cortex-A7 specific CP15 registers. |
| 19 | * CRn denotes the primary register number, but is copied to the CRm in the |
| 20 | * user space API for 64-bit register access in line with the terminology used |
| 21 | * in the ARM ARM. |
| 22 | * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit |
| 23 | * registers preceding 32-bit ones. |
| 24 | */ |
| 25 | static const struct coproc_reg a7_regs[] = { |
| 26 | /* SCTLR: swapped by interrupt.S. */ |
| 27 | { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, |
| 28 | access_vm_reg, reset_val, c1_SCTLR, 0x00C50878 }, |
| 29 | }; |
| 30 | |
| 31 | static struct kvm_coproc_target_table a7_target_table = { |
| 32 | .target = KVM_ARM_TARGET_CORTEX_A7, |
| 33 | .table = a7_regs, |
| 34 | .num = ARRAY_SIZE(a7_regs), |
| 35 | }; |
| 36 | |
| 37 | static int __init coproc_a7_init(void) |
| 38 | { |
| 39 | kvm_register_target_coproc_table(&a7_target_table); |
| 40 | return 0; |
| 41 | } |
| 42 | late_initcall(coproc_a7_init); |