arm64: Fix double locking when calling FreeTable

Change-Id: I159ccd17ec6c06d759e856f5397bf00a7473d1e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8436
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Owen Anderson 2024-10-07 07:39:02 +00:00 committed by waddlesplash
parent f597685760
commit 17c50417f8

View File

@ -139,18 +139,15 @@ VMSAv8TranslationMap::~VMSAv8TranslationMap()
ASSERT(!fIsKernel);
ASSERT(fRefcount == 0);
{
ThreadCPUPinner pinner(thread_get_current_thread());
FreeTable(fPageTable, 0, fInitialLevel);
}
{
InterruptsSpinLocker locker(sAsidLock);
ThreadCPUPinner pinner(thread_get_current_thread());
InterruptsSpinLocker locker(sAsidLock);
if (fASID != -1) {
sAsidMapping[fASID] = NULL;
free_asid(fASID);
}
FreeTable(fPageTable, 0, fInitialLevel);
if (fASID != -1) {
sAsidMapping[fASID] = NULL;
free_asid(fASID);
}
}
@ -280,7 +277,6 @@ void
VMSAv8TranslationMap::FreeTable(phys_addr_t ptPa, uint64_t va, int level)
{
ASSERT(level < 4);
InterruptsSpinLocker locker(sAsidLock);
int tableBits = fPageBits - 3;
uint64_t tableSize = 1UL << tableBits;