coproc_a15.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  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>
  20. #include <asm/kvm_coproc.h>
  21. #include <asm/kvm_emulate.h>
  22. #include <linux/init.h>
  23. #include "coproc.h"
  24. /*
  25. * A15-specific CP15 registers.
  26. * CRn denotes the primary register number, but is copied to the CRm in the
  27. * user space API for 64-bit register access in line with the terminology used
  28. * in the ARM ARM.
  29. * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
  30. * registers preceding 32-bit ones.
  31. */
  32. static const struct coproc_reg a15_regs[] = {
  33. /* SCTLR: swapped by interrupt.S. */
  34. { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
  35. access_vm_reg, reset_val, c1_SCTLR, 0x00C50078 },
  36. };
  37. static struct kvm_coproc_target_table a15_target_table = {
  38. .target = KVM_ARM_TARGET_CORTEX_A15,
  39. .table = a15_regs,
  40. .num = ARRAY_SIZE(a15_regs),
  41. };
  42. static int __init coproc_a15_init(void)
  43. {
  44. kvm_register_target_coproc_table(&a15_target_table);
  45. return 0;
  46. }
  47. late_initcall(coproc_a15_init);