tlbi_op.cc revision 12605
1545SN/A/* 21762SN/A * Copyright (c) 2018 ARM Limited 3545SN/A * All rights reserved 4545SN/A * 5545SN/A * The license below extends only to copyright in the software and shall 6545SN/A * not be construed as granting a license to any other intellectual 7545SN/A * property including but not limited to intellectual property relating 8545SN/A * to a hardware implementation of the functionality of the software 9545SN/A * licensed hereunder. You may use the software subject to the license 10545SN/A * terms below provided that you ensure that this notice is replicated 11545SN/A * unmodified and in its entirety in all distributions of the software, 12545SN/A * modified or unmodified, in source code or in binary form. 13545SN/A * 14545SN/A * Redistribution and use in source and binary forms, with or without 15545SN/A * modification, are permitted provided that the following conditions are 16545SN/A * met: redistributions of source code must retain the above copyright 17545SN/A * notice, this list of conditions and the following disclaimer; 18545SN/A * redistributions in binary form must reproduce the above copyright 19545SN/A * notice, this list of conditions and the following disclaimer in the 20545SN/A * documentation and/or other materials provided with the distribution; 21545SN/A * neither the name of the copyright holders nor the names of its 22545SN/A * contributors may be used to endorse or promote products derived from 23545SN/A * this software without specific prior written permission. 24545SN/A * 25545SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26545SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 272665Ssaidi@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 282665Ssaidi@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 292665Ssaidi@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30545SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31545SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 321310SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 331310SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34545SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 355386Sstever@gmail.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 362542SN/A * 373348Sbinkertn@umich.edu * Authors: Giacomo Travaglini 383348Sbinkertn@umich.edu */ 394762Snate@binkert.org 404762Snate@binkert.org#include "arch/arm/tlbi_op.hh" 414762Snate@binkert.org 422489SN/A#include "arch/arm/tlb.hh" 43545SN/A#include "cpu/checker/cpu.hh" 443090Sstever@eecs.umich.edu 451310SN/Anamespace ArmISA { 462384SN/A 472489SN/Avoid 482522SN/ATLBIALL::operator()(ThreadContext* tc) 49545SN/A{ 502489SN/A getITBPtr(tc)->flushAllSecurity(secureLookup, targetEL); 512489SN/A getDTBPtr(tc)->flushAllSecurity(secureLookup, targetEL); 522489SN/A 532489SN/A // If CheckerCPU is connected, need to notify it of a flush 542489SN/A CheckerCPU *checker = tc->getCheckerCpuPtr(); 553090Sstever@eecs.umich.edu if (checker) { 563090Sstever@eecs.umich.edu getITBPtr(checker)->flushAllSecurity(secureLookup, 572914Ssaidi@eecs.umich.edu targetEL); 58545SN/A getDTBPtr(checker)->flushAllSecurity(secureLookup, 59545SN/A targetEL); 602489SN/A } 612384SN/A} 622384SN/A 633349Sbinkertn@umich.eduvoid 642384SN/AITLBIALL::operator()(ThreadContext* tc) 653090Sstever@eecs.umich.edu{ 664475Sstever@eecs.umich.edu getITBPtr(tc)->flushAllSecurity(secureLookup, targetEL); 672384SN/A} 682384SN/A 693091Sstever@eecs.umich.eduvoid 702901Ssaidi@eecs.umich.eduDTLBIALL::operator()(ThreadContext* tc) 712384SN/A{ 722384SN/A getDTBPtr(tc)->flushAllSecurity(secureLookup, targetEL); 732565SN/A} 742384SN/A 752384SN/Avoid 762384SN/ATLBIASID::operator()(ThreadContext* tc) 775386Sstever@gmail.com{ 782784Ssaidi@eecs.umich.edu getITBPtr(tc)->flushAsid(asid, secureLookup, targetEL); 792784Ssaidi@eecs.umich.edu getDTBPtr(tc)->flushAsid(asid, secureLookup, targetEL); 802784Ssaidi@eecs.umich.edu CheckerCPU *checker = tc->getCheckerCpuPtr(); 812784Ssaidi@eecs.umich.edu if (checker) { 822784Ssaidi@eecs.umich.edu getITBPtr(checker)->flushAsid(asid, secureLookup, targetEL); 832784Ssaidi@eecs.umich.edu getDTBPtr(checker)->flushAsid(asid, secureLookup, targetEL); 842784Ssaidi@eecs.umich.edu } 852784Ssaidi@eecs.umich.edu} 862784Ssaidi@eecs.umich.edu 872784Ssaidi@eecs.umich.eduvoid 882784Ssaidi@eecs.umich.eduITLBIASID::operator()(ThreadContext* tc) 892784Ssaidi@eecs.umich.edu{ 902784Ssaidi@eecs.umich.edu getITBPtr(tc)->flushAsid(asid, secureLookup, targetEL); 912784Ssaidi@eecs.umich.edu} 925534Ssaidi@eecs.umich.edu 935534Ssaidi@eecs.umich.eduvoid 945534Ssaidi@eecs.umich.eduDTLBIASID::operator()(ThreadContext* tc) 955534Ssaidi@eecs.umich.edu{ 965534Ssaidi@eecs.umich.edu getDTBPtr(tc)->flushAsid(asid, secureLookup, targetEL); 975534Ssaidi@eecs.umich.edu} 982784Ssaidi@eecs.umich.edu 992784Ssaidi@eecs.umich.eduvoid 1002784Ssaidi@eecs.umich.eduTLBIALLN::operator()(ThreadContext* tc) 1012565SN/A{ 1023349Sbinkertn@umich.edu getITBPtr(tc)->flushAllNs(hyp, targetEL); 1032384SN/A getDTBPtr(tc)->flushAllNs(hyp, targetEL); 1042901Ssaidi@eecs.umich.edu 1052565SN/A CheckerCPU *checker = tc->getCheckerCpuPtr(); 1062901Ssaidi@eecs.umich.edu if (checker) { 1072565SN/A getITBPtr(checker)->flushAllNs(hyp, targetEL); 1082565SN/A getDTBPtr(checker)->flushAllNs(hyp, targetEL); 1092565SN/A } 1102384SN/A} 1112901Ssaidi@eecs.umich.edu 1122901Ssaidi@eecs.umich.eduvoid 1132901Ssaidi@eecs.umich.eduTLBIMVAA::operator()(ThreadContext* tc) 1142901Ssaidi@eecs.umich.edu{ 1152901Ssaidi@eecs.umich.edu getITBPtr(tc)->flushMva(addr, secureLookup, hyp, targetEL); 1162901Ssaidi@eecs.umich.edu getDTBPtr(tc)->flushMva(addr, secureLookup, hyp, targetEL); 1172901Ssaidi@eecs.umich.edu 1184435Ssaidi@eecs.umich.edu CheckerCPU *checker = tc->getCheckerCpuPtr(); 1194435Ssaidi@eecs.umich.edu if (checker) { 1204435Ssaidi@eecs.umich.edu getITBPtr(checker)->flushMva(addr, secureLookup, hyp, targetEL); 1214435Ssaidi@eecs.umich.edu getDTBPtr(checker)->flushMva(addr, secureLookup, hyp, targetEL); 1224435Ssaidi@eecs.umich.edu } 1234435Ssaidi@eecs.umich.edu} 1244435Ssaidi@eecs.umich.edu 1254435Ssaidi@eecs.umich.eduvoid 1263349Sbinkertn@umich.eduTLBIMVA::operator()(ThreadContext* tc) 1273349Sbinkertn@umich.edu{ 1283918Ssaidi@eecs.umich.edu getITBPtr(tc)->flushMvaAsid(addr, asid, 1293349Sbinkertn@umich.edu secureLookup, targetEL); 1302384SN/A getDTBPtr(tc)->flushMvaAsid(addr, asid, 1312384SN/A secureLookup, targetEL); 1322384SN/A 1332384SN/A CheckerCPU *checker = tc->getCheckerCpuPtr(); 1342384SN/A if (checker) { 1352657Ssaidi@eecs.umich.edu getITBPtr(checker)->flushMvaAsid( 1362384SN/A addr, asid, secureLookup, targetEL); 1373090Sstever@eecs.umich.edu getDTBPtr(checker)->flushMvaAsid( 1384475Sstever@eecs.umich.edu addr, asid, secureLookup, targetEL); 1394475Sstever@eecs.umich.edu } 1402384SN/A} 1414435Ssaidi@eecs.umich.edu 1424435Ssaidi@eecs.umich.eduvoid 1434435Ssaidi@eecs.umich.eduITLBIMVA::operator()(ThreadContext* tc) 1444435Ssaidi@eecs.umich.edu{ 1454435Ssaidi@eecs.umich.edu getITBPtr(tc)->flushMvaAsid( 1462489SN/A addr, asid, secureLookup, targetEL); 1472384SN/A} 1482901Ssaidi@eecs.umich.edu 1492565SN/Avoid 1502641Sstever@eecs.umich.eduDTLBIMVA::operator()(ThreadContext* tc) 1515534Ssaidi@eecs.umich.edu{ 1522565SN/A getDTBPtr(tc)->flushMvaAsid( 1532565SN/A addr, asid, secureLookup, targetEL); 1542384SN/A} 1556227Snate@binkert.org 1562901Ssaidi@eecs.umich.eduvoid 1572384SN/ATLBIIPA::operator()(ThreadContext* tc) 1582384SN/A{ 1592489SN/A getITBPtr(tc)->flushIpaVmid(addr, 1602489SN/A secureLookup, false, targetEL); 1612489SN/A getDTBPtr(tc)->flushIpaVmid(addr, 1622489SN/A secureLookup, false, targetEL); 1632489SN/A 1642489SN/A CheckerCPU *checker = tc->getCheckerCpuPtr(); 1652489SN/A if (checker) { 1662542SN/A getITBPtr(checker)->flushIpaVmid(addr, 1672384SN/A secureLookup, false, targetEL); 1682384SN/A getDTBPtr(checker)->flushIpaVmid(addr, 1692384SN/A secureLookup, false, targetEL); 1702489SN/A } 1712489SN/A} 1721310SN/A 1732384SN/A} // namespace ArmISA 1742901Ssaidi@eecs.umich.edu