mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
hw/intc: Fix LoongArch extioi coreisr accessing
1. When cpu read or write extioi COREISR reg, it should access the reg belonged to itself, so the cpu index of 's->coreisr' is current cpu number. Using MemTxAttrs' requester_id to get the cpu index. 2. it need not to mask 0x1f when calculate the coreisr array index. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20221021015307.2570844-3-yangxiaojuan@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
3fc8f74b51
commit
a649fffcc9
2 changed files with 17 additions and 12 deletions
|
@ -14,54 +14,57 @@
|
|||
#include "exec/cpu_ldst.h"
|
||||
#include "tcg/tcg-ldst.h"
|
||||
|
||||
#define GET_MEMTXATTRS(cas) \
|
||||
((MemTxAttrs){.requester_id = env_cpu(cas)->cpu_index})
|
||||
|
||||
uint64_t helper_iocsrrd_b(CPULoongArchState *env, target_ulong r_addr)
|
||||
{
|
||||
return address_space_ldub(&env->address_space_iocsr, r_addr,
|
||||
MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
uint64_t helper_iocsrrd_h(CPULoongArchState *env, target_ulong r_addr)
|
||||
{
|
||||
return address_space_lduw(&env->address_space_iocsr, r_addr,
|
||||
MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
uint64_t helper_iocsrrd_w(CPULoongArchState *env, target_ulong r_addr)
|
||||
{
|
||||
return address_space_ldl(&env->address_space_iocsr, r_addr,
|
||||
MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
uint64_t helper_iocsrrd_d(CPULoongArchState *env, target_ulong r_addr)
|
||||
{
|
||||
return address_space_ldq(&env->address_space_iocsr, r_addr,
|
||||
MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
void helper_iocsrwr_b(CPULoongArchState *env, target_ulong w_addr,
|
||||
target_ulong val)
|
||||
{
|
||||
address_space_stb(&env->address_space_iocsr, w_addr,
|
||||
val, MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
val, GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
void helper_iocsrwr_h(CPULoongArchState *env, target_ulong w_addr,
|
||||
target_ulong val)
|
||||
{
|
||||
address_space_stw(&env->address_space_iocsr, w_addr,
|
||||
val, MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
val, GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
void helper_iocsrwr_w(CPULoongArchState *env, target_ulong w_addr,
|
||||
target_ulong val)
|
||||
{
|
||||
address_space_stl(&env->address_space_iocsr, w_addr,
|
||||
val, MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
val, GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
||||
void helper_iocsrwr_d(CPULoongArchState *env, target_ulong w_addr,
|
||||
target_ulong val)
|
||||
{
|
||||
address_space_stq(&env->address_space_iocsr, w_addr,
|
||||
val, MEMTXATTRS_UNSPECIFIED, NULL);
|
||||
val, GET_MEMTXATTRS(env), NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue