mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
rsx: Fix protection bug
This commit is contained in:
parent
0a34fc4bcd
commit
52acc23ecf
@ -526,6 +526,7 @@ namespace rsx
|
|||||||
// Copy ranges to result, merging them if possible
|
// Copy ranges to result, merging them if possible
|
||||||
for (const auto §ion : sections)
|
for (const auto §ion : sections)
|
||||||
{
|
{
|
||||||
|
ensure(section->is_locked(true));
|
||||||
const auto &new_range = section->get_locked_range();
|
const auto &new_range = section->get_locked_range();
|
||||||
AUDIT(new_range.is_page_range());
|
AUDIT(new_range.is_page_range());
|
||||||
|
|
||||||
@ -583,6 +584,7 @@ namespace rsx
|
|||||||
u32 no_access_count = 0;
|
u32 no_access_count = 0;
|
||||||
for (const auto &excluded : data.sections_to_exclude)
|
for (const auto &excluded : data.sections_to_exclude)
|
||||||
{
|
{
|
||||||
|
ensure(excluded->is_locked(true));
|
||||||
address_range exclusion_range = excluded->get_locked_range();
|
address_range exclusion_range = excluded->get_locked_range();
|
||||||
|
|
||||||
// We need to make sure that the exclusion range is *inside* invalidate range
|
// We need to make sure that the exclusion range is *inside* invalidate range
|
||||||
@ -681,18 +683,18 @@ namespace rsx
|
|||||||
|
|
||||||
auto &tex = *It;
|
auto &tex = *It;
|
||||||
|
|
||||||
|
if (!tex.is_locked(true))
|
||||||
|
{
|
||||||
|
// Ignore hash sections, they are not involved in page faults
|
||||||
|
It++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
AUDIT(tex.is_locked()); // we should be iterating locked sections only, but just to make sure...
|
AUDIT(tex.is_locked()); // we should be iterating locked sections only, but just to make sure...
|
||||||
AUDIT(tex.cache_tag != cache_tag || last_dirty_block != UINT32_MAX); // cache tag should not match during the first loop
|
AUDIT(tex.cache_tag != cache_tag || last_dirty_block != UINT32_MAX); // cache tag should not match during the first loop
|
||||||
|
|
||||||
if (tex.cache_tag != cache_tag) //flushable sections can be 'clean' but unlocked. TODO: Handle this better
|
if (tex.cache_tag != cache_tag) //flushable sections can be 'clean' but unlocked. TODO: Handle this better
|
||||||
{
|
{
|
||||||
tex.sync_protection();
|
|
||||||
if (!tex.is_locked())
|
|
||||||
{
|
|
||||||
It++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const rsx::section_bounds bounds = tex.get_overlap_test_bounds();
|
const rsx::section_bounds bounds = tex.get_overlap_test_bounds();
|
||||||
|
|
||||||
if (locked_range == bounds || tex.overlaps(invalidate_range, bounds))
|
if (locked_range == bounds || tex.overlaps(invalidate_range, bounds))
|
||||||
@ -838,7 +840,7 @@ namespace rsx
|
|||||||
{
|
{
|
||||||
auto &tex = *obj;
|
auto &tex = *obj;
|
||||||
|
|
||||||
if (!tex.is_locked())
|
if (!tex.is_locked(true))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const rsx::section_bounds bounds = tex.get_overlap_test_bounds();
|
const rsx::section_bounds bounds = tex.get_overlap_test_bounds();
|
||||||
@ -979,11 +981,7 @@ namespace rsx
|
|||||||
for (auto It = m_storage.range_begin(test_range, full_range, check_unlocked); It != m_storage.range_end(); It++)
|
for (auto It = m_storage.range_begin(test_range, full_range, check_unlocked); It != m_storage.range_end(); It++)
|
||||||
{
|
{
|
||||||
auto &tex = *It;
|
auto &tex = *It;
|
||||||
|
tex.sync_protection();
|
||||||
if constexpr (check_unlocked)
|
|
||||||
{
|
|
||||||
tex.sync_protection();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tex.is_dirty() && (context_mask & static_cast<u32>(tex.get_context())))
|
if (!tex.is_dirty() && (context_mask & static_cast<u32>(tex.get_context())))
|
||||||
{
|
{
|
||||||
@ -1005,6 +1003,7 @@ namespace rsx
|
|||||||
auto &block = m_storage.block_for(rsx_address);
|
auto &block = m_storage.block_for(rsx_address);
|
||||||
for (auto &tex : block)
|
for (auto &tex : block)
|
||||||
{
|
{
|
||||||
|
tex.sync_protection();
|
||||||
if constexpr (check_unlocked)
|
if constexpr (check_unlocked)
|
||||||
{
|
{
|
||||||
if (!tex.is_locked())
|
if (!tex.is_locked())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user