All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times
@ 2021-02-04 18:14 Jon Mason
  2021-02-04 18:14 ` [PATCH 2/6] gem5/gem5-aarch64-native: update to v20.1.0.3 Jon Mason
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

From: Ross Burton <ross.burton@arm.com>

The recipe currently builds gem5 binaries in optimised, fast, and
debug mode.  There is no need to build three at once (and triples the
build time), so simply build the optimised variant by default (as recommended
by upstream) whilst letting the variant be altered by setting
GEM5_BUILD_VARIANT.

Change-Id: I23baeee438d1ff08d1e2a54282141b55500f2ac1
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc | 5 ++---
 meta-gem5/recipes-devtools/gem5/gem5-native.inc         | 5 ++++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
index 898fa23..0a8e34c 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
+++ b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
@@ -1,8 +1,7 @@
 # gem5 aarch64 specific configuration
 
 # Build arm64 gem5
-GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.opt build/ARM/gem5.fast \
-    build/ARM/gem5.debug"
+GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.${GEM5_BUILD_VARIANT}"
 
 SRC_URI += "file://start-gem5.sh"
 
@@ -10,7 +9,7 @@ inherit deploy
 
 # Parameters for the start script
 
-GEM5_RUN_CONFIG ?= "gem5.fast"
+GEM5_RUN_CONFIG ?= "gem5.${GEM5_BUILD_VARIANT}"
 
 # Linux kernel file to boot
 GEM5_RUN_KERNEL ?= "vmlinux"
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-native.inc b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
index 3cad1eb..06c03e4 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-native.inc
+++ b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
@@ -6,8 +6,11 @@ LICENSE = "BSD & MIT & LGPLv2.1"
 
 # Gem5 build and run parameter
 
+# See http://www.gem5.org/documentation/general_docs/building for the list of variants
+GEM5_BUILD_VARIANT ?= "opt"
+
 # What gem5 binary are we building
-GEM5_BUILD_CONFIGS ?= "build/X86/gem5.opt"
+GEM5_BUILD_CONFIGS ?= "build/X86/gem5.{GEM5_BUILD_VARIANT}"
 
 # Scons build arguments
 GEM5_SCONS_ARGS ?= "CC=${BUILD_CC} CXX=${BUILD_CXX} \
-- 
2.17.1


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

* [PATCH 2/6] gem5/gem5-aarch64-native: update to v20.1.0.3
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
@ 2021-02-04 18:14 ` Jon Mason
  2021-02-04 18:14 ` [PATCH 3/6] gem5/gem5-aarch64-native: backport a patch to reduce warnings Jon Mason
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

Update to the latest tagged version of gem5. Previously included
patches are now part of that release.
Upstream patch backported to enable boot with SMMUv3 model.

Change-Id: I7d7ad6f9681eb1f06743d214abbe901e9f8aa74e
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
---
 ...rm-SMMUv3-enable-interrupt-interface.patch |  97 ++++++++++
 ...XXFLAGS_EXTRA-for-the-marshal-object.patch |  85 ---------
 ...arch-arm-Introduce-HavePACExt-helper.patch |  55 ------
 ...s-implemented-before-executing-insts.patch | 174 ------------------
 .../gem5/gem5-aarch64-native_20.bb            |   5 +-
 .../recipes-devtools/gem5/gem5-source_20.inc  |   6 +-
 6 files changed, 101 insertions(+), 321 deletions(-)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch
 delete mode 100644 meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch

diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch
new file mode 100644
index 0000000..6d00cc2
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-dev-arm-SMMUv3-enable-interrupt-interface.patch
@@ -0,0 +1,97 @@
+From be710c5657b03bc9a9ce18ecf7ce1956265bae47 Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <adrian.herrera@arm.com>
+Date: Thu, 10 Dec 2020 18:07:21 +0000
+Subject: [PATCH] dev-arm: SMMUv3, enable interrupt interface
+
+Users can set "irq_interface_enable" to allow software to program
+SMMU_IRQ_CTRL and SMMU_IRQ_CTRLACK. This is required to boot Linux v5.4+
+in a reasonable time. Notice the model does not implement architectural
+interrupt sources, so no assertions will happen.
+
+Change-Id: Ie138befdf5a204fe8fce961081c575c2166e22b9
+Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
+Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38555
+Tested-by: kokoro <noreply+kokoro@google.com>
+Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
+Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38555]
+Expected version: v20.2
+---
+ src/dev/arm/SMMUv3.py  |  5 +++++
+ src/dev/arm/smmu_v3.cc | 10 +++++++++-
+ src/dev/arm/smmu_v3.hh |  4 +++-
+ 3 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/dev/arm/SMMUv3.py b/src/dev/arm/SMMUv3.py
+index 29c15682bf..f57be896f9 100644
+--- a/src/dev/arm/SMMUv3.py
++++ b/src/dev/arm/SMMUv3.py
+@@ -91,6 +91,11 @@ class SMMUv3(ClockedObject):
+     reg_map = Param.AddrRange('Address range for control registers')
+     system = Param.System(Parent.any, "System this device is part of")
+ 
++    irq_interface_enable = Param.Bool(False,
++            "This flag enables software to program SMMU_IRQ_CTRL and "
++            "SMMU_IRQ_CTRLACK as if the model implemented architectural "
++            "interrupt sources")
++
+     device_interfaces = VectorParam.SMMUv3DeviceInterface([],
+                                         "Responder interfaces")
+ 
+diff --git a/src/dev/arm/smmu_v3.cc b/src/dev/arm/smmu_v3.cc
+index f9bdc277c6..d73f270170 100644
+--- a/src/dev/arm/smmu_v3.cc
++++ b/src/dev/arm/smmu_v3.cc
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2018-2019 ARM Limited
++ * Copyright (c) 2013, 2018-2020 ARM Limited
+  * All rights reserved
+  *
+  * The license below extends only to copyright in the software and shall
+@@ -58,6 +58,7 @@ SMMUv3::SMMUv3(SMMUv3Params *params) :
+     requestPort(name() + ".request", *this),
+     tableWalkPort(name() + ".walker", *this),
+     controlPort(name() + ".control", *this, params->reg_map),
++    irqInterfaceEnable(params->irq_interface_enable),
+     tlb(params->tlb_entries, params->tlb_assoc, params->tlb_policy),
+     configCache(params->cfg_entries, params->cfg_assoc, params->cfg_policy),
+     ipaCache(params->ipa_entries, params->ipa_assoc, params->ipa_policy),
+@@ -626,6 +627,13 @@ SMMUv3::writeControl(PacketPtr pkt)
+             assert(pkt->getSize() == sizeof(uint32_t));
+             regs.cr0 = regs.cr0ack = pkt->getLE<uint32_t>();
+             break;
++        case offsetof(SMMURegs, irq_ctrl):
++            assert(pkt->getSize() == sizeof(uint32_t));
++            if (irqInterfaceEnable) {
++                warn("SMMUv3::%s No support for interrupt sources", __func__);
++                regs.irq_ctrl = regs.irq_ctrlack = pkt->getLE<uint32_t>();
++            }
++            break;
+ 
+         case offsetof(SMMURegs, cr1):
+         case offsetof(SMMURegs, cr2):
+diff --git a/src/dev/arm/smmu_v3.hh b/src/dev/arm/smmu_v3.hh
+index 6b3f3982b8..a001d71178 100644
+--- a/src/dev/arm/smmu_v3.hh
++++ b/src/dev/arm/smmu_v3.hh
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2013, 2018-2019 ARM Limited
++ * Copyright (c) 2013, 2018-2020 ARM Limited
+  * All rights reserved
+  *
+  * The license below extends only to copyright in the software and shall
+@@ -94,6 +94,8 @@ class SMMUv3 : public ClockedObject
+     SMMUTableWalkPort tableWalkPort;
+     SMMUControlPort   controlPort;
+ 
++    const bool irqInterfaceEnable;
++
+     ARMArchTLB  tlb;
+     ConfigCache configCache;
+     IPACache    ipaCache;
+-- 
+2.17.1
+
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch
deleted file mode 100644
index 4303a40..0000000
--- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 1303d0497bad151f9389ee30c37dc5f9fe325f6e Mon Sep 17 00:00:00 2001
-From: Giacomo Travaglini <giacomo.travaglini@arm.com>
-Date: Thu, 04 Jun 2020 12:45:52 +0100
-Subject: [PATCH] scons: Add MARSHAL_XXFLAGS_EXTRA for the marshal object
-
-We already provide to the user the CCFLAGS_EXTRA, LDFLAGS_EXTRA
-variables to pass flags to scons when compiling/linking gem5.
-Those variables are not passed to the marshal object.
-We add an extra pair:
-
-MARSHAL_CCFLAGS_EXTRA, MARSHAL_LDFLAGS_EXTRA
-
-to add flag injection capabilities to the marshal object.
-
-The patch is also renaming base_py_env to marshal_env.
-This happens for 2 reasons:
-
-1) At the moment the marshal compilation is the only task
-making use of the base python environment.
-
-2) Consistency with the EXTRA variable names added with this patch.
-I could have named them as BASE_XXFLAGS_EXTRA, but it seems too much
-generic and users might be confused by that, as they might think
-the BASE_XXFLAGS_EXTRA is a subset of the XXFLAGS_EXTRA so that
-setting it will affect gem5 compilation as well.
-
-Change-Id: I3e420caa897059455ff8f35462db2b38da050e93
-Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
----
-
-diff --git a/SConstruct b/SConstruct
-index 3a03af4..5a66bba 100755
---- a/SConstruct
-+++ b/SConstruct
-@@ -276,6 +276,8 @@
-     ('CXX', 'C++ compiler', environ.get('CXX', main['CXX'])),
-     ('CCFLAGS_EXTRA', 'Extra C and C++ compiler flags', ''),
-     ('LDFLAGS_EXTRA', 'Extra linker flags', ''),
-+    ('MARSHAL_CCFLAGS_EXTRA', 'Extra C and C++ marshal compiler flags', ''),
-+    ('MARSHAL_LDFLAGS_EXTRA', 'Extra marshal linker flags', ''),
-     ('PYTHON_CONFIG', 'Python config binary to use',
-      [ 'python2.7-config', 'python-config', 'python3-config' ]),
-     ('PROTOC', 'protoc tool', environ.get('PROTOC', 'protoc')),
-@@ -734,7 +736,9 @@
- 
- main.Prepend(CPPPATH=Dir('ext/pybind11/include/'))
- # Bare minimum environment that only includes python
--base_py_env = main.Clone()
-+marshal_env = main.Clone()
-+marshal_env.Append(CCFLAGS='$MARSHAL_CCFLAGS_EXTRA')
-+marshal_env.Append(LINKFLAGS='$MARSHAL_LDFLAGS_EXTRA')
- 
- # On Solaris you need to use libsocket for socket ops
- if not conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):
-@@ -1285,7 +1289,7 @@
-     # to the configured variables.  It returns a list of environments,
-     # one for each variant build (debug, opt, etc.)
-     SConscript('src/SConscript', variant_dir=variant_path,
--               exports=['env', 'base_py_env'])
-+               exports=['env', 'marshal_env'])
- 
- # base help text
- Help('''
-diff --git a/src/SConscript b/src/SConscript
-index 7cd628a..aa233c8 100644
---- a/src/SConscript
-+++ b/src/SConscript
-@@ -1140,7 +1140,7 @@
- # Build a small helper that marshals the Python code using the same
- # version of Python as gem5. This is in an unorthodox location to
- # avoid building it for every variant.
--py_marshal = base_py_env.Program('marshal', 'python/marshal.cc')[0]
-+py_marshal = marshal_env.Program('marshal', 'python/marshal.cc')[0]
- 
- # Embed python files.  All .py files that have been indicated by a
- # PySource() call in a SConscript need to be embedded into the M5
-@@ -1196,7 +1196,7 @@
-     code.write(str(target[0]))
- 
- for source in PySource.all:
--    base_py_env.Command(source.cpp, [ py_marshal, source.tnode ],
-+    marshal_env.Command(source.cpp, [ py_marshal, source.tnode ],
-                         MakeAction(embedPyFile, Transform("EMBED PY")))
-     Source(source.cpp, tags=source.tags, add_tags='python')
- 
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch
deleted file mode 100644
index 9d46f8a..0000000
--- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0002-arch-arm-Introduce-HavePACExt-helper.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Upstream-Status: Backport [https://gem5.googlesource.com/public/gem5/+/6d15745532df2dd306ecc15bd0e9f79914be1682]
-Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
-
-From 6d15745532df2dd306ecc15bd0e9f79914be1682 Mon Sep 17 00:00:00 2001
-From: Giacomo Travaglini <giacomo.travaglini@arm.com>
-Date: Tue, 25 Aug 2020 12:15:17 +0100
-Subject: [PATCH] arch-arm: Introduce HavePACExt helper
-
-This will check for presence of pointer authentication extension.
-According to the reference manual, Pointer authentication is
-implemented if the value of at least one of
-
-ID_AA64ISAR1_EL1.{APA, API, GPA, GPI}
-
-is not 0b0000.
-
-Change-Id: I4e98e65758e8edc953794e5b618d2c6c3f6000ae
-Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
-Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33454
-Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
-Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-Tested-by: kokoro <noreply+kokoro@google.com>
----
-
-diff --git a/src/arch/arm/utility.cc b/src/arch/arm/utility.cc
-index ad0a3da..a189c4a 100644
---- a/src/arch/arm/utility.cc
-+++ b/src/arch/arm/utility.cc
-@@ -315,6 +315,14 @@
- }
- 
- bool
-+HavePACExt(ThreadContext *tc)
-+{
-+    AA64ISAR1 id_aa64isar1 = tc->readMiscReg(MISCREG_ID_AA64ISAR1_EL1);
-+    return id_aa64isar1.api | id_aa64isar1.apa |
-+        id_aa64isar1.gpi | id_aa64isar1.gpa;
-+}
-+
-+bool
- HaveVirtHostExt(ThreadContext *tc)
- {
-     AA64MMFR1 id_aa64mmfr1 = tc->readMiscReg(MISCREG_ID_AA64MMFR1_EL1);
-diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh
-index f00f606..f17ebc5 100644
---- a/src/arch/arm/utility.hh
-+++ b/src/arch/arm/utility.hh
-@@ -151,6 +151,7 @@
-     return opModeToEL((OperatingMode) (uint8_t)cpsr.mode);
- }
- 
-+bool HavePACExt(ThreadContext *tc);
- bool HaveVirtHostExt(ThreadContext *tc);
- bool HaveSecureEL2Ext(ThreadContext *tc);
- bool IsSecureEL2Enabled(ThreadContext *tc);
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch
deleted file mode 100644
index 4410d97..0000000
--- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native/0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch
+++ /dev/null
@@ -1,174 +0,0 @@
-Upstream-Status: Backport [https://gem5.googlesource.com/public/gem5/+/b50d61fb9ff5d94f401af98bb0b7f8e25d21d012]
-Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
-
-From b50d61fb9ff5d94f401af98bb0b7f8e25d21d012 Mon Sep 17 00:00:00 2001
-From: Giacomo Travaglini <giacomo.travaglini@arm.com>
-Date: Tue, 25 Aug 2020 13:10:23 +0100
-Subject: [PATCH] arch-arm: Check if PAC is implemented before executing insts
-
-If Armv8.3-PAuth (PAC) extension is not supported, most instrucions
-will trigger an Undefined Instruction fault; except for a group of
-them living in the HINT space; those should be treated as NOP.
-
-Change-Id: Idec920ed15e0310ec9132a3cb3701cdb7e7cf9d1
-Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
-Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33455
-Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
-Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-Tested-by: kokoro <noreply+kokoro@google.com>
----
-
-diff --git a/src/arch/arm/isa/insts/pauth.isa b/src/arch/arm/isa/insts/pauth.isa
-index 4c5b371..4806e6a 100644
---- a/src/arch/arm/isa/insts/pauth.isa
-+++ b/src/arch/arm/isa/insts/pauth.isa
-@@ -1,5 +1,6 @@
- // -*- mode:c++ -*-
- 
-+// Copyright (c) 2020 ARM Limited
- // Copyright (c) 2020 Metempsy Technology Consulting
- // All rights reserved
- //
-@@ -41,20 +42,39 @@
-     decoder_output = ""
-     exec_output = ""
- 
-+    def pacEnabledCode(hint):
-+        if hint:
-+            code = """
-+                if (!HavePACExt(xc->tcBase())) {
-+                    return NoFault;
-+                }
-+                """
-+        else:
-+            code = """
-+                if (!HavePACExt(xc->tcBase())) {
-+                    return std::make_shared<UndefinedInstruction>(
-+                        machInst, true);
-+                }
-+                """
-+        return code
- 
--    def buildPauthObject(mnem, templateBase, opcode, optArgs=[]):
-+    def buildPauthObject(mnem, templateBase, opcode, hint, optArgs=[]):
-         global header_output, decoder_output, exec_output
--        pac_code = '''//uint64_t val = 0;
--                uint64_t res;
--                fault = %(op)s(xc->tcBase(), %(op1)s, %(op2)s, &res);
--                XDest = res;
--                '''
-+        pac_code = '''
-+            %(enabled)s
-+
-+            uint64_t res;
-+            fault = %(op)s(xc->tcBase(), %(op1)s, %(op2)s, &res);
-+            XDest = res;
-+            '''
-         if templateBase=='DataX2Reg':
--            code = pac_code % {"op1": 'Op164',
-+            code = pac_code % {"enabled": pacEnabledCode(hint),
-+                               "op1": 'Op164',
-                                "op2": 'Op264',
-                                "op":  opcode }
-         else:
--            code = pac_code % {"op1": 'XDest',
-+            code = pac_code % {"enabled": pacEnabledCode(hint),
-+                               "op1": 'XDest',
-                                "op2": 'Op164',
-                                "op":  opcode }
- 
-@@ -63,13 +83,15 @@
-         decoder_output += eval(templateBase + "Constructor").subst(iop)
-         exec_output += BasicExecute.subst(iop)
- 
--    def buildXPauthObject(mnem, optArgs=[]):
-+    def buildXPauthObject(mnem, hint, optArgs=[]):
-         global header_output, decoder_output, exec_output
-         templateBase = "XPauthOpRegReg"
- 
--        code =  'uint64_t res;\n'\
--                'fault = stripPAC(xc->tcBase(), XDest, data, &res);\n'
--        code += 'XDest = res;'
-+        code = pacEnabledCode(hint) + """
-+            uint64_t res;
-+            fault = stripPAC(xc->tcBase(), XDest, data, &res);
-+            XDest = res;
-+            """
-         regoptype = 'RegOp'
- 
-         iop = InstObjParams(mnem, mnem, regoptype, code, optArgs)
-@@ -78,42 +100,42 @@
-         exec_output += BasicExecute.subst(iop)
- 
- 
--    buildPauthObject("Pacda",  "DataX1Reg", 'addPACDA')
--    buildPauthObject("Pacdza", "DataX1Reg", 'addPACDA')
--    buildPauthObject("Pacdb",  "DataX1Reg", 'addPACDB')
--    buildPauthObject("Pacdzb", "DataX1Reg", 'addPACDB')
--    buildPauthObject("Pacga",  "DataX2Reg", 'addPACGA')
-+    buildPauthObject("Pacda",  "DataX1Reg", 'addPACDA', hint=False)
-+    buildPauthObject("Pacdza", "DataX1Reg", 'addPACDA', hint=False)
-+    buildPauthObject("Pacdb",  "DataX1Reg", 'addPACDB', hint=False)
-+    buildPauthObject("Pacdzb", "DataX1Reg", 'addPACDB', hint=False)
-+    buildPauthObject("Pacga",  "DataX2Reg", 'addPACGA', hint=False)
- 
--    buildPauthObject("Pacia",     "DataX1Reg", 'addPACIA')
--    buildPauthObject("Pacia1716", "DataX1Reg", 'addPACIA')
--    buildPauthObject("Paciasp",   "DataX1Reg", 'addPACIA')
--    buildPauthObject("Paciaz",    "DataX1Reg", 'addPACIA')
--    buildPauthObject("Paciza",    "DataX1Reg", 'addPACIA')
-+    buildPauthObject("Pacia",     "DataX1Reg", 'addPACIA', hint=False)
-+    buildPauthObject("Pacia1716", "DataX1Reg", 'addPACIA', hint=True)
-+    buildPauthObject("Paciasp",   "DataX1Reg", 'addPACIA', hint=True)
-+    buildPauthObject("Paciaz",    "DataX1Reg", 'addPACIA', hint=True)
-+    buildPauthObject("Paciza",    "DataX1Reg", 'addPACIA', hint=False)
- 
--    buildPauthObject("Pacib",     "DataX1Reg", 'addPACIB')
--    buildPauthObject("Pacib1716", "DataX1Reg", 'addPACIB')
--    buildPauthObject("Pacibsp",   "DataX1Reg", 'addPACIB')
--    buildPauthObject("Pacibz",    "DataX1Reg", 'addPACIB')
--    buildPauthObject("Pacizb",    "DataX1Reg", 'addPACIB')
-+    buildPauthObject("Pacib",     "DataX1Reg", 'addPACIB', hint=False)
-+    buildPauthObject("Pacib1716", "DataX1Reg", 'addPACIB', hint=True)
-+    buildPauthObject("Pacibsp",   "DataX1Reg", 'addPACIB', hint=True)
-+    buildPauthObject("Pacibz",    "DataX1Reg", 'addPACIB', hint=True)
-+    buildPauthObject("Pacizb",    "DataX1Reg", 'addPACIB', hint=False)
- 
--    buildPauthObject("Autda",     "DataX1Reg", 'authDA')
--    buildPauthObject("Autdza",    "DataX1Reg", 'authDA')
--    buildPauthObject("Autdb",     "DataX1Reg", 'authDB')
--    buildPauthObject("Autdzb",    "DataX1Reg", 'authDB')
-+    buildPauthObject("Autda",     "DataX1Reg", 'authDA', hint=False)
-+    buildPauthObject("Autdza",    "DataX1Reg", 'authDA', hint=False)
-+    buildPauthObject("Autdb",     "DataX1Reg", 'authDB', hint=False)
-+    buildPauthObject("Autdzb",    "DataX1Reg", 'authDB', hint=False)
- 
--    buildPauthObject("Autia",     "DataX1Reg", 'authIA')
--    buildPauthObject("Autia1716", "DataX1Reg", 'authIA')
--    buildPauthObject("Autiasp",   "DataX1Reg", 'authIA')
--    buildPauthObject("Autiaz",    "DataX1Reg", 'authIA')
--    buildPauthObject("Autiza",    "DataX1Reg", 'authIA')
-+    buildPauthObject("Autia",     "DataX1Reg", 'authIA', hint=False)
-+    buildPauthObject("Autia1716", "DataX1Reg", 'authIA', hint=True)
-+    buildPauthObject("Autiasp",   "DataX1Reg", 'authIA', hint=True)
-+    buildPauthObject("Autiaz",    "DataX1Reg", 'authIA', hint=True)
-+    buildPauthObject("Autiza",    "DataX1Reg", 'authIA', hint=False)
- 
--    buildPauthObject("Autib",     "DataX1Reg", 'authIB')
--    buildPauthObject("Autib1716", "DataX1Reg", 'authIB')
--    buildPauthObject("Autibsp",   "DataX1Reg", 'authIB')
--    buildPauthObject("Autibz",    "DataX1Reg", 'authIB')
--    buildPauthObject("Autizb",    "DataX1Reg", 'authIB')
-+    buildPauthObject("Autib",     "DataX1Reg", 'authIB', hint=False)
-+    buildPauthObject("Autib1716", "DataX1Reg", 'authIB', hint=True)
-+    buildPauthObject("Autibsp",   "DataX1Reg", 'authIB', hint=True)
-+    buildPauthObject("Autibz",    "DataX1Reg", 'authIB', hint=True)
-+    buildPauthObject("Autizb",    "DataX1Reg", 'authIB', hint=False)
- 
--    buildXPauthObject("Xpacd")
--    buildXPauthObject("Xpaci")
--    buildXPauthObject("Xpaclri")
-+    buildXPauthObject("Xpacd", hint=False)
-+    buildXPauthObject("Xpaci", hint=False)
-+    buildXPauthObject("Xpaclri", hint=True)
- }};
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native_20.bb b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native_20.bb
index a222765..79cf910 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native_20.bb
+++ b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native_20.bb
@@ -1,9 +1,6 @@
 require gem5-source_20.inc
 
-SRC_URI += "file://0001-scons-Add-MARSHAL_XXFLAGS_EXTRA-for-the-marshal-object.patch \
-            file://0002-arch-arm-Introduce-HavePACExt-helper.patch \
-            file://0003-arch-arm-Check-if-PAC-is-implemented-before-executing-insts.patch \
-           "
+SRC_URI += "file://0001-dev-arm-SMMUv3-enable-interrupt-interface.patch"
 
 BPN = "gem5-aarch64-native"
 
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc b/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
index c448466..c441a1a 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
+++ b/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
@@ -1,11 +1,11 @@
-# gem5 sources v20.0.0.3
+# gem5 sources v20.1.0.3
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \
                     file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec"
 
 SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1"
-RELEASE_TAG = "v20.0.0.3"
-SRCREV = "fa70478413e4650d0058cbfe81fd5ce362101994"
+RELEASE_TAG = "v20.1.0.3"
+SRCREV = "cd21b5a5519940a0fa9b9a2dde68f30403d17f7e"
 
 PV = "${RELEASE_TAG}"
 
-- 
2.17.1


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

* [PATCH 3/6] gem5/gem5-aarch64-native: backport a patch to reduce warnings
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
  2021-02-04 18:14 ` [PATCH 2/6] gem5/gem5-aarch64-native: update to v20.1.0.3 Jon Mason
@ 2021-02-04 18:14 ` Jon Mason
  2021-02-04 18:14 ` [PATCH 4/6] gem5/gem5-m5term-native: initial recipe Jon Mason
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

From: Ross Burton <ross.burton@arm.com>

With Python 3.9 the build produces a huge number of warnings, resulting in a
do_compile log that is 17M long.

Backport a patch from pybind11 upstream to silence this warning.

Change-Id: Ie4c71f8e5dd6c07c8be0a563778029a9859e1726
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 .../gem5/files/pyinit-threads.patch           | 32 +++++++++++++++++++
 .../recipes-devtools/gem5/gem5-source_20.inc  |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch

diff --git a/meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch b/meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch
new file mode 100644
index 0000000..ac0c841
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/files/pyinit-threads.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From ae2ee2a4a51914cf78deb5c253a3b03cbb53ce72 Mon Sep 17 00:00:00 2001
+From: Boris Staletic <boris.staletic@gmail.com>
+Date: Mon, 15 Jun 2020 19:36:43 +0200
+Subject: [PATCH] Avoid using deprecated API in python 3.9
+
+The PyEval_InitThreads() and PyEval_ThreadsInitialized() functions are
+now deprecated and will be removed in Python 3.11. Calling
+PyEval_InitThreads() now does nothing. The GIL is initialized by
+Py_Initialize() since Python 3.7.
+---
+ include/pybind11/detail/internals.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h
+index 6224dfb22..166a18a32 100644
+--- a/ext/pybind11/include/pybind11/detail/internals.h
++++ b/ext/pybind11/include/pybind11/detail/internals.h
+@@ -273,7 +273,10 @@ PYBIND11_NOINLINE inline internals &get_internals() {
+         auto *&internals_ptr = *internals_pp;
+         internals_ptr = new internals();
+ #if defined(WITH_THREAD)
+-        PyEval_InitThreads();
++
++        #if PY_VERSION_HEX < 0x03090000
++                PyEval_InitThreads();
++        #endif
+         PyThreadState *tstate = PyThreadState_Get();
+         #if PY_VERSION_HEX >= 0x03070000
+             internals_ptr->tstate = PyThread_tss_alloc();
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc b/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
index c441a1a..c586308 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
+++ b/meta-gem5/recipes-devtools/gem5/gem5-source_20.inc
@@ -3,7 +3,8 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d9514d69d8abf88b6e9125e759bf0ab \
                     file://LICENSE;md5=a585e2893cee63d16a1d8bc16c6297ec"
 
-SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1"
+SRC_URI = "git://gem5.googlesource.com/public/gem5;protocol=https;nobranch=1 \
+           file://pyinit-threads.patch"
 RELEASE_TAG = "v20.1.0.3"
 SRCREV = "cd21b5a5519940a0fa9b9a2dde68f30403d17f7e"
 
-- 
2.17.1


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

* [PATCH 4/6] gem5/gem5-m5term-native: initial recipe
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
  2021-02-04 18:14 ` [PATCH 2/6] gem5/gem5-aarch64-native: update to v20.1.0.3 Jon Mason
  2021-02-04 18:14 ` [PATCH 3/6] gem5/gem5-aarch64-native: backport a patch to reduce warnings Jon Mason
@ 2021-02-04 18:14 ` Jon Mason
  2021-02-04 18:14 ` [PATCH 5/6] gem5/gem5-m5ops: " Jon Mason
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

From: Adrian Herrera <adrian.herrera@arm.com>

m5term enables users to connect to the simulated console. Useful in
development environments.

Change-Id: I6096be9fbf44da280272656f3e15d1ba19593e50
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 .../gem5/gem5-m5term-native_20.bb             | 24 +++++++++++++
 .../gem5-m5term/0001-add-makefile-flags.patch | 34 +++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch

diff --git a/meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb b/meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb
new file mode 100644
index 0000000..07faddb
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/gem5-m5term-native_20.bb
@@ -0,0 +1,24 @@
+require gem5-source_20.inc
+
+SUMMARY = "m5term allows users to connect to gem5's simulated console"
+HOMEPAGE = "https://www.gem5.org/documentation/general_docs/fullsystem/m5term"
+LICENSE = "BSD"
+
+inherit native
+
+M5TERM_DIR = "util/term"
+
+SRC_URI += "file://0001-add-makefile-flags.patch"
+
+do_compile() {
+    oe_runmake -C ${S}/${M5TERM_DIR}
+}
+
+# The Makefile for m5term does not provide a "install" target
+# We do the install process within the recipe
+do_install() {
+    install -d ${D}${bindir}
+    install -m 755 ${B}/${M5TERM_DIR}/m5term ${D}${bindir}
+}
+
+addtask addto_recipe_sysroot before do_build
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch b/meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch
new file mode 100644
index 0000000..d13ef4c
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/gem5-m5term/0001-add-makefile-flags.patch
@@ -0,0 +1,34 @@
+From 688f7103e08318edbd48cf830c0ab3a048761bbb Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <adrian.herrera@arm.com>
+Date: Thu, 03 Dec 2020 16:45:59 +0000
+Subject: [PATCH] util: m5term, fix LDFLAGS, standard make variables
+
+Enables build systems to provide necessary flags to build m5term.
+Useful specially if a different linker is intended to be used.
+
+Change-Id: If7f867cc0965d6ad4627b5421e00a99cc3d64989
+Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38256]
+Expected version: v20.2
+---
+
+diff --git a/util/term/Makefile b/util/term/Makefile
+index 658b961..4aa1c52 100644
+--- a/util/term/Makefile
++++ b/util/term/Makefile
+@@ -24,12 +24,12 @@
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+-CCFLAGS= -g -O0
++CFLAGS ?= -g -O0
+ 
+ default: m5term
+ 
+ m5term: term.c
+-	$(CC) $(LFLAGS) -o $@ $^
++	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+ 
+ install: m5term
+ 	$(SUDO) install -o root -m 555 m5term /usr/local/bin
-- 
2.17.1


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

* [PATCH 5/6] gem5/gem5-m5ops: initial recipe
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
                   ` (2 preceding siblings ...)
  2021-02-04 18:14 ` [PATCH 4/6] gem5/gem5-m5term-native: initial recipe Jon Mason
@ 2021-02-04 18:14 ` Jon Mason
  2021-02-04 18:14 ` [PATCH 6/6] gem5/gem5-aarch64-native: use oe-run-native Jon Mason
  2021-02-05 14:03 ` [meta-arm] [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

From: Adrian Herrera <adrian.herrera@arm.com>

m5ops provide pseudo-instructions to trigger gem5 functionality.
m5 utility provides a CLI for m5ops.
libm5.a provides a C library for m5ops.

Change-Id: Ib06dcb539648407522e31aeb1ed392fb5232675e
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 ...til-m5ops-optional-extra-build-flags.patch | 59 +++++++++++++++++++
 .../recipes-devtools/gem5/gem5-m5ops_20.bb    | 26 ++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch
 create mode 100644 meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb

diff --git a/meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch b/meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch
new file mode 100644
index 0000000..b446a2f
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/gem5-m5ops/0001-util-m5ops-optional-extra-build-flags.patch
@@ -0,0 +1,59 @@
+From 32e35a2f179d1b036d2eb699d77f869f7787f36b Mon Sep 17 00:00:00 2001
+From: Adrian Herrera <adrian.herrera@arm.com>
+Date: Tue, 8 Dec 2020 20:12:55 +0000
+Subject: [PATCH] util: m5ops, optional extra build flags
+
+This increases compilation control for users. Main use case is building
+m5ops as part of an image distribution. Specifying a different sysroot
+or dynamic linker may be required when the cross toolchain is built as
+part of the process.
+
+Change-Id: Icbd3faa92ea6e084fc4a9b2db83129bce73faf21
+Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
+Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38416
+Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
+Reviewed-by: Gabe Black <gabe.black@gmail.com>
+Maintainer: Jason Lowe-Power <power.jg@gmail.com>
+Tested-by: kokoro <noreply+kokoro@google.com>
+
+Upstream-Status: Accepted [https://gem5-review.googlesource.com/c/public/gem5/+/38416]
+Expected version: v20.2
+---
+ util/m5/SConstruct | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/util/m5/SConstruct b/util/m5/SConstruct
+index bbae8d9bbf..a37573d763 100644
+--- a/util/m5/SConstruct
++++ b/util/m5/SConstruct
+@@ -136,16 +136,24 @@ for root, dirs, files in os.walk(abspath(src_dir)):
+         #
+         # This also considers scons command line settings which may look like
+         # environment variables, but are set after "scons" on the command line.
+-        def get_abi_opt(name, default):
++        def _extract_abi_opt_val(name, default):
+             var_name = env.subst('${ABI}.%s' % name)
+-            env[name] = os.environ.get(
+-                    var_name, ARGUMENTS.get(var_name, default))
++            return os.environ.get(var_name, ARGUMENTS.get(var_name, default))
++        def get_abi_opt(name, default):
++            env[name] = _extract_abi_opt_val(name, default)
++        def append_abi_opt(name):
++            env.Append(**{ name: _extract_abi_opt_val(name, '') })
+ 
+         # Process the ABI's settings in the SConsopts file, storing them
+         # in a copy of the primary environment.
+         env.SConscript(Dir(root).File('SConsopts'),
+                        exports=[ 'env', 'get_abi_opt' ])
+ 
++        # The user can pass extra build flags for each ABI
++        append_abi_opt('CCFLAGS')
++        append_abi_opt('CXXFLAGS')
++        append_abi_opt('LINKFLAGS')
++
+         # Once all the options have been configured, set up build targets for
+         # this abi.
+         abi_dir = build_dir.Dir(env.subst('${ABI}'))
+-- 
+2.17.1
+
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb b/meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb
new file mode 100644
index 0000000..7b48344
--- /dev/null
+++ b/meta-gem5/recipes-devtools/gem5/gem5-m5ops_20.bb
@@ -0,0 +1,26 @@
+require gem5-source_20.inc
+inherit scons package
+
+HOMEPAGE = "https://www.gem5.org/documentation/general_docs/m5ops"
+SUMMARY = "m5ops provide pseudo-instructions to trigger gem5 functionality"
+LICENSE = "BSD"
+
+M5OPS_DIR = "util/m5"
+
+SRC_URI += "file://0001-util-m5ops-optional-extra-build-flags.patch"
+
+OUT_DIR = "build/${TARGET_ARCH}/out"
+
+EXTRA_OESCONS += "${TARGET_ARCH}.CROSS_COMPILE=${TARGET_PREFIX} \
+                  ${TARGET_ARCH}.CCFLAGS=--sysroot=${STAGING_DIR_TARGET} \
+                  ${TARGET_ARCH}.LINKFLAGS=--sysroot=${STAGING_DIR_TARGET} \
+                  -C ${S}/${M5OPS_DIR} ${OUT_DIR}/m5"
+
+# The SConstruct file for m5ops does not provide a "install" target
+# We do the install process within the recipe
+do_install() {
+    install -d ${D}${bindir} ${D}${libdir} ${D}${includedir}
+    install -m 755 ${B}/${M5OPS_DIR}/${OUT_DIR}/m5 ${D}${bindir}
+    install -m 644 ${B}/${M5OPS_DIR}/${OUT_DIR}/libm5.a ${D}${libdir}
+    install -m 644 ${B}/include/gem5/m5ops.h ${D}${includedir}
+}
-- 
2.17.1


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

* [PATCH 6/6] gem5/gem5-aarch64-native: use oe-run-native
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
                   ` (3 preceding siblings ...)
  2021-02-04 18:14 ` [PATCH 5/6] gem5/gem5-m5ops: " Jon Mason
@ 2021-02-04 18:14 ` Jon Mason
  2021-02-05 14:03 ` [meta-arm] [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-04 18:14 UTC (permalink / raw)
  To: meta-arm

From: Adrian Herrera <adrian.herrera@arm.com>

Persist gem5 binary in native sysroot. This allows executing the binary
with the standard oe-run-native script. We can also remove the wrapper
creation and the ".real" versioning, since paths are setup by oe-run-native.

Change-Id: I9fd46725c78e1a09a7142a9d343b140bb5a77088
Signed-off-by: Adrian Herrera <adrian.herrera@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 meta-gem5/recipes-devtools/gem5/files/start-gem5.sh |  2 +-
 meta-gem5/recipes-devtools/gem5/gem5-native.inc     | 10 ++--------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/meta-gem5/recipes-devtools/gem5/files/start-gem5.sh b/meta-gem5/recipes-devtools/gem5/files/start-gem5.sh
index 4edc0e5..6335411 100644
--- a/meta-gem5/recipes-devtools/gem5/files/start-gem5.sh
+++ b/meta-gem5/recipes-devtools/gem5/files/start-gem5.sh
@@ -34,6 +34,6 @@ if [ -n "${GEM5_RUN_EXTRA}" ]; then
     args="$args ${GEM5_RUN_EXTRA}"
 fi
 
-${STAGING_BINDIR_NATIVE}/${GEM5_RUN_CONFIG} \
+oe-run-native gem5-aarch64-native ${GEM5_RUN_CONFIG} \
     ${STAGING_DATADIR_NATIVE}/gem5/${GEM5_RUN_PROFILE} ${args} "$@"
 
diff --git a/meta-gem5/recipes-devtools/gem5/gem5-native.inc b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
index 06c03e4..1462b4e 100644
--- a/meta-gem5/recipes-devtools/gem5/gem5-native.inc
+++ b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
@@ -41,14 +41,7 @@ do_install() {
     for f in ${GEM5_BUILD_CONFIGS}; do
         destname=$(basename $f)
         install -d ${D}${bindir}
-        install -m 755 $f ${D}${bindir}/$destname.real
-        cat <<EOF > ${D}${bindir}/$destname
-#!/bin/bash
-basedir=\$(cd \$(dirname \$0)/../../; pwd)
-export LD_LIBRARY_PATH="\$basedir/lib:\$basedir/usr/lib"
-\$basedir/usr/bin/$destname.real "\$@"
-EOF
-        chmod a+x ${D}${bindir}/$destname
+        install -m 755 $f ${D}${bindir}/$destname
     done
 }
 
@@ -56,3 +49,4 @@ FILES_${PN} = "${datadir}/gem5/* ${bindir}/*"
 INSANE_SKIP_${PN} += "already-stripped"
 RDEPENDS_${PN} += "python3-native hdf5-native protobuf-native libpng-native"
 
+addtask addto_recipe_sysroot before do_build
-- 
2.17.1


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

* Re: [meta-arm] [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times
  2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
                   ` (4 preceding siblings ...)
  2021-02-04 18:14 ` [PATCH 6/6] gem5/gem5-aarch64-native: use oe-run-native Jon Mason
@ 2021-02-05 14:03 ` Jon Mason
  5 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2021-02-05 14:03 UTC (permalink / raw)
  To: Jon Mason; +Cc: meta-arm

On Thu, Feb 04, 2021 at 01:14:00PM -0500, Jon Mason wrote:
> From: Ross Burton <ross.burton@arm.com>
> 
> The recipe currently builds gem5 binaries in optimised, fast, and
> debug mode.  There is no need to build three at once (and triples the
> build time), so simply build the optimised variant by default (as recommended
> by upstream) whilst letting the variant be altered by setting
> GEM5_BUILD_VARIANT.
> 
> Change-Id: I23baeee438d1ff08d1e2a54282141b55500f2ac1
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> Signed-off-by: Jon Mason <jon.mason@arm.com>
> ---

Series appled to the master branch

Thanks,
Jon

>  meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc | 5 ++---
>  meta-gem5/recipes-devtools/gem5/gem5-native.inc         | 5 ++++-
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
> index 898fa23..0a8e34c 100644
> --- a/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
> +++ b/meta-gem5/recipes-devtools/gem5/gem5-aarch64-native.inc
> @@ -1,8 +1,7 @@
>  # gem5 aarch64 specific configuration
>  
>  # Build arm64 gem5
> -GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.opt build/ARM/gem5.fast \
> -    build/ARM/gem5.debug"
> +GEM5_BUILD_CONFIGS ?= "build/ARM/gem5.${GEM5_BUILD_VARIANT}"
>  
>  SRC_URI += "file://start-gem5.sh"
>  
> @@ -10,7 +9,7 @@ inherit deploy
>  
>  # Parameters for the start script
>  
> -GEM5_RUN_CONFIG ?= "gem5.fast"
> +GEM5_RUN_CONFIG ?= "gem5.${GEM5_BUILD_VARIANT}"
>  
>  # Linux kernel file to boot
>  GEM5_RUN_KERNEL ?= "vmlinux"
> diff --git a/meta-gem5/recipes-devtools/gem5/gem5-native.inc b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
> index 3cad1eb..06c03e4 100644
> --- a/meta-gem5/recipes-devtools/gem5/gem5-native.inc
> +++ b/meta-gem5/recipes-devtools/gem5/gem5-native.inc
> @@ -6,8 +6,11 @@ LICENSE = "BSD & MIT & LGPLv2.1"
>  
>  # Gem5 build and run parameter
>  
> +# See http://www.gem5.org/documentation/general_docs/building for the list of variants
> +GEM5_BUILD_VARIANT ?= "opt"
> +
>  # What gem5 binary are we building
> -GEM5_BUILD_CONFIGS ?= "build/X86/gem5.opt"
> +GEM5_BUILD_CONFIGS ?= "build/X86/gem5.{GEM5_BUILD_VARIANT}"
>  
>  # Scons build arguments
>  GEM5_SCONS_ARGS ?= "CC=${BUILD_CC} CXX=${BUILD_CXX} \
> -- 
> 2.17.1
> 

> 
> 
> 


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

end of thread, other threads:[~2021-02-05 14:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 18:14 [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason
2021-02-04 18:14 ` [PATCH 2/6] gem5/gem5-aarch64-native: update to v20.1.0.3 Jon Mason
2021-02-04 18:14 ` [PATCH 3/6] gem5/gem5-aarch64-native: backport a patch to reduce warnings Jon Mason
2021-02-04 18:14 ` [PATCH 4/6] gem5/gem5-m5term-native: initial recipe Jon Mason
2021-02-04 18:14 ` [PATCH 5/6] gem5/gem5-m5ops: " Jon Mason
2021-02-04 18:14 ` [PATCH 6/6] gem5/gem5-aarch64-native: use oe-run-native Jon Mason
2021-02-05 14:03 ` [meta-arm] [PATCH 1/6] gem5/gem5-aarch64-native: don't build gem5 three times Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.