diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2023-11-28 12:11:53 -0500 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-11-28 19:10:19 +0000 |
commit | 38ba4a64c513d84fa65a0c4f8403aefe90818720 (patch) | |
tree | efc29da4b3a3646904efe9b0d2cb72023df10373 /ArmPkg/Drivers/MmCommunicationPei | |
parent | e1627f77201ac55d24e9d0e3380f9dbdc600843c (diff) | |
download | edk2-38ba4a64c513d84fa65a0c4f8403aefe90818720.zip edk2-38ba4a64c513d84fa65a0c4f8403aefe90818720.tar.gz edk2-38ba4a64c513d84fa65a0c4f8403aefe90818720.tar.bz2 |
ArmPkg/Drivers/CpuDxe: Use lower and upper attributes
GetNextEntryAttribute() is currently applying a 64-bit mask
(TT_ATTRIBUTES_MASK) to a 32-bit descriptor value (EntryType).
The original descriptor was 64 bits containing the upper and
lower attributes which are included in TT_ATTRIBUTES_MASK.
The PrevEntryAttribute parameter is also a UINT32, but passed to
PageAttributeToGcdAttribute() for a UINT64 parameter where the
function checks masks in the upper 32 bits of the integer value:
PageAttributeToGcdAttribute (*PrevEntryAttribute)
...
STATIC
UINT64
PageAttributeToGcdAttribute (
IN UINT64 PageAttributes
)
...
if ((PageAttributes & (TT_PXN_MASK | TT_UXN_MASK)) != 0) {
GcdAttributes |= EFI_MEMORY_XP;
}
...
#define TT_PXN_MASK BIT53
#define TT_UXN_MASK BIT54 // EL1&0
This change removes UINT32 intermediary values. For EntryType,
eliminating an unncessary cast. For EntryAttribute, preserving the
upper and lower attributes for evaluation in
PageAttributeToGcdAttribute().
This also resolves the following compiler warning previously present
on Visual Studio for the assignment to the previously 32-bit local
variables.
'=': conversion from 'UINT64' to 'UINT32', possible loss of data
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmPkg/Drivers/MmCommunicationPei')
0 files changed, 0 insertions, 0 deletions