cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

spr_tcg.h (7284B)


      1/*
      2 *  PowerPC emulation for qemu: read/write callbacks for SPRs
      3 *
      4 *  Copyright (C) 2021 Instituto de Pesquisas Eldorado
      5 *
      6 * This library is free software; you can redistribute it and/or
      7 * modify it under the terms of the GNU Lesser General Public
      8 * License as published by the Free Software Foundation; either
      9 * version 2.1 of the License, or (at your option) any later version.
     10 *
     11 * This library is distributed in the hope that it will be useful,
     12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     14 * Lesser General Public License for more details.
     15 *
     16 * You should have received a copy of the GNU Lesser General Public
     17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
     18 */
     19#ifndef SPR_TCG_H
     20#define SPR_TCG_H
     21
     22#define SPR_NOACCESS (&spr_noaccess)
     23
     24/* prototypes for readers and writers for SPRs */
     25void spr_noaccess(DisasContext *ctx, int gprn, int sprn);
     26void spr_read_generic(DisasContext *ctx, int gprn, int sprn);
     27void spr_write_generic(DisasContext *ctx, int sprn, int gprn);
     28void spr_read_xer(DisasContext *ctx, int gprn, int sprn);
     29void spr_write_xer(DisasContext *ctx, int sprn, int gprn);
     30void spr_read_lr(DisasContext *ctx, int gprn, int sprn);
     31void spr_write_lr(DisasContext *ctx, int sprn, int gprn);
     32void spr_read_ctr(DisasContext *ctx, int gprn, int sprn);
     33void spr_write_ctr(DisasContext *ctx, int sprn, int gprn);
     34void spr_read_ureg(DisasContext *ctx, int gprn, int sprn);
     35void spr_read_tbl(DisasContext *ctx, int gprn, int sprn);
     36void spr_read_tbu(DisasContext *ctx, int gprn, int sprn);
     37void spr_read_atbl(DisasContext *ctx, int gprn, int sprn);
     38void spr_read_atbu(DisasContext *ctx, int gprn, int sprn);
     39void spr_read_601_rtcl(DisasContext *ctx, int gprn, int sprn);
     40void spr_read_601_rtcu(DisasContext *ctx, int gprn, int sprn);
     41void spr_read_spefscr(DisasContext *ctx, int gprn, int sprn);
     42void spr_write_spefscr(DisasContext *ctx, int sprn, int gprn);
     43
     44#ifndef CONFIG_USER_ONLY
     45void spr_write_generic32(DisasContext *ctx, int sprn, int gprn);
     46void spr_write_clear(DisasContext *ctx, int sprn, int gprn);
     47void spr_access_nop(DisasContext *ctx, int sprn, int gprn);
     48void spr_read_decr(DisasContext *ctx, int gprn, int sprn);
     49void spr_write_decr(DisasContext *ctx, int sprn, int gprn);
     50void spr_write_tbl(DisasContext *ctx, int sprn, int gprn);
     51void spr_write_tbu(DisasContext *ctx, int sprn, int gprn);
     52void spr_write_atbl(DisasContext *ctx, int sprn, int gprn);
     53void spr_write_atbu(DisasContext *ctx, int sprn, int gprn);
     54void spr_read_ibat(DisasContext *ctx, int gprn, int sprn);
     55void spr_read_ibat_h(DisasContext *ctx, int gprn, int sprn);
     56void spr_write_ibatu(DisasContext *ctx, int sprn, int gprn);
     57void spr_write_ibatu_h(DisasContext *ctx, int sprn, int gprn);
     58void spr_write_ibatl(DisasContext *ctx, int sprn, int gprn);
     59void spr_write_ibatl_h(DisasContext *ctx, int sprn, int gprn);
     60void spr_read_dbat(DisasContext *ctx, int gprn, int sprn);
     61void spr_read_dbat_h(DisasContext *ctx, int gprn, int sprn);
     62void spr_write_dbatu(DisasContext *ctx, int sprn, int gprn);
     63void spr_write_dbatu_h(DisasContext *ctx, int sprn, int gprn);
     64void spr_write_dbatl(DisasContext *ctx, int sprn, int gprn);
     65void spr_write_dbatl_h(DisasContext *ctx, int sprn, int gprn);
     66void spr_write_sdr1(DisasContext *ctx, int sprn, int gprn);
     67void spr_write_601_rtcu(DisasContext *ctx, int sprn, int gprn);
     68void spr_write_601_rtcl(DisasContext *ctx, int sprn, int gprn);
     69void spr_write_hid0_601(DisasContext *ctx, int sprn, int gprn);
     70void spr_read_601_ubat(DisasContext *ctx, int gprn, int sprn);
     71void spr_write_601_ubatu(DisasContext *ctx, int sprn, int gprn);
     72void spr_write_601_ubatl(DisasContext *ctx, int sprn, int gprn);
     73void spr_read_40x_pit(DisasContext *ctx, int gprn, int sprn);
     74void spr_write_40x_pit(DisasContext *ctx, int sprn, int gprn);
     75void spr_write_40x_dbcr0(DisasContext *ctx, int sprn, int gprn);
     76void spr_write_40x_sler(DisasContext *ctx, int sprn, int gprn);
     77void spr_write_booke_tcr(DisasContext *ctx, int sprn, int gprn);
     78void spr_write_booke_tsr(DisasContext *ctx, int sprn, int gprn);
     79void spr_read_403_pbr(DisasContext *ctx, int gprn, int sprn);
     80void spr_write_403_pbr(DisasContext *ctx, int sprn, int gprn);
     81void spr_write_pir(DisasContext *ctx, int sprn, int gprn);
     82void spr_write_excp_prefix(DisasContext *ctx, int sprn, int gprn);
     83void spr_write_excp_vector(DisasContext *ctx, int sprn, int gprn);
     84void spr_read_thrm(DisasContext *ctx, int gprn, int sprn);
     85void spr_write_e500_l1csr0(DisasContext *ctx, int sprn, int gprn);
     86void spr_write_e500_l1csr1(DisasContext *ctx, int sprn, int gprn);
     87void spr_write_e500_l2csr0(DisasContext *ctx, int sprn, int gprn);
     88void spr_write_booke206_mmucsr0(DisasContext *ctx, int sprn, int gprn);
     89void spr_write_booke_pid(DisasContext *ctx, int sprn, int gprn);
     90void spr_write_eplc(DisasContext *ctx, int sprn, int gprn);
     91void spr_write_epsc(DisasContext *ctx, int sprn, int gprn);
     92void spr_write_mas73(DisasContext *ctx, int sprn, int gprn);
     93void spr_read_mas73(DisasContext *ctx, int gprn, int sprn);
     94#ifdef TARGET_PPC64
     95void spr_read_cfar(DisasContext *ctx, int gprn, int sprn);
     96void spr_write_cfar(DisasContext *ctx, int sprn, int gprn);
     97void spr_write_ureg(DisasContext *ctx, int sprn, int gprn);
     98void spr_read_purr(DisasContext *ctx, int gprn, int sprn);
     99void spr_write_purr(DisasContext *ctx, int sprn, int gprn);
    100void spr_read_hdecr(DisasContext *ctx, int gprn, int sprn);
    101void spr_write_hdecr(DisasContext *ctx, int sprn, int gprn);
    102void spr_read_vtb(DisasContext *ctx, int gprn, int sprn);
    103void spr_write_vtb(DisasContext *ctx, int sprn, int gprn);
    104void spr_write_tbu40(DisasContext *ctx, int sprn, int gprn);
    105void spr_write_pidr(DisasContext *ctx, int sprn, int gprn);
    106void spr_write_lpidr(DisasContext *ctx, int sprn, int gprn);
    107void spr_read_hior(DisasContext *ctx, int gprn, int sprn);
    108void spr_write_hior(DisasContext *ctx, int sprn, int gprn);
    109void spr_write_ptcr(DisasContext *ctx, int sprn, int gprn);
    110void spr_write_pcr(DisasContext *ctx, int sprn, int gprn);
    111void spr_read_dpdes(DisasContext *ctx, int gprn, int sprn);
    112void spr_write_dpdes(DisasContext *ctx, int sprn, int gprn);
    113void spr_write_amr(DisasContext *ctx, int sprn, int gprn);
    114void spr_write_uamor(DisasContext *ctx, int sprn, int gprn);
    115void spr_write_iamr(DisasContext *ctx, int sprn, int gprn);
    116#endif
    117#endif
    118
    119#ifdef TARGET_PPC64
    120void spr_read_prev_upper32(DisasContext *ctx, int gprn, int sprn);
    121void spr_write_prev_upper32(DisasContext *ctx, int sprn, int gprn);
    122void spr_read_tar(DisasContext *ctx, int gprn, int sprn);
    123void spr_write_tar(DisasContext *ctx, int sprn, int gprn);
    124void spr_read_tm(DisasContext *ctx, int gprn, int sprn);
    125void spr_write_tm(DisasContext *ctx, int sprn, int gprn);
    126void spr_read_tm_upper32(DisasContext *ctx, int gprn, int sprn);
    127void spr_write_tm_upper32(DisasContext *ctx, int sprn, int gprn);
    128void spr_read_ebb(DisasContext *ctx, int gprn, int sprn);
    129void spr_write_ebb(DisasContext *ctx, int sprn, int gprn);
    130void spr_read_ebb_upper32(DisasContext *ctx, int gprn, int sprn);
    131void spr_write_ebb_upper32(DisasContext *ctx, int sprn, int gprn);
    132void spr_write_hmer(DisasContext *ctx, int sprn, int gprn);
    133void spr_write_lpcr(DisasContext *ctx, int sprn, int gprn);
    134#endif
    135
    136#endif