From a2476373c9ec3aca79acbe750eaa93c9c8718225 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 1 Nov 2024 16:18:57 +0000 Subject: [PATCH] arch-arm: Do not compute purifyTaggedAddr in checkPermissions (#1739) purifyTaggedAddr is known to be an expensive computation regardless of the memoization we do, as it sits in the critical path from a host performance point of view (instruction fetch). In checkPermissions64 we compute it without really needing the tag purification. The only place where it is used is to check for PCAlignment, but the alignment checks the 3LSBs whereas a potential tag would be stored in the most significant ones Change-Id: I9f39db658c3575dcbacb5351813ff9bb3775046d Signed-off-by: Giacomo Travaglini --- src/arch/arm/mmu.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/arch/arm/mmu.cc b/src/arch/arm/mmu.cc index 0381176b3f..7237dc1a01 100644 --- a/src/arch/arm/mmu.cc +++ b/src/arch/arm/mmu.cc @@ -507,9 +507,6 @@ MMU::checkPermissions64(TlbEntry *te, const RequestPtr &req, Mode mode, } Addr vaddr_tainted = req->getVaddr(); - Addr vaddr = purifyTaggedAddr(vaddr_tainted, tc, state.exceptionLevel, - static_cast(state.ttbcr), mode==Execute, state); - Request::Flags flags = req->getFlags(); bool is_fetch = (mode == Execute); // Cache clean operations require read permissions to the specified VA @@ -534,7 +531,7 @@ MMU::checkPermissions64(TlbEntry *te, const RequestPtr &req, Mode mode, // strongly ordered memory if (!is_fetch) { if (te->mtype != TlbEntry::MemoryType::Normal) { - if (vaddr & mask(flags & AlignmentMask)) { + if (vaddr_tainted & mask(flags & AlignmentMask)) { stats.alignFaults++; return std::make_shared( vaddr_tainted,