/* Masks for extracting the FPSR and FPCR from the FPSCR */ #define VFP_FPSCR_STAT_MASK 0xf800009f #define VFP_FPSCR_CTRL_MASK 0x07f79f00 /* * The VFP state has 32x64-bit registers and a single 32-bit * control/status register.
*/ #define VFP_STATE_SIZE ((32 * 8) + 4)
staticinlineunsignedlong cpacr_save_enable_kernel_sve(void)
{ unsignedlong old = read_sysreg(cpacr_el1); unsignedlong set = CPACR_EL1_FPEN_EL1EN | CPACR_EL1_ZEN_EL1EN;
/* * When we defined the maximum SVE vector length we defined the ABI so * that the maximum vector length included all the reserved for future * expansion bits in ZCR rather than those just currently defined by * the architecture. Using this length to allocate worst size buffers * results in excessively large allocations, and this effect is even * more pronounced for SME due to ZA. Define more suitable VLs for * these situations.
*/ #define ARCH_SVE_VQ_MAX ((ZCR_ELx_LEN_MASK >> ZCR_ELx_LEN_SHIFT) + 1) #define SME_VQ_MAX ((SMCR_ELx_LEN_MASK >> SMCR_ELx_LEN_SHIFT) + 1)
/* Maximum VL that SVE/SME VL-agnostic software can transparently support */ #define VL_ARCH_MAX 0x100
/* Offset of FFR in the SVE register dump */ staticinline size_t sve_ffr_offset(int vl)
{ return SVE_SIG_FFR_OFFSET(sve_vq_from_vl(vl)) - SVE_SIG_REGS_OFFSET;
}
staticinlinevoid *thread_zt_state(struct thread_struct *thread)
{ /* The ZT register state is stored immediately after the ZA state */ unsignedint sme_vq = sve_vq_from_vl(thread_get_sme_vl(thread)); return thread->sme_state + ZA_SIG_REGS_SIZE(sme_vq);
}
externvoid sve_save_state(void *state, u32 *pfpsr, int save_ffr); externvoid sve_load_state(voidconst *state, u32 const *pfpsr, int restore_ffr); externvoid sve_flush_live(bool flush_ffr, unsignedlong vq_minus_1); externunsignedint sve_get_vl(void); externvoid sve_set_vq(unsignedlong vq_minus_1); externvoid sme_set_vq(unsignedlong vq_minus_1); externvoid sme_save_state(void *state, int zt); externvoid sme_load_state(voidconst *state, int zt);
/* * Helpers to translate bit indices in sve_vq_map to VQ values (and * vice versa). This allows find_next_bit() to be used to find the * _maximum_ VQ not exceeding a certain value.
*/ staticinlineunsignedint __vq_to_bit(unsignedint vq)
{ return SVE_VQ_MAX - vq;
}
/* * Return how many bytes of memory are required to store the full SVE * state for task, given task's currently configured vector length.
*/ staticinline size_t sve_state_size(struct task_struct const *task)
{ unsignedint sve_vl = task_get_sve_vl(task); unsignedint sme_vl = task_get_sme_vl(task); return __sve_state_size(sve_vl, sme_vl);
}
if (system_supports_sme2())
size += ZT_SIG_REG_SIZE;
return size;
}
/* * Return how many bytes of memory are required to store the full SME * specific state for task, given task's currently configured vector * length.
*/ staticinline size_t sme_state_size(struct task_struct const *task)
{ return __sme_state_size(task_get_sme_vl(task));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.