blob: a7136757d3731534fd169e06938c74b85803cdfc [file] [log] [blame]
Christoffer Dall5b3e5e52013-01-20 18:28:09 -05001/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Authors: Rusty Russell <rusty@rustcorp.au>
4 * Christoffer Dall <c.dall@virtualopensystems.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, version 2, as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#include <linux/kvm_host.h>
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050020#include <asm/kvm_coproc.h>
Jonathan Austine8c2d992013-09-26 16:49:28 +010021#include <asm/kvm_emulate.h>
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050022#include <linux/init.h>
23
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050024#include "coproc.h"
25
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050026/*
27 * A15-specific CP15 registers.
Christoffer Dall240e99c2013-08-05 18:08:41 -070028 * CRn denotes the primary register number, but is copied to the CRm in the
29 * user space API for 64-bit register access in line with the terminology used
30 * in the ARM ARM.
31 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
32 * registers preceding 32-bit ones.
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050033 */
34static const struct coproc_reg a15_regs[] = {
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050035 /* SCTLR: swapped by interrupt.S. */
36 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
Marc Zyngier3c1e7162014-12-19 16:05:31 +000037 access_vm_reg, reset_val, c1_SCTLR, 0x00C50078 },
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050038};
39
40static struct kvm_coproc_target_table a15_target_table = {
41 .target = KVM_ARM_TARGET_CORTEX_A15,
42 .table = a15_regs,
43 .num = ARRAY_SIZE(a15_regs),
44};
45
46static int __init coproc_a15_init(void)
47{
Christoffer Dall5b3e5e52013-01-20 18:28:09 -050048 kvm_register_target_coproc_table(&a15_target_table);
49 return 0;
50}
51late_initcall(coproc_a15_init);