[Skiboot] [PATCH v8 08/11] hdata/memory.c: Parse HDAT for secure memory
Oliver O'Halloran
oohall at gmail.com
Fri Aug 28 15:28:03 AEST 2020
On Thu, Aug 27, 2020 at 5:07 AM Ryan Grimm <grimm at linux.ibm.com> wrote:
>
> The secure memory ranges are provided by the hostboot through HDAT.
> Skiboot parses HDAT and creates secure-memory@ device tree nodes. The
> secure-memory nodes set dev_type to "secure-memory" so the kernel
> doesn't try to use them.
>
> In the HDIF_ms_area_address_range structure, HDAT spec version 10.5, the
> mirror attribute at offset 0x14 is renamed to memory attribute.
>
> The memory attribute now defines byte 3 as secure memory whereas
> previously it was reserved. The rest of the attribute is unchanged:
>
> 1st byte -> Range is Mirrorable
> 0x00 = false
> 0x01 = true
> 2nd byte -> Hardware Mirroring Algorithm
> 0x0A – Memory Mirroring algorithm for P9 systems
> 0xFF – Memory Mirroring Not Supported
> 3rd byte -> SMF Memory
> 0x00 = false
> 0x01 = true
> 4th byte -> Reserved
>
> Signed-off-by: Ryan Grimm <grimm at linux.ibm.com>
> ---
> hdata/memory.c | 16 +++++++++++++---
> 1 file changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/hdata/memory.c b/hdata/memory.c
> index bd47fee4..9443f297 100755
> --- a/hdata/memory.c
> +++ b/hdata/memory.c
> @@ -32,7 +32,7 @@ struct HDIF_ms_area_address_range {
> __be64 start;
> __be64 end;
> __be32 chip;
> - __be32 mirror_attr;
> + __be32 memory_attr;
> __be64 mirror_start;
> __be32 controller_id;
> __be32 phys_attr;
> @@ -66,6 +66,9 @@ struct HDIF_ms_area_address_range {
> #define MS_CONTROLLER_MCC_ID(id) GETFIELD(PPC_BITMASK32(8, 15), id)
> #define MS_CONTROLLER_OMI_ID(id) GETFIELD(PPC_BITMASK32(16, 31), id)
>
> +#define MS_ATTR_PEF PPC_BIT32(23)
> +#define UV_SECURE_MEM_BIT PPC_BIT(15)
Does the UV_SECURE_MEM_BIT macro still get used?
More information about the Skiboot
mailing list