KVM
|
#include <linux/bitfield.h>
#include <linux/bsearch.h>
#include <linux/cacheinfo.h>
#include <linux/kvm_host.h>
#include <linux/mm.h>
#include <linux/printk.h>
#include <linux/uaccess.h>
#include <asm/cacheflush.h>
#include <asm/cputype.h>
#include <asm/debug-monitors.h>
#include <asm/esr.h>
#include <asm/kvm_arm.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
#include <asm/kvm_mmu.h>
#include <asm/kvm_nested.h>
#include <asm/perf_event.h>
#include <asm/sysreg.h>
#include <trace/events/kvm.h>
#include "sys_regs.h"
#include "trace.h"
Go to the source code of this file.
Macros | |
#define | PURE_EL2_SYSREG(el2) |
#define | MAPPED_EL2_SYSREG(el2, el1, fn) |
#define | CSSELR_MAX 14 |
#define | DBG_BCR_BVR_WCR_WVR_EL1(n) |
#define | PMU_SYS_REG(name) |
#define | PMU_PMEVCNTR_EL0(n) |
#define | PMU_PMEVTYPER_EL0(n) |
#define | AMU_AMEVCNTR0_EL0(n) { SYS_DESC(SYS_AMEVCNTR0_EL0(n)), undef_access } |
#define | AMU_AMEVTYPER0_EL0(n) { SYS_DESC(SYS_AMEVTYPER0_EL0(n)), undef_access } |
#define | AMU_AMEVCNTR1_EL0(n) { SYS_DESC(SYS_AMEVCNTR1_EL0(n)), undef_access } |
#define | AMU_AMEVTYPER1_EL0(n) { SYS_DESC(SYS_AMEVTYPER1_EL0(n)), undef_access } |
#define | __PTRAUTH_KEY(k) |
#define | PTRAUTH_KEY(k) |
#define | ID_REG_LIMIT_FIELD_ENUM(val, reg, field, limit) |
#define | MTE_REG(name) |
#define | EL2_REG(name, acc, rst, v) |
#define | EL2_REG_VNCR(name, rst, v) EL2_REG(name, bad_vncr_trap, rst, v) |
#define | EL2_REG_REDIR(name, rst, v) EL2_REG(name, bad_redir_trap, rst, v) |
#define | EL12_REG(name, acc, rst, v) |
#define | ID_DESC(name) |
#define | ID_SANITISED(name) |
#define | AA32_ID_SANITISED(name) |
#define | ID_WRITABLE(name, mask) |
#define | ID_UNALLOCATED(crm, op2) |
#define | ID_HIDDEN(name) |
#define | DBG_BCR_BVR_WCR_WVR(n) |
#define | DBGBXVR(n) { AA32(HI), Op1( 0), CRn( 1), CRm((n)), Op2( 1), trap_bvr, NULL, n } |
#define | CP15_PMU_SYS_REG(_map, _Op1, _CRn, _CRm, _Op2) |
#define | PMU_PMEVCNTR(n) |
#define | PMU_PMEVTYPER(n) |
#define | FUNCTION_INVARIANT(reg) |
#define | KVM_ARM_FEATURE_ID_RANGE_INDEX(r) |
Functions | |
static u64 | sys_reg_to_index (const struct sys_reg_desc *reg) |
static int | set_id_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static bool | bad_trap (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *r, const char *msg) |
static bool | read_from_write_only (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *r) |
static bool | write_to_read_only (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *r) |
static bool | get_el2_to_el1_mapping (unsigned int reg, unsigned int *el1r, u64(**xlate)(u64)) |
u64 | vcpu_read_sys_reg (const struct kvm_vcpu *vcpu, int reg) |
void | vcpu_write_sys_reg (struct kvm_vcpu *vcpu, u64 val, int reg) |
static u8 | get_min_cache_line_size (bool icache) |
static u32 | get_ccsidr (struct kvm_vcpu *vcpu, u32 csselr) |
static int | set_ccsidr (struct kvm_vcpu *vcpu, u32 csselr, u32 val) |
static bool | access_rw (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_dcsw (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_dcgsw (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static void | get_access_mask (const struct sys_reg_desc *r, u64 *mask, u64 *shift) |
static bool | access_vm_reg (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_actlr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_gic_sgi (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_gic_sre (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_raz_wi (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_undef (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_loregion (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_oslar_el1 (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_oslsr_el1 (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static int | set_oslsr_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static bool | trap_dbgauthstatus_el1 (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_debug_regs (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static void | reg_to_dbg (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd, u64 *dbg_reg) |
static void | dbg_to_reg (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd, u64 *dbg_reg) |
static bool | trap_bvr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd) |
static int | set_bvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static int | get_bvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static u64 | reset_bvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | trap_bcr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd) |
static int | set_bcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static int | get_bcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static u64 | reset_bcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | trap_wvr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd) |
static int | set_wvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static int | get_wvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static u64 | reset_wvr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | trap_wcr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *rd) |
static int | set_wcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static int | get_wcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static u64 | reset_wcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static u64 | reset_amair_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_actlr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_mpidr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static unsigned int | pmu_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_pmu_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_pmevcntr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_pmevtyper (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_pmselr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | reset_pmcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static bool | check_pmu_access_disabled (struct kvm_vcpu *vcpu, u64 flags) |
static bool | pmu_access_el0_disabled (struct kvm_vcpu *vcpu) |
static bool | pmu_write_swinc_el0_disabled (struct kvm_vcpu *vcpu) |
static bool | pmu_access_cycle_counter_el0_disabled (struct kvm_vcpu *vcpu) |
static bool | pmu_access_event_counter_el0_disabled (struct kvm_vcpu *vcpu) |
static bool | access_pmcr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmselr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmceid (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | pmu_counter_idx_valid (struct kvm_vcpu *vcpu, u64 idx) |
static int | get_pmu_evcntr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r, u64 *val) |
static bool | access_pmu_evcntr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmu_evtyper (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static int | set_pmreg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r, u64 val) |
static int | get_pmreg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r, u64 *val) |
static bool | access_pmcnten (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pminten (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmovs (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmswinc (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_pmuserenr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static int | get_pmcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r, u64 *val) |
static int | set_pmcr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r, u64 val) |
static bool | undef_access (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static unsigned int | ptrauth_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | access_arch_timer (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static s64 | kvm_arm64_ftr_safe_value (u32 id, const struct arm64_ftr_bits *ftrp, s64 new, s64 cur) |
static int | arm64_check_features (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static u8 | pmuver_to_perfmon (u8 pmuver) |
static u64 | __kvm_read_sanitised_id_reg (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | kvm_read_sanitised_id_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static u64 | read_id_reg (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static bool | is_id_reg (u32 id) |
static bool | is_aa32_id_reg (u32 id) |
static unsigned int | id_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static unsigned int | aa32_id_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static unsigned int | raz_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static bool | access_id_reg (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static unsigned int | sve_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static u64 | read_sanitised_id_aa64pfr0_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static u64 | read_sanitised_id_aa64dfr0_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static int | set_id_aa64dfr0_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static u64 | read_sanitised_id_dfr0_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static int | set_id_dfr0_el1 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static int | get_id_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static int | get_raz_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 *val) |
static int | set_wi_reg (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static bool | access_ctr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_clidr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static u64 | reset_clidr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *r) |
static int | set_clidr (struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 val) |
static bool | access_csselr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_ccsidr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static unsigned int | mte_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static unsigned int | el2_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | bad_vncr_trap (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | bad_redir_trap (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static unsigned int | hidden_user_visibility (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd) |
static bool | access_sp_el1 (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_elr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | access_spsr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | trap_dbgdidr (struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) |
static bool | check_sysreg_table (const struct sys_reg_desc *table, unsigned int n, bool is_32) |
int | kvm_handle_cp14_load_store (struct kvm_vcpu *vcpu) |
static void | perform_access (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *r) |
static bool | emulate_cp (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *table, size_t num) |
static void | unhandled_cp_access (struct kvm_vcpu *vcpu, struct sys_reg_params *params) |
static int | kvm_handle_cp_64 (struct kvm_vcpu *vcpu, const struct sys_reg_desc *global, size_t nr_global) |
static bool | emulate_sys_reg (struct kvm_vcpu *vcpu, struct sys_reg_params *params) |
static bool | kvm_esr_cp10_id_to_sys64 (u64 esr, struct sys_reg_params *params) |
int | kvm_handle_cp10_id (struct kvm_vcpu *vcpu) |
static int | kvm_emulate_cp15_id_reg (struct kvm_vcpu *vcpu, struct sys_reg_params *params) |
static int | kvm_handle_cp_32 (struct kvm_vcpu *vcpu, struct sys_reg_params *params, const struct sys_reg_desc *global, size_t nr_global) |
int | kvm_handle_cp15_64 (struct kvm_vcpu *vcpu) |
int | kvm_handle_cp15_32 (struct kvm_vcpu *vcpu) |
int | kvm_handle_cp14_64 (struct kvm_vcpu *vcpu) |
int | kvm_handle_cp14_32 (struct kvm_vcpu *vcpu) |
static bool | is_imp_def_sys_reg (struct sys_reg_params *params) |
static void | kvm_reset_id_regs (struct kvm_vcpu *vcpu) |
void | kvm_reset_sys_regs (struct kvm_vcpu *vcpu) |
int | kvm_handle_sys_reg (struct kvm_vcpu *vcpu) |
static bool | index_to_params (u64 id, struct sys_reg_params *params) |
const struct sys_reg_desc * | get_reg_by_id (u64 id, const struct sys_reg_desc table[], unsigned int num) |
static const struct sys_reg_desc * | id_to_sys_reg_desc (struct kvm_vcpu *vcpu, u64 id, const struct sys_reg_desc table[], unsigned int num) |
static u64 | get_ctr_el0 (struct kvm_vcpu *v, const struct sys_reg_desc *r) |
static int | get_invariant_sys_reg (u64 id, u64 __user *uaddr) |
static int | set_invariant_sys_reg (u64 id, u64 __user *uaddr) |
static int | demux_c15_get (struct kvm_vcpu *vcpu, u64 id, void __user *uaddr) |
static int | demux_c15_set (struct kvm_vcpu *vcpu, u64 id, void __user *uaddr) |
int | kvm_sys_reg_get_user (struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg, const struct sys_reg_desc table[], unsigned int num) |
int | kvm_arm_sys_reg_get_reg (struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) |
int | kvm_sys_reg_set_user (struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg, const struct sys_reg_desc table[], unsigned int num) |
int | kvm_arm_sys_reg_set_reg (struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) |
static unsigned int | num_demux_regs (void) |
static int | write_demux_regids (u64 __user *uindices) |
static bool | copy_reg_to_user (const struct sys_reg_desc *reg, u64 __user **uind) |
static int | walk_one_sys_reg (const struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, u64 __user **uind, unsigned int *total) |
static int | walk_sys_regs (struct kvm_vcpu *vcpu, u64 __user *uind) |
unsigned long | kvm_arm_num_sys_reg_descs (struct kvm_vcpu *vcpu) |
int | kvm_arm_copy_sys_reg_indices (struct kvm_vcpu *vcpu, u64 __user *uindices) |
static bool | is_feature_id_reg (u32 encoding) |
int | kvm_vm_ioctl_get_reg_writable_masks (struct kvm *kvm, struct reg_mask_range *range) |
int __init | kvm_sys_reg_table_init (void) |
Variables | |
static const struct sys_reg_desc | sys_reg_descs [] |
static const struct sys_reg_desc * | first_idreg |
static const struct sys_reg_desc | cp14_regs [] |
static const struct sys_reg_desc | cp14_64_regs [] |
static const struct sys_reg_desc | cp15_regs [] |
static const struct sys_reg_desc | cp15_64_regs [] |
static struct sys_reg_desc invariant_sys_regs[] | __ro_after_init |
#define __PTRAUTH_KEY | ( | k | ) |
Definition at line 1360 of file sys_regs.c.
#define AA32_ID_SANITISED | ( | name | ) |
Definition at line 2096 of file sys_regs.c.
#define AMU_AMEVCNTR0_EL0 | ( | n | ) | { SYS_DESC(SYS_AMEVCNTR0_EL0(n)), undef_access } |
Definition at line 1343 of file sys_regs.c.
#define AMU_AMEVCNTR1_EL0 | ( | n | ) | { SYS_DESC(SYS_AMEVCNTR1_EL0(n)), undef_access } |
Definition at line 1345 of file sys_regs.c.
#define AMU_AMEVTYPER0_EL0 | ( | n | ) | { SYS_DESC(SYS_AMEVTYPER0_EL0(n)), undef_access } |
Definition at line 1344 of file sys_regs.c.
#define AMU_AMEVTYPER1_EL0 | ( | n | ) | { SYS_DESC(SYS_AMEVTYPER1_EL0(n)), undef_access } |
Definition at line 1346 of file sys_regs.c.
#define CP15_PMU_SYS_REG | ( | _map, | |
_Op1, | |||
_CRn, | |||
_CRm, | |||
_Op2 | |||
) |
Definition at line 2872 of file sys_regs.c.
#define CSSELR_MAX 14 |
Definition at line 215 of file sys_regs.c.
#define DBG_BCR_BVR_WCR_WVR | ( | n | ) |
Definition at line 2761 of file sys_regs.c.
#define DBG_BCR_BVR_WCR_WVR_EL1 | ( | n | ) |
Definition at line 1308 of file sys_regs.c.
Definition at line 2771 of file sys_regs.c.
#define EL12_REG | ( | name, | |
acc, | |||
rst, | |||
v | |||
) |
Definition at line 2061 of file sys_regs.c.
#define EL2_REG | ( | name, | |
acc, | |||
rst, | |||
v | |||
) |
Definition at line 2038 of file sys_regs.c.
#define EL2_REG_REDIR | ( | name, | |
rst, | |||
v | |||
) | EL2_REG(name, bad_redir_trap, rst, v) |
Definition at line 2048 of file sys_regs.c.
#define EL2_REG_VNCR | ( | name, | |
rst, | |||
v | |||
) | EL2_REG(name, bad_vncr_trap, rst, v) |
Definition at line 2047 of file sys_regs.c.
#define FUNCTION_INVARIANT | ( | reg | ) |
Definition at line 3569 of file sys_regs.c.
#define ID_DESC | ( | name | ) |
Definition at line 2081 of file sys_regs.c.
#define ID_HIDDEN | ( | name | ) |
Definition at line 2133 of file sys_regs.c.
#define ID_REG_LIMIT_FIELD_ENUM | ( | val, | |
reg, | |||
field, | |||
limit | |||
) |
Definition at line 1683 of file sys_regs.c.
#define ID_SANITISED | ( | name | ) |
Definition at line 2087 of file sys_regs.c.
#define ID_UNALLOCATED | ( | crm, | |
op2 | |||
) |
Definition at line 2118 of file sys_regs.c.
#define ID_WRITABLE | ( | name, | |
mask | |||
) |
Definition at line 2105 of file sys_regs.c.
#define KVM_ARM_FEATURE_ID_RANGE_INDEX | ( | r | ) |
Definition at line 3874 of file sys_regs.c.
#define MAPPED_EL2_SYSREG | ( | el2, | |
el1, | |||
fn | |||
) |
Definition at line 81 of file sys_regs.c.
#define MTE_REG | ( | name | ) |
Definition at line 1995 of file sys_regs.c.
#define PMU_PMEVCNTR | ( | n | ) |
Definition at line 2878 of file sys_regs.c.
#define PMU_PMEVCNTR_EL0 | ( | n | ) |
Definition at line 1323 of file sys_regs.c.
#define PMU_PMEVTYPER | ( | n | ) |
Definition at line 2884 of file sys_regs.c.
#define PMU_PMEVTYPER_EL0 | ( | n | ) |
Definition at line 1329 of file sys_regs.c.
#define PMU_SYS_REG | ( | name | ) |
Definition at line 1318 of file sys_regs.c.
#define PTRAUTH_KEY | ( | k | ) |
Definition at line 1364 of file sys_regs.c.
#define PURE_EL2_SYSREG | ( | el2 | ) |
Definition at line 75 of file sys_regs.c.
|
static |
Definition at line 1517 of file sys_regs.c.
|
static |
|
static |
Definition at line 403 of file sys_regs.c.
|
static |
Definition at line 1368 of file sys_regs.c.
|
static |
Definition at line 1970 of file sys_regs.c.
|
static |
|
static |
Definition at line 1958 of file sys_regs.c.
|
static |
|
static |
Definition at line 342 of file sys_regs.c.
|
static |
Definition at line 322 of file sys_regs.c.
|
static |
|
static |
Definition at line 424 of file sys_regs.c.
|
static |
|
static |
Definition at line 1626 of file sys_regs.c.
|
static |
Definition at line 980 of file sys_regs.c.
|
static |
Definition at line 1153 of file sys_regs.c.
|
static |
Definition at line 935 of file sys_regs.c.
|
static |
Definition at line 1181 of file sys_regs.c.
|
static |
|
static |
Definition at line 964 of file sys_regs.c.
|
static |
Definition at line 1227 of file sys_regs.c.
|
static |
Definition at line 1031 of file sys_regs.c.
|
static |
Definition at line 1084 of file sys_regs.c.
|
static |
|
static |
Definition at line 307 of file sys_regs.c.
|
static |
Definition at line 2141 of file sys_regs.c.
|
static |
Definition at line 2165 of file sys_regs.c.
|
static |
Definition at line 378 of file sys_regs.c.
|
static |
Definition at line 1450 of file sys_regs.c.
|
static |
Definition at line 2025 of file sys_regs.c.
|
static |
Definition at line 48 of file sys_regs.c.
|
static |
|
static |
Definition at line 904 of file sys_regs.c.
|
static |
Definition at line 3053 of file sys_regs.c.
|
static |
Definition at line 3795 of file sys_regs.c.
|
static |
Definition at line 643 of file sys_regs.c.
|
static |
Definition at line 3627 of file sys_regs.c.
|
static |
Definition at line 3652 of file sys_regs.c.
|
static |
Definition at line 2003 of file sys_regs.c.
|
static |
Definition at line 3113 of file sys_regs.c.
|
static |
emulate_sys_reg - Emulate a guest access to an AArch64 system register @vcpu: The VCPU pointer @params: Decoded system register parameters
Return: true if the system register access was successful, false otherwise.
Definition at line 3400 of file sys_regs.c.
|
static |
Definition at line 355 of file sys_regs.c.
|
static |
Definition at line 714 of file sys_regs.c.
|
static |
Definition at line 677 of file sys_regs.c.
|
static |
Definition at line 243 of file sys_regs.c.
|
static |
Definition at line 3581 of file sys_regs.c.
|
static |
|
static |
|
static |
Definition at line 3595 of file sys_regs.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1855 of file sys_regs.c.
const struct sys_reg_desc* get_reg_by_id | ( | u64 | id, |
const struct sys_reg_desc | table[], | ||
unsigned int | num | ||
) |
Definition at line 3528 of file sys_regs.c.
|
static |
Definition at line 789 of file sys_regs.c.
|
static |
Definition at line 752 of file sys_regs.c.
|
static |
Definition at line 2055 of file sys_regs.c.
|
static |
Definition at line 3542 of file sys_regs.c.
|
static |
|
static |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
|
static |
int kvm_arm_copy_sys_reg_indices | ( | struct kvm_vcpu * | vcpu, |
u64 __user * | uindices | ||
) |
Definition at line 3854 of file sys_regs.c.
unsigned long kvm_arm_num_sys_reg_descs | ( | struct kvm_vcpu * | vcpu | ) |
Definition at line 3847 of file sys_regs.c.
int kvm_arm_sys_reg_get_reg | ( | struct kvm_vcpu * | vcpu, |
const struct kvm_one_reg * | reg | ||
) |
Definition at line 3705 of file sys_regs.c.
int kvm_arm_sys_reg_set_reg | ( | struct kvm_vcpu * | vcpu, |
const struct kvm_one_reg * | reg | ||
) |
Definition at line 3749 of file sys_regs.c.
|
static |
kvm_emulate_cp15_id_reg() - Handles an MRC trap on a guest CP15 access where CRn=0, which corresponds to the AArch32 feature registers. @vcpu: the vCPU pointer @params: the system register access parameters.
Our cp15 system register tables do not enumerate the AArch32 feature registers. Conveniently, our AArch64 table does, and the AArch32 system register encoding can be trivially remapped into the AArch64 for the feature registers: Append op0=3, leaving op1, CRn, CRm, and op2 the same.
According to DDI0487G.b G7.3.1, paragraph "Behavior of VMSAv8-32 32-bit System registers with (coproc=0b1111, CRn==c0)", read accesses from this range are either UNKNOWN or RES0. Rerouting remains architectural as we treat undefined registers in this range as RAZ.
Definition at line 3299 of file sys_regs.c.
|
static |
Definition at line 3216 of file sys_regs.c.
int kvm_handle_cp10_id | ( | struct kvm_vcpu * | vcpu | ) |
kvm_handle_cp10_id() - Handles a VMRS trap on guest access to a 'Media and VFP Register' from AArch32. @vcpu: The vCPU pointer
MVFR{0-2} are architecturally mapped to the AArch64 MVFR{0-2}_EL1 registers. Work out the correct AArch64 system register encoding and reroute to the AArch64 system register emulation.
Definition at line 3264 of file sys_regs.c.
int kvm_handle_cp14_32 | ( | struct kvm_vcpu * | vcpu | ) |
Definition at line 3378 of file sys_regs.c.
int kvm_handle_cp14_64 | ( | struct kvm_vcpu * | vcpu | ) |
Definition at line 3373 of file sys_regs.c.
int kvm_handle_cp14_load_store | ( | struct kvm_vcpu * | vcpu | ) |
int kvm_handle_cp15_32 | ( | struct kvm_vcpu * | vcpu | ) |
Definition at line 3355 of file sys_regs.c.
int kvm_handle_cp15_64 | ( | struct kvm_vcpu * | vcpu | ) |
|
static |
kvm_handle_cp_32 – handles a mrc/mcr trap on a guest CP14/CP15 access @vcpu: The VCPU pointer @run: The kvm_run struct
Definition at line 3331 of file sys_regs.c.
|
static |
kvm_handle_cp_64 – handles a mrrc/mcrr trap on a guest CP14/CP15 access @vcpu: The VCPU pointer @run: The kvm_run struct
Definition at line 3164 of file sys_regs.c.
int kvm_handle_sys_reg | ( | struct kvm_vcpu * | vcpu | ) |
kvm_handle_sys_reg – handles a mrs/msr trap on a guest sys_reg access @vcpu: The VCPU pointer
Definition at line 3473 of file sys_regs.c.
|
static |
Definition at line 1560 of file sys_regs.c.
|
static |
Definition at line 3423 of file sys_regs.c.
void kvm_reset_sys_regs | ( | struct kvm_vcpu * | vcpu | ) |
kvm_reset_sys_regs - sets system registers to reset value @vcpu: The VCPU pointer
This function finds the right table above and sets the registers on the virtual CPU struct to their architecturally defined reset values.
Definition at line 3452 of file sys_regs.c.
int kvm_sys_reg_get_user | ( | struct kvm_vcpu * | vcpu, |
const struct kvm_one_reg * | reg, | ||
const struct sys_reg_desc | table[], | ||
unsigned int | num | ||
) |
Definition at line 3680 of file sys_regs.c.
int kvm_sys_reg_set_user | ( | struct kvm_vcpu * | vcpu, |
const struct kvm_one_reg * | reg, | ||
const struct sys_reg_desc | table[], | ||
unsigned int | num | ||
) |
Definition at line 3721 of file sys_regs.c.
int __init kvm_sys_reg_table_init | ( | void | ) |
Definition at line 3933 of file sys_regs.c.
int kvm_vm_ioctl_get_reg_writable_masks | ( | struct kvm * | kvm, |
struct reg_mask_range * | range | ||
) |
Definition at line 3889 of file sys_regs.c.
|
static |
Definition at line 1986 of file sys_regs.c.
|
static |
|
static |
Definition at line 3079 of file sys_regs.c.
|
static |
Definition at line 925 of file sys_regs.c.
|
static |
Definition at line 915 of file sys_regs.c.
|
static |
Definition at line 930 of file sys_regs.c.
|
static |
Definition at line 1001 of file sys_regs.c.
|
static |
Definition at line 837 of file sys_regs.c.
|
static |
Definition at line 920 of file sys_regs.c.
|
static |
|
static |
Definition at line 1348 of file sys_regs.c.
|
static |
Definition at line 1618 of file sys_regs.c.
|
static |
Definition at line 59 of file sys_regs.c.
|
static |
|
static |
Definition at line 1692 of file sys_regs.c.
|
static |
Definition at line 1648 of file sys_regs.c.
|
static |
|
static |
Definition at line 626 of file sys_regs.c.
|
static |
|
static |
|
static |
Definition at line 721 of file sys_regs.c.
|
static |
Definition at line 684 of file sys_regs.c.
|
static |
Definition at line 1892 of file sys_regs.c.
|
static |
|
static |
Definition at line 888 of file sys_regs.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 796 of file sys_regs.c.
|
static |
Definition at line 759 of file sys_regs.c.
|
static |
Definition at line 707 of file sys_regs.c.
|
static |
Definition at line 670 of file sys_regs.c.
|
static |
Definition at line 278 of file sys_regs.c.
|
static |
Definition at line 1944 of file sys_regs.c.
|
static |
|
static |
|
static |
Definition at line 1815 of file sys_regs.c.
|
static |
Definition at line 3607 of file sys_regs.c.
|
static |
Definition at line 551 of file sys_regs.c.
|
static |
Definition at line 1269 of file sys_regs.c.
|
static |
|
static |
Definition at line 782 of file sys_regs.c.
|
static |
Definition at line 1862 of file sys_regs.c.
|
static |
Definition at line 745 of file sys_regs.c.
|
static |
Definition at line 1639 of file sys_regs.c.
|
static |
|
static |
Definition at line 691 of file sys_regs.c.
|
static |
|
static |
|
static |
Definition at line 2732 of file sys_regs.c.
|
static |
Definition at line 604 of file sys_regs.c.
|
static |
Definition at line 504 of file sys_regs.c.
|
static |
|
static |
|
static |
Definition at line 480 of file sys_regs.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 3134 of file sys_regs.c.
u64 vcpu_read_sys_reg | ( | const struct kvm_vcpu * | vcpu, |
int | reg | ||
) |
Definition at line 128 of file sys_regs.c.
void vcpu_write_sys_reg | ( | struct kvm_vcpu * | vcpu, |
u64 | val, | ||
int | reg | ||
) |
Definition at line 172 of file sys_regs.c.
|
static |
Definition at line 3807 of file sys_regs.c.
|
static |
Definition at line 3830 of file sys_regs.c.
|
static |
|
static |
Definition at line 67 of file sys_regs.c.
|
static |
Definition at line 3588 of file sys_regs.c.
|
static |
Definition at line 2732 of file sys_regs.c.
|
static |
Definition at line 2732 of file sys_regs.c.
|
static |
Definition at line 2732 of file sys_regs.c.
|
static |
Definition at line 2732 of file sys_regs.c.
|
static |
Definition at line 2730 of file sys_regs.c.
|
static |
Definition at line 2165 of file sys_regs.c.