[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/UNIKRAFT PATCH 1/2] Add two erratums for Cortex-A53



Hi,

Title: s/erratums/errata/

On 15/01/2020 10:58, Santiago Pagani wrote:
Add two erratums for Cortex-A53:
- Workaround for Cortex-A53 erratum 835769
- Workaround for Cortex-A53 erratum 843419

Signed-off-by: Santiago Pagani <santiagopagani@xxxxxxxxx>
---
  arch/arm/arm64/Config.uk   | 16 ++++++++++++++++
  arch/arm/arm64/Makefile.uk | 10 ++++++++++
  2 files changed, 26 insertions(+)

diff --git a/arch/arm/arm64/Config.uk b/arch/arm/arm64/Config.uk
index 8c20e68d..58483b66 100644
--- a/arch/arm/arm64/Config.uk
+++ b/arch/arm/arm64/Config.uk
@@ -54,3 +54,19 @@ config ARM64_ERRATUM_858921
          This option enables a workaround for Cortex-A73 (r0p0 - r0p2),
          whose counter may return a wrong value when the counter crosses
          a 32-bit boundary. The newer Cortex-A73 are not affected.
+
+config ARM64_ERRATUM_835769
+       bool "Workaround for Cortex-A53 erratum 835769"
+       default y
+       help
+         This option enables a workaround for Cortex-A53, which involves
+         inserting a NOP instruction between memory instructions and
+         64-bit integer multiply-accumulate instructions.
+
+config ARM64_ERRATUM_843419
+       bool "Workaround for Cortex-A53 erratum 843419"
+       default y
+       help
+         This option enables a workaround for Cortex-A53. This erratum
+         workaround is made at link time and this will only pass the
+         corresponding flag to the linker.
diff --git a/arch/arm/arm64/Makefile.uk b/arch/arm/arm64/Makefile.uk
index eb73cace..72dbf55c 100644
--- a/arch/arm/arm64/Makefile.uk
+++ b/arch/arm/arm64/Makefile.uk
@@ -32,6 +32,16 @@ CFLAGS-$(call gcc_version_ge,4,9)    += -march=armv8-a 
-mcpu=cortex-a53 -mtune=cort
  CXXFLAGS-$(call gcc_version_ge,4,9)   += -march=armv8-a -mcpu=cortex-a53 
-mtune=cortex-a53
  endif
+ifeq ($(CONFIG_ARM64_ERRATUM_835769),y)
+CFLAGS-$(call gcc_version_ge,4,9)      += -mfix-cortex-a53-835769
+CXXFLAGS-$(call gcc_version_ge,4,9)    += -mfix-cortex-a53-835769
+endif
+
+ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
+CFLAGS-$(call gcc_version_ge,4,9)      += -mfix-cortex-a53-843419
+CXXFLAGS-$(call gcc_version_ge,4,9)    += -mfix-cortex-a53-843419
+endif

If I understand correctly, the workaround will only be turned only for GCC 4.9 and higher. For older versions, you will silently ignore it.

In other words, a user may not realized the workaround was not used and therefore will see weird error later on. So how about requiring 4.9 when using the workaround?

+
  # GCC support -mcpu=cortex-a57 for arm64 from 4.9
  ifeq ($(CONFIG_MARCH_ARM64_CORTEXA57),y)
  $(call error_if_gcc_version_lt,4,9)


Cheers,

--
Julien Grall

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.