@@ -171,23 +171,14 @@ static void *sve_pffr(struct task_struct *task)
sve_ffr_offset(task->thread.sve_vl);
}
-static void change_cpacr(u64 val, u64 mask)
-{
- u64 cpacr = read_sysreg(CPACR_EL1);
- u64 new = (cpacr & ~mask) | val;
-
- if (new != cpacr)
- write_sysreg(new, CPACR_EL1);
-}
-
static void sve_user_disable(void)
{
- change_cpacr(0, CPACR_EL1_ZEN_EL0EN);
+ sysreg_clear_set(cpacr_el1, CPACR_EL1_ZEN_EL0EN, 0);
}
static void sve_user_enable(void)
{
- change_cpacr(CPACR_EL1_ZEN_EL0EN, CPACR_EL1_ZEN_EL0EN);
+ sysreg_clear_set(cpacr_el1, 0, CPACR_EL1_ZEN_EL0EN);
}
/*