vm: lock memory under "sudo" addr

Remove memory touching from transactions.
This commit is contained in:
Nekotekina 2020-11-09 17:34:59 +03:00
parent e98eb4659e
commit 083397a555
5 changed files with 5 additions and 32 deletions

View file

@ -476,7 +476,6 @@ const auto spu_putllc_tx = build_function_asm<u64(*)(u32 raddr, u64 rtime, void*
c.jae(fall);
});
c.bt(x86::dword_ptr(args[2], ::offset32(&spu_thread::state) - ::offset32(&spu_thread::rdata)), static_cast<u32>(cpu_flag::pause));
c.mov(x86::eax, _XABORT_EXPLICIT);
c.jc(fall);
c.xbegin(tx0);
c.mov(x86::rax, x86::qword_ptr(x86::rbx));
@ -576,18 +575,10 @@ const auto spu_putllc_tx = build_function_asm<u64(*)(u32 raddr, u64 rtime, void*
c.xend();
c.add(x86::qword_ptr(args[2], ::offset32(&spu_thread::stx) - ::offset32(&spu_thread::rdata)), 1);
build_get_tsc(c, stamp1);
c.mov(x86::eax, _XABORT_EXPLICIT);
//c.jmp(fall);
c.bind(fall);
// Touch memory if transaction failed with status 0
c.test(x86::eax, x86::eax);
c.jnz(next);
c.xor_(x86::rbp, 0xf80);
c.lock().add(x86::dword_ptr(x86::rbp), 0);
c.xor_(x86::rbp, 0xf80);
Label fall2 = c.newLabel();
Label fail2 = c.newLabel();
Label fail3 = c.newLabel();
@ -900,18 +891,10 @@ const auto spu_putlluc_tx = build_function_asm<u64(*)(u32 raddr, const void* rda
c.xend();
c.add(x86::qword_ptr(args[2], ::offset32(&spu_thread::stx)), 1);
build_get_tsc(c, stamp1);
c.mov(x86::eax, _XABORT_EXPLICIT);
//c.jmp(fall);
c.bind(fall);
// Touch memory if transaction failed with status 0
c.test(x86::eax, x86::eax);
c.jnz(next);
c.xor_(x86::rbp, 0xf80);
c.lock().add(x86::dword_ptr(x86::rbp), 0);
c.xor_(x86::rbp, 0xf80);
Label fall2 = c.newLabel();
// Lightened transaction