cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

ptrace-decl.h (6479B)


      1/* SPDX-License-Identifier: GPL-2.0-or-later */
      2
      3/*
      4 * Set of msr bits that gdb can change on behalf of a process.
      5 */
      6#ifdef CONFIG_PPC_ADV_DEBUG_REGS
      7#define MSR_DEBUGCHANGE	0
      8#else
      9#define MSR_DEBUGCHANGE	(MSR_SE | MSR_BE)
     10#endif
     11
     12/*
     13 * Max register writeable via put_reg
     14 */
     15#ifdef CONFIG_PPC32
     16#define PT_MAX_PUT_REG	PT_MQ
     17#else
     18#define PT_MAX_PUT_REG	PT_CCR
     19#endif
     20
     21#define TVSO(f)	(offsetof(struct thread_vr_state, f))
     22#define TFSO(f)	(offsetof(struct thread_fp_state, f))
     23#define TSO(f)	(offsetof(struct thread_struct, f))
     24
     25/*
     26 * These are our native regset flavors.
     27 */
     28enum powerpc_regset {
     29	REGSET_GPR,
     30	REGSET_FPR,
     31#ifdef CONFIG_ALTIVEC
     32	REGSET_VMX,
     33#endif
     34#ifdef CONFIG_VSX
     35	REGSET_VSX,
     36#endif
     37#ifdef CONFIG_SPE
     38	REGSET_SPE,
     39#endif
     40#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
     41	REGSET_TM_CGPR,		/* TM checkpointed GPR registers */
     42	REGSET_TM_CFPR,		/* TM checkpointed FPR registers */
     43	REGSET_TM_CVMX,		/* TM checkpointed VMX registers */
     44	REGSET_TM_CVSX,		/* TM checkpointed VSX registers */
     45	REGSET_TM_SPR,		/* TM specific SPR registers */
     46	REGSET_TM_CTAR,		/* TM checkpointed TAR register */
     47	REGSET_TM_CPPR,		/* TM checkpointed PPR register */
     48	REGSET_TM_CDSCR,	/* TM checkpointed DSCR register */
     49#endif
     50#ifdef CONFIG_PPC64
     51	REGSET_PPR,		/* PPR register */
     52	REGSET_DSCR,		/* DSCR register */
     53#endif
     54#ifdef CONFIG_PPC_BOOK3S_64
     55	REGSET_TAR,		/* TAR register */
     56	REGSET_EBB,		/* EBB registers */
     57	REGSET_PMR,		/* Performance Monitor Registers */
     58#endif
     59#ifdef CONFIG_PPC_MEM_KEYS
     60	REGSET_PKEY,		/* AMR register */
     61#endif
     62};
     63
     64/* ptrace-(no)vsx */
     65
     66user_regset_get2_fn fpr_get;
     67int fpr_set(struct task_struct *target, const struct user_regset *regset,
     68	    unsigned int pos, unsigned int count,
     69	    const void *kbuf, const void __user *ubuf);
     70
     71/* ptrace-vsx */
     72
     73int vsr_active(struct task_struct *target, const struct user_regset *regset);
     74user_regset_get2_fn vsr_get;
     75int vsr_set(struct task_struct *target, const struct user_regset *regset,
     76	    unsigned int pos, unsigned int count,
     77	    const void *kbuf, const void __user *ubuf);
     78
     79/* ptrace-altivec */
     80
     81int vr_active(struct task_struct *target, const struct user_regset *regset);
     82user_regset_get2_fn vr_get;
     83int vr_set(struct task_struct *target, const struct user_regset *regset,
     84	   unsigned int pos, unsigned int count,
     85	   const void *kbuf, const void __user *ubuf);
     86
     87/* ptrace-spe */
     88
     89int evr_active(struct task_struct *target, const struct user_regset *regset);
     90user_regset_get2_fn evr_get;
     91int evr_set(struct task_struct *target, const struct user_regset *regset,
     92	    unsigned int pos, unsigned int count,
     93	    const void *kbuf, const void __user *ubuf);
     94
     95/* ptrace */
     96
     97int gpr32_get_common(struct task_struct *target,
     98		     const struct user_regset *regset,
     99		     struct membuf to,
    100		     unsigned long *regs);
    101int gpr32_set_common(struct task_struct *target,
    102		     const struct user_regset *regset,
    103		     unsigned int pos, unsigned int count,
    104		     const void *kbuf, const void __user *ubuf,
    105		     unsigned long *regs);
    106
    107/* ptrace-tm */
    108
    109#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
    110void flush_tmregs_to_thread(struct task_struct *tsk);
    111#else
    112static inline void flush_tmregs_to_thread(struct task_struct *tsk) { }
    113#endif
    114
    115int tm_cgpr_active(struct task_struct *target, const struct user_regset *regset);
    116user_regset_get2_fn tm_cgpr_get;
    117int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
    118		unsigned int pos, unsigned int count,
    119		const void *kbuf, const void __user *ubuf);
    120int tm_cfpr_active(struct task_struct *target, const struct user_regset *regset);
    121user_regset_get2_fn tm_cfpr_get;
    122int tm_cfpr_set(struct task_struct *target, const struct user_regset *regset,
    123		unsigned int pos, unsigned int count,
    124		const void *kbuf, const void __user *ubuf);
    125int tm_cvmx_active(struct task_struct *target, const struct user_regset *regset);
    126user_regset_get2_fn tm_cvmx_get;
    127int tm_cvmx_set(struct task_struct *target, const struct user_regset *regset,
    128		unsigned int pos, unsigned int count,
    129		const void *kbuf, const void __user *ubuf);
    130int tm_cvsx_active(struct task_struct *target, const struct user_regset *regset);
    131user_regset_get2_fn tm_cvsx_get;
    132int tm_cvsx_set(struct task_struct *target, const struct user_regset *regset,
    133		unsigned int pos, unsigned int count,
    134		const void *kbuf, const void __user *ubuf);
    135int tm_spr_active(struct task_struct *target, const struct user_regset *regset);
    136user_regset_get2_fn tm_spr_get;
    137int tm_spr_set(struct task_struct *target, const struct user_regset *regset,
    138	       unsigned int pos, unsigned int count,
    139	       const void *kbuf, const void __user *ubuf);
    140int tm_tar_active(struct task_struct *target, const struct user_regset *regset);
    141user_regset_get2_fn tm_tar_get;
    142int tm_tar_set(struct task_struct *target, const struct user_regset *regset,
    143	       unsigned int pos, unsigned int count,
    144	       const void *kbuf, const void __user *ubuf);
    145int tm_ppr_active(struct task_struct *target, const struct user_regset *regset);
    146user_regset_get2_fn tm_ppr_get;
    147int tm_ppr_set(struct task_struct *target, const struct user_regset *regset,
    148	       unsigned int pos, unsigned int count,
    149	       const void *kbuf, const void __user *ubuf);
    150int tm_dscr_active(struct task_struct *target, const struct user_regset *regset);
    151user_regset_get2_fn tm_dscr_get;
    152int tm_dscr_set(struct task_struct *target, const struct user_regset *regset,
    153		unsigned int pos, unsigned int count,
    154		const void *kbuf, const void __user *ubuf);
    155user_regset_get2_fn tm_cgpr32_get;
    156int tm_cgpr32_set(struct task_struct *target, const struct user_regset *regset,
    157		  unsigned int pos, unsigned int count,
    158		  const void *kbuf, const void __user *ubuf);
    159
    160/* ptrace-view */
    161
    162int ptrace_get_reg(struct task_struct *task, int regno, unsigned long *data);
    163int ptrace_put_reg(struct task_struct *task, int regno, unsigned long data);
    164
    165extern const struct user_regset_view user_ppc_native_view;
    166
    167/* ptrace-fpu */
    168int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data);
    169int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data);
    170
    171/* ptrace-(no)adv */
    172void ppc_gethwdinfo(struct ppc_debug_info *dbginfo);
    173int ptrace_get_debugreg(struct task_struct *child, unsigned long addr,
    174			unsigned long __user *datalp);
    175int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, unsigned long data);
    176long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_info);
    177long ppc_del_hwdebug(struct task_struct *child, long data);