public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Platform/ARM: Fix flash alignment access
@ 2018-01-22 16:59 evan.lloyd
  2018-01-22 17:27 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: evan.lloyd @ 2018-01-22 16:59 UTC (permalink / raw)
  To: edk2-devel
  Cc: Arvind Chauhan, Daniil Egranov, Thomas Panakamattam Abraham,
	"ard.biesheuvel, "leif.lindholm, "Matteo.Carlini,
	"Alexei.Fedorov, "nd

From: Alexei Fedorov <Alexei.Fedorov@arm.com>

Flash memory is mapped as device memory and should use only aligned
accesses.
Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
BaseMemoryLib which provides aligned memory access only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
---
 Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -234,6 +234,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
 
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
 #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
@@ -215,6 +215,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -224,6 +224,7 @@ [Components.common]
   MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
     <LibraryClasses>
       NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
+      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Platform/ARM: Fix flash alignment access
  2018-01-22 16:59 [PATCH] Platform/ARM: Fix flash alignment access evan.lloyd
@ 2018-01-22 17:27 ` Ard Biesheuvel
  2018-01-23 18:17   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2018-01-22 17:27 UTC (permalink / raw)
  To: Evan Lloyd
  Cc: edk2-devel@lists.01.org, Arvind Chauhan, Daniil Egranov,
	Thomas Panakamattam Abraham, "ard.biesheuvel,
	"leif.lindholm, "Matteo.Carlini, "Alexei.Fedorov,
	"nd

On 22 January 2018 at 16:59,  <evan.lloyd@arm.com> wrote:
> From: Alexei Fedorov <Alexei.Fedorov@arm.com>
>
> Flash memory is mapped as device memory and should use only aligned
> accesses.
> Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
> BaseMemoryLib which provides aligned memory access only.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
>  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
> index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
> --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> @@ -234,6 +234,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
> @@ -1,5 +1,5 @@
>  #
> -#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
> +#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
>  #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
>  #
>  #  This program and the accompanying materials
> @@ -215,6 +215,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
> --- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
> @@ -224,6 +224,7 @@ [Components.common]
>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>      <LibraryClasses>
>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> --
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Platform/ARM: Fix flash alignment access
  2018-01-22 17:27 ` Ard Biesheuvel
@ 2018-01-23 18:17   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2018-01-23 18:17 UTC (permalink / raw)
  To: Evan Lloyd
  Cc: edk2-devel@lists.01.org, Arvind Chauhan, Daniil Egranov,
	Thomas Panakamattam Abraham, "ard.biesheuvel,
	"leif.lindholm, "Matteo.Carlini, "Alexei.Fedorov,
	"nd

On 22 January 2018 at 17:27, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 22 January 2018 at 16:59,  <evan.lloyd@arm.com> wrote:
>> From: Alexei Fedorov <Alexei.Fedorov@arm.com>
>>
>> Flash memory is mapped as device memory and should use only aligned
>> accesses.
>> Update VariableRuntimeDxe from using BaseMemoryLibOptDxe to the generic
>> BaseMemoryLib which provides aligned memory access only.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
>> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>

Pushed as 88e967c5d2f0

Thanks guys

>> ---
>>  Platform/ARM/JunoPkg/ArmJuno.dsc                     | 1 +
>>  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc    | 3 ++-
>>  Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc | 1 +
>>  3 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
>> index 5c2a29fe8330bbf308e31e34b617517a5aebcf6d..9d7317683ef39ab47429234b98d94c04953b41cb 100644
>> --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
>> +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
>> @@ -234,6 +234,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>
>> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> index 1f612cc282eb8bf4fdc74ff0933c36ecf70c6daf..6c6c8d3938e61abf7456b4c2cd6b464c0238353b 100644
>> --- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
>> @@ -1,5 +1,5 @@
>>  #
>> -#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.
>> +#  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
>>  #  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
>>  #
>>  #  This program and the accompanying materials
>> @@ -215,6 +215,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
>> diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> index 3dbc105f6f8a565da34807508ac8178e4d524e41..295e9a126b0ebaa4653d7e25e2f7d8c396403764 100644
>> --- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> +++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
>> @@ -224,6 +224,7 @@ [Components.common]
>>    MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
>>      <LibraryClasses>
>>        NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
>> +      BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
>>    }
>>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
>> --
>> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-23 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 16:59 [PATCH] Platform/ARM: Fix flash alignment access evan.lloyd
2018-01-22 17:27 ` Ard Biesheuvel
2018-01-23 18:17   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox