Commit 8af19898 authored by Marc Zyngier's avatar Marc Zyngier
Browse files

KVM: arm64: Move CNT*_CVAL_EL0 userspace accessors to generic infrastructure



As for the control registers, move the comparator registers to
the common infrastructure.

Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 09424d5d
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -593,9 +593,7 @@ static unsigned long num_core_regs(const struct kvm_vcpu *vcpu)

static const u64 timer_reg_list[] = {
	KVM_REG_ARM_TIMER_CNT,
	KVM_REG_ARM_TIMER_CVAL,
	KVM_REG_ARM_PTIMER_CNT,
	KVM_REG_ARM_PTIMER_CVAL,
};

#define NUM_TIMER_REGS ARRAY_SIZE(timer_reg_list)
@@ -604,9 +602,7 @@ static bool is_timer_reg(u64 index)
{
	switch (index) {
	case KVM_REG_ARM_TIMER_CNT:
	case KVM_REG_ARM_TIMER_CVAL:
	case KVM_REG_ARM_PTIMER_CNT:
	case KVM_REG_ARM_PTIMER_CVAL:
		return true;
	}
	return false;
+4 −4
Original line number Diff line number Diff line
@@ -3512,11 +3512,11 @@ static const struct sys_reg_desc sys_reg_descs[] = {
	{ SYS_DESC(SYS_CNTVCTSS_EL0), access_arch_timer },
	{ SYS_DESC(SYS_CNTP_TVAL_EL0), access_arch_timer },
	TIMER_REG(CNTP_CTL_EL0, NULL),
	{ SYS_DESC(SYS_CNTP_CVAL_EL0), access_arch_timer },
	TIMER_REG(CNTP_CVAL_EL0, NULL),

	{ SYS_DESC(SYS_CNTV_TVAL_EL0), access_arch_timer },
	TIMER_REG(CNTV_CTL_EL0, NULL),
	{ SYS_DESC(SYS_CNTV_CVAL_EL0), access_arch_timer },
	TIMER_REG(CNTV_CVAL_EL0, NULL),

	/* PMEVCNTRn_EL0 */
	PMU_PMEVCNTR_EL0(0),
@@ -3715,11 +3715,11 @@ static const struct sys_reg_desc sys_reg_descs[] = {
	EL2_REG(CNTHCTL_EL2, access_rw, reset_val, 0),
	{ SYS_DESC(SYS_CNTHP_TVAL_EL2), access_arch_timer },
	TIMER_REG(CNTHP_CTL_EL2, el2_visibility),
	EL2_REG(CNTHP_CVAL_EL2, access_arch_timer, reset_val, 0),
	TIMER_REG(CNTHP_CVAL_EL2, el2_visibility),

	{ SYS_DESC(SYS_CNTHV_TVAL_EL2), access_arch_timer, .visibility = cnthv_visibility },
	TIMER_REG(CNTHV_CTL_EL2, cnthv_visibility),
	EL2_REG_FILTERED(CNTHV_CVAL_EL2, access_arch_timer, reset_val, 0, cnthv_visibility),
	TIMER_REG(CNTHV_CVAL_EL2, cnthv_visibility),

	{ SYS_DESC(SYS_CNTKCTL_EL12), access_cntkctl_el12 },