Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d95d80443 | ||
|
|
c55fa8cd70 | ||
|
|
d8b60c5d45 |
@@ -390,14 +390,15 @@ const std::size_t CACHE_PAGE_SIZE = 4096;
|
|||||||
void ArmNce::ClearInstructionCache() {
|
void ArmNce::ClearInstructionCache() {
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
// Ensure all previous memory operations complete
|
// Ensure all previous memory operations complete
|
||||||
asm volatile("dmb ish" ::: "memory");
|
asm volatile(
|
||||||
asm volatile("dsb ish" ::: "memory");
|
"\tdmb ish\n"
|
||||||
asm volatile("isb" ::: "memory");
|
"\tdsb ish\n"
|
||||||
|
"\tisb\n" ::: "memory");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArmNce::InvalidateCacheRange(u64 addr, std::size_t size) {
|
void ArmNce::InvalidateCacheRange(u64 addr, std::size_t size) {
|
||||||
this->ClearInstructionCache();
|
ClearInstructionCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|||||||
@@ -183,17 +183,16 @@ bool InterpreterVisitor::Ordered(size_t size, bool L, bool o0, Reg Rn, Reg Rt) {
|
|||||||
u64 address = (Rn == Reg::SP) ? this->GetSp() : this->GetReg(Rn);
|
u64 address = (Rn == Reg::SP) ? this->GetSp() : this->GetReg(Rn);
|
||||||
switch (memop) {
|
switch (memop) {
|
||||||
case MemOp::Store: {
|
case MemOp::Store: {
|
||||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
std::atomic_thread_fence(std::memory_order_release);
|
||||||
u64 value = this->GetReg(Rt);
|
u64 value = this->GetReg(Rt);
|
||||||
m_memory.WriteBlock(address, &value, dbytes);
|
m_memory.WriteBlock(address, &value, dbytes);
|
||||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MemOp::Load: {
|
case MemOp::Load: {
|
||||||
u64 value = 0;
|
u64 value = 0;
|
||||||
m_memory.ReadBlock(address, &value, dbytes);
|
m_memory.ReadBlock(address, &value, dbytes);
|
||||||
|
std::atomic_thread_fence(std::memory_order_acquire);
|
||||||
this->SetReg(Rt, value);
|
this->SetReg(Rt, value);
|
||||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user