Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vk: Fix cyclic read-write in dma_block::load/flush #9818

Merged
merged 1 commit into from Feb 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions rpcs3/Emu/RSX/VK/VKDMA.cpp
Expand Up @@ -95,6 +95,13 @@ namespace vk

void dma_block::flush(const utils::address_range& range)
{
if (inheritance_info.parent)
{
// Parent may be a different type of block
inheritance_info.parent->flush(range);
return;
}

auto src = map_range(range);
auto dst = vm::get_super_ptr(range.start);
std::memcpy(dst, src, range.length());
Expand All @@ -105,6 +112,13 @@ namespace vk

void dma_block::load(const utils::address_range& range)
{
if (inheritance_info.parent)
{
// Parent may be a different type of block
inheritance_info.parent->load(range);
return;
}

auto src = vm::get_super_ptr(range.start);
auto dst = map_range(range);
std::memcpy(dst, src, range.length());
Expand Down