arch-arm: Include Granule Size in a TLB entry

This info can be used during TLB invalidation

Change-Id: I81247e40b11745f0207178b52c47845ca1b92870
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Giacomo Travaglini
2023-07-17 19:58:08 +01:00
parent 5cd70bf9bf
commit a8efded644
2 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2012-2013, 2021 Arm Limited
* Copyright (c) 2010, 2012-2013, 2021, 2023 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -219,6 +219,7 @@ struct TlbEntry : public Serializable
uint16_t asid; // Address Space Identifier
vmid_t vmid; // Virtual machine Identifier
GrainSize tg; // Translation Granule Size
uint8_t N; // Number of bits in pagesize
uint8_t innerAttrs;
uint8_t outerAttrs;
@@ -263,7 +264,7 @@ struct TlbEntry : public Serializable
bool uncacheable, bool read_only) :
pfn(_paddr >> PageShift), size(PageBytes - 1), vpn(_vaddr >> PageShift),
attributes(0), lookupLevel(LookupLevel::L1),
asid(_asn), vmid(0), N(0),
asid(_asn), vmid(0), tg(Grain4KB), N(0),
innerAttrs(0), outerAttrs(0), ap(read_only ? 0x3 : 0), hap(0x3),
domain(DomainType::Client), mtype(MemoryType::StronglyOrdered),
longDescFormat(false), isHyp(false), global(false), valid(true),
@@ -281,7 +282,7 @@ struct TlbEntry : public Serializable
TlbEntry() :
pfn(0), size(0), vpn(0), attributes(0), lookupLevel(LookupLevel::L1),
asid(0), vmid(0), N(0),
asid(0), vmid(0), tg(ReservedGrain), N(0),
innerAttrs(0), outerAttrs(0), ap(0), hap(0x3),
domain(DomainType::Client), mtype(MemoryType::StronglyOrdered),
longDescFormat(false), isHyp(false), global(false), valid(false),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2012-2019, 2021-2022 Arm Limited
* Copyright (c) 2010, 2012-2019, 2021-2023 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -2305,6 +2305,7 @@ TableWalker::insertPartialTableEntry(LongDescriptor &descriptor)
te.asid = currState->asid;
te.vmid = currState->vmid;
te.N = descriptor.offsetBits();
te.tg = descriptor.grainSize;
te.vpn = currState->vaddr >> te.N;
te.size = (1ULL << te.N) - 1;
te.pfn = descriptor.nextTableAddr();
@@ -2378,6 +2379,7 @@ TableWalker::insertTableEntry(DescriptorBase &descriptor, bool long_descriptor)
LongDescriptor l_descriptor =
dynamic_cast<LongDescriptor &>(descriptor);
te.tg = l_descriptor.grainSize;
te.xn |= currState->xnTable;
te.pxn = currState->pxnTable || l_descriptor.pxn();
if (isStage2) {