2018-03-03 01:31:10 +13:00
|
|
|
/*
|
|
|
|
* RISC-V Emulation Helpers for QEMU.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016-2017 Sagar Karandikar, sagark@eecs.berkeley.edu
|
|
|
|
* Copyright (c) 2017-2018 SiFive, Inc.
|
2023-02-24 10:25:34 -03:00
|
|
|
* Copyright (c) 2022 VRULL GmbH
|
2018-03-03 01:31:10 +13:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2 or later, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "qemu/main-loop.h"
|
|
|
|
#include "exec/exec-all.h"
|
|
|
|
#include "exec/helper-proto.h"
|
|
|
|
|
|
|
|
/* Exceptions processing helpers */
|
2022-04-20 17:26:02 +04:00
|
|
|
G_NORETURN void riscv_raise_exception(CPURISCVState *env,
|
|
|
|
uint32_t exception, uintptr_t pc)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
2019-03-22 19:11:37 -07:00
|
|
|
CPUState *cs = env_cpu(env);
|
2018-03-03 01:31:10 +13:00
|
|
|
cs->exception_index = exception;
|
|
|
|
cpu_loop_exit_restore(cs, pc);
|
|
|
|
}
|
|
|
|
|
|
|
|
void helper_raise_exception(CPURISCVState *env, uint32_t exception)
|
|
|
|
{
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, exception, 0);
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2021-08-23 12:55:23 -07:00
|
|
|
target_ulong helper_csrr(CPURISCVState *env, int csr)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
2022-04-23 10:35:08 +08:00
|
|
|
/*
|
|
|
|
* The seed CSR must be accessed with a read-write instruction. A
|
|
|
|
* read-only instruction such as CSRRS/CSRRC with rs1=x0 or CSRRSI/
|
|
|
|
* CSRRCI with uimm=0 will raise an illegal instruction exception.
|
|
|
|
*/
|
|
|
|
if (csr == CSR_SEED) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
|
|
|
}
|
|
|
|
|
2019-01-04 23:23:55 +00:00
|
|
|
target_ulong val = 0;
|
2021-08-23 12:55:23 -07:00
|
|
|
RISCVException ret = riscv_csrrw(env, csr, &val, 0, 0);
|
2020-08-12 12:13:46 -07:00
|
|
|
|
2021-04-01 11:18:07 -04:00
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
2019-01-04 23:23:55 +00:00
|
|
|
}
|
|
|
|
return val;
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2021-08-23 12:55:23 -07:00
|
|
|
void helper_csrw(CPURISCVState *env, int csr, target_ulong src)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
2022-01-20 20:20:37 +08:00
|
|
|
target_ulong mask = env->xl == MXL_RV32 ? UINT32_MAX : (target_ulong)-1;
|
|
|
|
RISCVException ret = riscv_csrrw(env, csr, NULL, src, mask);
|
2020-08-12 12:13:46 -07:00
|
|
|
|
2021-04-01 11:18:07 -04:00
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-23 12:55:23 -07:00
|
|
|
target_ulong helper_csrrw(CPURISCVState *env, int csr,
|
|
|
|
target_ulong src, target_ulong write_mask)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
2019-01-04 23:23:55 +00:00
|
|
|
target_ulong val = 0;
|
2021-08-23 12:55:23 -07:00
|
|
|
RISCVException ret = riscv_csrrw(env, csr, &val, src, write_mask);
|
2020-08-12 12:13:46 -07:00
|
|
|
|
2021-04-01 11:18:07 -04:00
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
2019-01-04 23:23:55 +00:00
|
|
|
return val;
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2022-01-06 22:01:06 +01:00
|
|
|
target_ulong helper_csrr_i128(CPURISCVState *env, int csr)
|
|
|
|
{
|
|
|
|
Int128 rv = int128_zero();
|
|
|
|
RISCVException ret = riscv_csrrw_i128(env, csr, &rv,
|
|
|
|
int128_zero(),
|
|
|
|
int128_zero());
|
|
|
|
|
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
|
|
|
}
|
|
|
|
|
|
|
|
env->retxh = int128_gethi(rv);
|
|
|
|
return int128_getlo(rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
void helper_csrw_i128(CPURISCVState *env, int csr,
|
|
|
|
target_ulong srcl, target_ulong srch)
|
|
|
|
{
|
|
|
|
RISCVException ret = riscv_csrrw_i128(env, csr, NULL,
|
|
|
|
int128_make128(srcl, srch),
|
|
|
|
UINT128_MAX);
|
|
|
|
|
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
target_ulong helper_csrrw_i128(CPURISCVState *env, int csr,
|
|
|
|
target_ulong srcl, target_ulong srch,
|
|
|
|
target_ulong maskl, target_ulong maskh)
|
|
|
|
{
|
|
|
|
Int128 rv = int128_zero();
|
|
|
|
RISCVException ret = riscv_csrrw_i128(env, csr, &rv,
|
|
|
|
int128_make128(srcl, srch),
|
|
|
|
int128_make128(maskl, maskh));
|
|
|
|
|
|
|
|
if (ret != RISCV_EXCP_NONE) {
|
|
|
|
riscv_raise_exception(env, ret, GETPC());
|
|
|
|
}
|
|
|
|
|
|
|
|
env->retxh = int128_gethi(rv);
|
|
|
|
return int128_getlo(rv);
|
|
|
|
}
|
|
|
|
|
2023-02-24 10:25:34 -03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* check_zicbo_envcfg
|
|
|
|
*
|
|
|
|
* Raise virtual exceptions and illegal instruction exceptions for
|
|
|
|
* Zicbo[mz] instructions based on the settings of [mhs]envcfg as
|
|
|
|
* specified in section 2.5.1 of the CMO specification.
|
|
|
|
*/
|
|
|
|
static void check_zicbo_envcfg(CPURISCVState *env, target_ulong envbits,
|
|
|
|
uintptr_t ra)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
if ((env->priv < PRV_M) && !get_field(env->menvcfg, envbits)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, ra);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (riscv_cpu_virt_enabled(env) &&
|
|
|
|
(((env->priv < PRV_H) && !get_field(env->henvcfg, envbits)) ||
|
|
|
|
((env->priv < PRV_S) && !get_field(env->senvcfg, envbits)))) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, ra);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((env->priv < PRV_S) && !get_field(env->senvcfg, envbits)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, ra);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void helper_cbo_zero(CPURISCVState *env, target_ulong address)
|
|
|
|
{
|
|
|
|
RISCVCPU *cpu = env_archcpu(env);
|
|
|
|
uint16_t cbozlen = cpu->cfg.cboz_blocksize;
|
|
|
|
int mmu_idx = cpu_mmu_index(env, false);
|
|
|
|
uintptr_t ra = GETPC();
|
|
|
|
void *mem;
|
|
|
|
|
|
|
|
check_zicbo_envcfg(env, MENVCFG_CBZE, ra);
|
|
|
|
|
|
|
|
/* Mask off low-bits to align-down to the cache-block. */
|
|
|
|
address &= ~(cbozlen - 1);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* cbo.zero requires MMU_DATA_STORE access. Do a probe_write()
|
|
|
|
* to raise any exceptions, including PMP.
|
|
|
|
*/
|
|
|
|
mem = probe_write(env, address, cbozlen, mmu_idx, ra);
|
|
|
|
|
|
|
|
if (likely(mem)) {
|
|
|
|
memset(mem, 0, cbozlen);
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
* This means that we're dealing with an I/O page. Section 4.2
|
|
|
|
* of cmobase v1.0.1 says:
|
|
|
|
*
|
|
|
|
* "Cache-block zero instructions store zeros independently
|
|
|
|
* of whether data from the underlying memory locations are
|
|
|
|
* cacheable."
|
|
|
|
*
|
|
|
|
* Write zeros in address + cbozlen regardless of not being
|
|
|
|
* a RAM page.
|
|
|
|
*/
|
|
|
|
for (int i = 0; i < cbozlen; i++) {
|
|
|
|
cpu_stb_mmuidx_ra(env, address + i, 0, mmu_idx, ra);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-03 01:31:10 +13:00
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
|
2022-01-20 20:20:29 +08:00
|
|
|
target_ulong helper_sret(CPURISCVState *env)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
2020-10-26 19:55:25 +08:00
|
|
|
uint64_t mstatus;
|
|
|
|
target_ulong prev_priv, prev_virt;
|
2020-01-31 17:02:33 -08:00
|
|
|
|
2018-03-03 01:31:10 +13:00
|
|
|
if (!(env->priv >= PRV_S)) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
target_ulong retpc = env->sepc;
|
|
|
|
if (!riscv_has_ext(env, RVC) && (retpc & 0x3)) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_INST_ADDR_MIS, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2020-05-05 13:04:50 -07:00
|
|
|
if (get_field(env->mstatus, MSTATUS_TSR) && !(env->priv >= PRV_M)) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
2019-01-14 23:58:08 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 12:13:49 -07:00
|
|
|
if (riscv_has_ext(env, RVH) && riscv_cpu_virt_enabled(env) &&
|
|
|
|
get_field(env->hstatus, HSTATUS_VTSR)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, GETPC());
|
|
|
|
}
|
|
|
|
|
2020-01-31 17:02:33 -08:00
|
|
|
mstatus = env->mstatus;
|
2022-12-07 17:00:36 +08:00
|
|
|
prev_priv = get_field(mstatus, MSTATUS_SPP);
|
|
|
|
mstatus = set_field(mstatus, MSTATUS_SIE,
|
|
|
|
get_field(mstatus, MSTATUS_SPIE));
|
|
|
|
mstatus = set_field(mstatus, MSTATUS_SPIE, 1);
|
|
|
|
mstatus = set_field(mstatus, MSTATUS_SPP, PRV_U);
|
2022-12-07 17:00:37 +08:00
|
|
|
if (env->priv_ver >= PRIV_VERSION_1_12_0) {
|
|
|
|
mstatus = set_field(mstatus, MSTATUS_MPRV, 0);
|
|
|
|
}
|
2022-12-07 17:00:36 +08:00
|
|
|
env->mstatus = mstatus;
|
2020-01-31 17:02:33 -08:00
|
|
|
|
|
|
|
if (riscv_has_ext(env, RVH) && !riscv_cpu_virt_enabled(env)) {
|
|
|
|
/* We support Hypervisor extensions and virtulisation is disabled */
|
|
|
|
target_ulong hstatus = env->hstatus;
|
|
|
|
|
|
|
|
prev_virt = get_field(hstatus, HSTATUS_SPV);
|
|
|
|
|
2020-08-12 12:13:33 -07:00
|
|
|
hstatus = set_field(hstatus, HSTATUS_SPV, 0);
|
2020-01-31 17:02:33 -08:00
|
|
|
|
|
|
|
env->hstatus = hstatus;
|
|
|
|
|
|
|
|
if (prev_virt) {
|
|
|
|
riscv_cpu_swap_hypervisor_regs(env);
|
|
|
|
}
|
|
|
|
|
|
|
|
riscv_cpu_set_virt_enabled(env, prev_virt);
|
|
|
|
}
|
|
|
|
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_cpu_set_mode(env, prev_priv);
|
2018-03-03 01:31:10 +13:00
|
|
|
|
|
|
|
return retpc;
|
|
|
|
}
|
|
|
|
|
2022-01-20 20:20:29 +08:00
|
|
|
target_ulong helper_mret(CPURISCVState *env)
|
2018-03-03 01:31:10 +13:00
|
|
|
{
|
|
|
|
if (!(env->priv >= PRV_M)) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
target_ulong retpc = env->mepc;
|
|
|
|
if (!riscv_has_ext(env, RVC) && (retpc & 0x3)) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_INST_ADDR_MIS, GETPC());
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2020-10-26 19:55:25 +08:00
|
|
|
uint64_t mstatus = env->mstatus;
|
2018-03-03 01:31:10 +13:00
|
|
|
target_ulong prev_priv = get_field(mstatus, MSTATUS_MPP);
|
2020-12-23 11:25:53 -08:00
|
|
|
|
2023-02-22 15:52:02 -03:00
|
|
|
if (riscv_cpu_cfg(env)->pmp &&
|
2021-12-14 12:26:59 +03:00
|
|
|
!pmp_get_num_rules(env) && (prev_priv != PRV_M)) {
|
2022-12-05 14:53:03 +08:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_INST_ACCESS_FAULT, GETPC());
|
2020-12-23 11:25:53 -08:00
|
|
|
}
|
|
|
|
|
2020-10-26 19:55:25 +08:00
|
|
|
target_ulong prev_virt = get_field(env->mstatus, MSTATUS_MPV);
|
2020-05-05 13:04:50 -07:00
|
|
|
mstatus = set_field(mstatus, MSTATUS_MIE,
|
|
|
|
get_field(mstatus, MSTATUS_MPIE));
|
2020-01-03 11:53:42 +08:00
|
|
|
mstatus = set_field(mstatus, MSTATUS_MPIE, 1);
|
2018-03-03 01:31:10 +13:00
|
|
|
mstatus = set_field(mstatus, MSTATUS_MPP, PRV_U);
|
2020-01-31 17:02:33 -08:00
|
|
|
mstatus = set_field(mstatus, MSTATUS_MPV, 0);
|
2022-12-07 17:00:37 +08:00
|
|
|
if ((env->priv_ver >= PRIV_VERSION_1_12_0) && (prev_priv != PRV_M)) {
|
|
|
|
mstatus = set_field(mstatus, MSTATUS_MPRV, 0);
|
|
|
|
}
|
2019-01-04 23:23:55 +00:00
|
|
|
env->mstatus = mstatus;
|
2020-01-31 17:02:33 -08:00
|
|
|
riscv_cpu_set_mode(env, prev_priv);
|
|
|
|
|
|
|
|
if (riscv_has_ext(env, RVH)) {
|
|
|
|
if (prev_virt) {
|
|
|
|
riscv_cpu_swap_hypervisor_regs(env);
|
|
|
|
}
|
|
|
|
|
|
|
|
riscv_cpu_set_virt_enabled(env, prev_virt);
|
|
|
|
}
|
2018-03-03 01:31:10 +13:00
|
|
|
|
|
|
|
return retpc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void helper_wfi(CPURISCVState *env)
|
|
|
|
{
|
2019-03-22 19:11:37 -07:00
|
|
|
CPUState *cs = env_cpu(env);
|
2021-04-20 22:36:56 +01:00
|
|
|
bool rvs = riscv_has_ext(env, RVS);
|
|
|
|
bool prv_u = env->priv == PRV_U;
|
|
|
|
bool prv_s = env->priv == PRV_S;
|
2018-03-03 01:31:10 +13:00
|
|
|
|
2021-04-20 22:36:56 +01:00
|
|
|
if (((prv_s || (!rvs && prv_u)) && get_field(env->mstatus, MSTATUS_TW)) ||
|
|
|
|
(rvs && prv_u && !riscv_cpu_virt_enabled(env))) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
|
|
|
} else if (riscv_cpu_virt_enabled(env) && (prv_u ||
|
|
|
|
(prv_s && get_field(env->hstatus, HSTATUS_VTW)))) {
|
2020-08-12 12:13:49 -07:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, GETPC());
|
2019-01-14 23:58:08 +00:00
|
|
|
} else {
|
|
|
|
cs->halted = 1;
|
|
|
|
cs->exception_index = EXCP_HLT;
|
|
|
|
cpu_loop_exit(cs);
|
|
|
|
}
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
void helper_tlb_flush(CPURISCVState *env)
|
|
|
|
{
|
2019-03-22 19:11:37 -07:00
|
|
|
CPUState *cs = env_cpu(env);
|
2019-04-01 15:12:07 -04:00
|
|
|
if (!(env->priv >= PRV_S) ||
|
|
|
|
(env->priv == PRV_S &&
|
|
|
|
get_field(env->mstatus, MSTATUS_TVM))) {
|
2019-01-14 23:58:23 +00:00
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
2020-08-12 12:13:49 -07:00
|
|
|
} else if (riscv_has_ext(env, RVH) && riscv_cpu_virt_enabled(env) &&
|
|
|
|
get_field(env->hstatus, HSTATUS_VTVM)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, GETPC());
|
2019-01-14 23:58:08 +00:00
|
|
|
} else {
|
|
|
|
tlb_flush(cs);
|
|
|
|
}
|
2018-03-03 01:31:10 +13:00
|
|
|
}
|
|
|
|
|
2023-01-31 21:20:01 +01:00
|
|
|
void helper_tlb_flush_all(CPURISCVState *env)
|
|
|
|
{
|
|
|
|
CPUState *cs = env_cpu(env);
|
|
|
|
tlb_flush_all_cpus_synced(cs);
|
|
|
|
}
|
|
|
|
|
2020-04-03 15:54:59 -07:00
|
|
|
void helper_hyp_tlb_flush(CPURISCVState *env)
|
|
|
|
{
|
|
|
|
CPUState *cs = env_cpu(env);
|
|
|
|
|
2020-08-12 12:13:49 -07:00
|
|
|
if (env->priv == PRV_S && riscv_cpu_virt_enabled(env)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, GETPC());
|
|
|
|
}
|
|
|
|
|
2020-04-03 15:54:59 -07:00
|
|
|
if (env->priv == PRV_M ||
|
|
|
|
(env->priv == PRV_S && !riscv_cpu_virt_enabled(env))) {
|
|
|
|
tlb_flush(cs);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
|
|
|
}
|
|
|
|
|
2020-08-12 12:13:49 -07:00
|
|
|
void helper_hyp_gvma_tlb_flush(CPURISCVState *env)
|
|
|
|
{
|
|
|
|
if (env->priv == PRV_S && !riscv_cpu_virt_enabled(env) &&
|
|
|
|
get_field(env->mstatus, MSTATUS_TVM)) {
|
|
|
|
riscv_raise_exception(env, RISCV_EXCP_ILLEGAL_INST, GETPC());
|
|
|
|
}
|
|
|
|
|
|
|
|
helper_hyp_tlb_flush(env);
|
|
|
|
}
|
|
|
|
|
2020-11-03 20:43:34 -08:00
|
|
|
target_ulong helper_hyp_hlvx_hu(CPURISCVState *env, target_ulong address)
|
2020-08-12 12:13:19 -07:00
|
|
|
{
|
2020-11-03 20:43:34 -08:00
|
|
|
int mmu_idx = cpu_mmu_index(env, true) | TB_FLAGS_PRIV_HYP_ACCESS_MASK;
|
2020-08-12 12:13:19 -07:00
|
|
|
|
2020-11-03 20:43:34 -08:00
|
|
|
return cpu_lduw_mmuidx_ra(env, address, mmu_idx, GETPC());
|
|
|
|
}
|
2020-08-12 12:13:19 -07:00
|
|
|
|
2020-11-03 20:43:34 -08:00
|
|
|
target_ulong helper_hyp_hlvx_wu(CPURISCVState *env, target_ulong address)
|
|
|
|
{
|
|
|
|
int mmu_idx = cpu_mmu_index(env, true) | TB_FLAGS_PRIV_HYP_ACCESS_MASK;
|
|
|
|
|
|
|
|
return cpu_ldl_mmuidx_ra(env, address, mmu_idx, GETPC());
|
2020-08-12 12:13:19 -07:00
|
|
|
}
|
|
|
|
|
2018-03-03 01:31:10 +13:00
|
|
|
#endif /* !CONFIG_USER_ONLY */
|