== Progress ==
* GCC:
- FDPIC: handling feedback.
* GCC upstream validation:
- no issue to report this week.
* Binutils:
- Non-contiguous memory regions support in the BFD linker: not started yet.
* misc:
- infra fixes / troubleshooting
- qemu-4.1 confirmed OK for GCC validations
- trying validations for cortex-m33, found a few issues in GCC and a
small one in QEMU
- a bit of Jira
== Next ==
GCC:
- handle feedback on FDPIC patches
- binutils/linker support for non-contiguous memory regions
- GNU-583
- GCC upstream validation: Add a config for cortex-m33 (v8-m)
- Reorganised buildbots to remove some of the duplication between v7
and v8 AArch32 to free up more v7 hardware.
- Got final code-size information and wrote my slides for Linaro Connect
- Track down an AArch64 specific LLD problem due to a recent change,
now resolved.
- Wrote worst case thunk/veneer convergence patch to help move through
an iterative symbol assignment algorithm.
UK Bank Holiday Monday
== This Week ==
* GCC :
(i) PR83756: Addressing feedback from upstream.
(ii) PR90724: Committed to trunk.
(iii) PR91272: Started working on patch.
(iv) PR88839: Merged fix from sve-acle-branch to trunk.
* Validation
(i) Patch to separate build and test steps in tcwg_gnu.
(ii) SVE validation
== Next Week ==
- Continue ongoing tasks
== Progress ==
* Investigate running benchmarks in containers [TCWG-1513]
- Discussed the noise levels with the team and we decided to
continue with this
- mcf hangs, need to investigate the cause
- WIP: cleaning up the scripts so I can send a sensible patch for review
* IR SVE reviews [LLVM-545]
- Looked at some patches but didn't have much to add to what other people said
* SVE IR fuzzer [LLVM-586]
- Started prototyping
- The fuzzer relies a lot on inserting constants, and since we can't
produce SVE constants yet I'll have to dig in and get it to also use
function parameters
- Need to add operation descriptions for SVE
* Buildbot babysitting
- Reported an issue
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ unfortunately a late-breaking security-bug meant we needed an rc5, but
we put out the final 4.1.0 release on Thursday
+ code review:
- RTH's set of minor cleanups to the 32-bit arm codegen
+ sent out patches which fix our emulation of ATS instructions so
they cause exceptions when the spec says they should (a cleanup
of a change I'd half-implemented a year or so ago)
+ put together and sent the first target-arm pullreq for 4.2
* booked travel/hotel for KVM Forum; did some other prep like working
out a preliminary list of QEMU Summit invitees, and emailing people
whose GPG keys I need to sign to find out if they're going.
thanks
-- PMM
* Thursday off
== Progress ==
* GCC:
- FDPIC: handling feedback.
- noinit attribute: committed (ld patch too)
* GNU-583 (Fix Linux kernel built for Thumb-2 with GCC using LTO)
- no progress this week
* GCC upstream validation:
- a few issues reported this week.
* Binutils:
- Non-contiguous memory regions support in the BFD linker: not started
yet.
* misc:
- infra fixes / troubleshooting
== Next ==
GCC:
- handle feedback on FDPIC patches
- binutils/linker support for non-contiguous memory regions
- GNU-583
- GCC upstream validation: Add a config for cortex-m33 (v8-m)
QEMU Tooling ([VIRT-252])
=========================
QEMU plugin support ([VIRT-280])
- continued working through v4 comments on [next version branch]
- did some benchmarking to justify no fast path in translator_ld
[VIRT-280] https://projects.linaro.org/browse/VIRT-280
[next version branch]
https://github.com/stsquad/qemu/tree/plugins/plugins-v5
GSoC Mentoring ([VIRT-348])
- spent some time reviewing the current state and experimenting
[VIRT-348] https://projects.linaro.org/browse/VIRT-384
Upstream Work ([VIRT-109])
==========================
- more work on [my docker fixup branch]
- now can run make docker-test-build on qemu-test
- posted {PATCH v3 00/13} softfloat updates (include tweaks, rm LIT64)
Message-Id: <20190813124946.25322-1-alex.bennee(a)linaro.org>
[VIRT-109] https://projects.linaro.org/browse/VIRT-109
[my docker fixup branch]
https://github.com/stsquad/qemu/tree/testing/docker-def-and-buster-fixes
Completed Reviews [6/6]
=======================
{Qemu-devel} {PATCH v5 00/10} Measure Tiny Code Generation Quality
Message-Id: <20190815021857.19526-1-vandersonmr2(a)gmail.com>
- CLOSING NOTE [2019-08-15 Thu 20:45]
Looks pretty good but some racy crashes need to be fixed.
{Qemu-devel} {PATCH v1 0/2} Integrating qemu to Linux Perf
Message-Id: <20190815023725.2659-1-vandersonmr2(a)gmail.com>
- CLOSING NOTE [2019-08-15 Thu 20:46]
Needs a v2 with compile fixes
Absences
========
- Moving house & office ~20th/21st Aug
Current Review Queue
====================
* {PATCH v3 00/34} target/arm: Implement ARMv8.1-VHE
Message-Id: <20190803184800.8221-1-richard.henderson(a)linaro.org>
* {Qemu-devel} {PATCH v4 00/22} target/arm: Implement ARMv8.5-MemTag, system mode
Message-Id: <20190307170440.3113-1-richard.henderson(a)linaro.org>
* {Qemu-devel} {RFC PATCH} Implement qemu_thread_yield for posix, use it in mttcg to handle EXCP_YIELD
Message-Id: <20190717054655.14104-1-npiggin(a)gmail.com>
* {PATCH v3 0/6} tests/docker: add podman support
Message-Id: <20190713143311.17620-1-marcandre.lureau(a)redhat.com>
* {PATCH 0/2} tests/acceptance: Add test of NeXTcube framebuffer using OCR
Message-Id: <20190629150056.9071-1-f4bug(a)amsat.org>
* {Qemu-devel} {PATCH 0/4} Introduce the microvm machine type
Message-Id: <20190628115349.60293-1-slp(a)redhat.com>
--
Alex Bennée
- Fixed LLD segfault when exceptions.
- Implement large code model TLSLD relocations in LLD.
- More thoughts on MOVK prel relocations in the ABI as there looks to
be a use case for them in HWASAN that isn't covered by the existing
relocations.
- Some thoughts on how TCWG LLVM Jira initiatives could be worded and
how we may want to word them in the next cycle.
- Initial thoughts written down on Connect presentation, need to flesh
out more this week.
- Upgraded machine to 18.04, almost managed to break it in the process
but luckily it was recoverable. Will likely have some teething
problems.
o LLVM:
* Machine Outliner:
- Improved stack fixup handling (remove cnadidates when it is not
bebeficial)
- Fixing an issue related to R12 usage.
o Misc
* Various meetings and discussions.
[VIRT-327 # Richard's upstream QEMU work ]
Posted v4 of arm hflags reorg.
Split out 3 minor patch sets from the larger aa32 decodetree set.
Reviewed v6 of invert-endian tlb patch set.
Reviewed ajb's fpu header reorg.
Posted an RFC vs Andrew Jones' SVE-in-KVM patch set.
r~
QEMU Tooling ([VIRT-252])
=========================
- working through v4 comments on [next version branch]
[next version branch]
https://github.com/stsquad/qemu/tree/plugins/plugins-v5
Upstream Work ([VIRT-109])
==========================
- spent some more time looking at TCG EL2 behaviour
- there is something not working properly even without the VHE
patches
- need to do some tooling work to be able to properly debug HYP code
- posted {PATCH v1 0/7} softfloat header cleanups Message-Id:
<20190808164117.23348-1-alex.bennee(a)linaro.org>
- posted {PATCH v2 0/7} softfloat includes cleanup Message-Id:
<20190809091940.1223-1-alex.bennee(a)linaro.org>
- posted {PATCH v1 0/2} docker DEF_TARGET_LIST cleanup Message-Id:
<20190809155047.24526-1-alex.bennee(a)linaro.org>
[VIRT-109] https://projects.linaro.org/browse/VIRT-109
Completed Reviews [6/6]
=======================
{Qemu-arm} {PATCH 0/2} target/arm: Fix routing of singlestep exceptions
Message-Id: <20190805130952.4415-1-peter.maydell(a)linaro.org>
- CLOSING NOTE [2019-08-07 Wed 11:47]
Looks good, would be nice to integrate a better testcase
{PATCH} gdbstub: Fix handling of '!' packet with new infra
Message-Id: <20190805190901.14072-1-ramiro.polla(a)gmail.com>
- CLOSING NOTE [2019-08-07 Wed 11:59]
Queued to my tree
{PATCH 0/3} tests/tcg: disentangle makefiles
Message-Id: <20190730123759.21723-1-pbonzini(a)redhat.com>
{Qemu-devel} {PATCH v2 00/29} Tame a few "touch this, recompile the world" headers
Message-Id: <20190806151435.10740-1-armbru(a)redhat.com>
- CLOSING NOTE [2019-08-07 Wed 17:32]
Looks OK but breaks a lot of cross compiles. More subtly to fix.
{Qemu-devel} {PATCH untested for-4.2} memory: fix race between TCG and accesses to dirty bitmap
Message-Id: <20190729214717.6616-1-pbonzini(a)redhat.com>
{PATCH v3 00/29} Tame a few "touch this, recompile the world" headers
Message-Id: <87k1bmpn7y.fsf(a)dusky.pond.sub.org>
Current Review Queue
====================
* {PATCH v3 00/34} target/arm: Implement ARMv8.1-VHE
Message-Id: <20190803184800.8221-1-richard.henderson(a)linaro.org>
* {Qemu-devel} {PATCH v4 00/22} target/arm: Implement ARMv8.5-MemTag, system mode
Message-Id: <20190307170440.3113-1-richard.henderson(a)linaro.org>
* {Qemu-devel} {RFC PATCH} Implement qemu_thread_yield for posix, use it in mttcg to handle EXCP_YIELD
Message-Id: <20190717054655.14104-1-npiggin(a)gmail.com>
* {PATCH v3 0/6} tests/docker: add podman support
Message-Id: <20190713143311.17620-1-marcandre.lureau(a)redhat.com>
* {PATCH 0/2} tests/acceptance: Add test of NeXTcube framebuffer using OCR
Message-Id: <20190629150056.9071-1-f4bug(a)amsat.org>
* {Qemu-devel} {PATCH 0/4} Introduce the microvm machine type
Message-Id: <20190628115349.60293-1-slp(a)redhat.com>
--
Alex Bennée
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ we needed an rc4 for 4.1.0 (predictably), so herded the necessary
fixes into it
+ bug fixing:
- LP:1838913 : single-step exceptions were always being taken to EL1,
even if the guest configured debug exceptions to go to EL2 or EL3
- LP:1815423 : x86 TCG bug where we were giving the wrong result for
SSE float-to-int conversions that raised the 'invalid' exception
- LP:1796520 and LP:1839325 : started investigating some sh4 linux-user bugs
+ code review:
- patch to implement aspeed SD controller model
- Eric Auger's patchset of minor SMMUv3 fixes
- Aspeed GPIO controller model
- v3 of the GreenSocs reset-handling refactoring
- RTH's preliminary cleanup of handling of PC in arm decoder
thanks
-- PMM
[VIRT-263 # ARMv8.1-VHE Virtual Host Extensions ]
Posted a couple of revisions. Good feedback between this
and MemTag, both of which need to adjust the set of TLBs.
[VIRT-339 # ARMv8.5-BTI, Branch Target Identification ]
Posted v7.
[VIRT-344 # ARMv8.5-MemTag, Memory Tagging Extension ]
Rebased upon current VHE+BTI work. Updated from beta manuals
to the ARM ARM issue E.a manual.
[VIRT-327 # Richard's upstream QEMU work ]
Reviewed v1 x86 gen_sse rewrite.
Reviewed Alex's v4 plugin patchset.
r~
o LLVM:
* Bots babysitting
* Machine Outliner:
- Rebased branch on upstream
- Working on stack fixup limits test cases
o Misc
* Various meetings and discussions.
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ QEMU 4.1.0 rc3 sent out. As usual, we've found some last minute
bugs and we'll need an rc4 next week...
+ patch review:
- series from Philippe making some cleanups to use object_initialize_child()
and friends
- Alex's patch "generate a custom MIDR for -cpu max"
- made a start on reviewing RTH's 32-bit arm decodetree conversion
+ bug fixing:
- LP:1838277 : we were taking exceptions caused by BRK instructions at
EL2 to EL1, rather than to EL2; sent a patch fixing this
- LP:1838475 : FPU register stacking in M-profile CPUs without the
Security Extensions was incorrectly failing an NSACR check and
taking a bogus exception: sent a patch to fix
+ wrote a patchset that converts the sparc target away from the
deprecated and broken do_unassigned_access hook to use the new-in-2017
do_transaction_failure hook instead; one step closer to being able
to remove the old hook entirely...
+ did the same for the mips target
thanks
-- PMM
== This Week ==
* PR86753
- Working on approach suggested by Richard.
* PR90724
- Pinged upstream.
* Validation
- Merged patch to jenkins-scripts to add testsuite comparison to tcwg_gnu.
- Submitted patch for separating build and test steps in tcwg_gnu.
== Next Week ==
- Continue ongoing tasks.
== Progress ==
* LLVM 9.0.0 rc1 binaries uploaded
- Ran into one cross-platform issue (x86, AArch64, ARM etc)
- Opened a bug for libfuzzer tests on AArch64
* Use ninja in release job [LLVM-536]
- Done
* Investigate running benchmarks in containers [TCWG-1513]
- Seems to work, except for mcf which errors out; will investigate next week
* IR SVE reviews [LLVM-545]
- Another round of feedback to D53137
== Plan ==
* Review D47770
* Upcoming vacation: 6 - 13 August
* Friday off
== Progress ==
* GCC:
- FDPIC: started taking feedback into account. Changes under test.
- noinit attribute: posted a new version
* GNU-583 (Fix Linux kernel built for Thumb-2 with GCC using LTO)
- no progress this week
* GCC upstream validation:
- no new issue this week.
* Binutils:
- Non-contiguous memory regions support in the BFD linker: not started
yet. Received a few "warnings" as feedback.
* misc:
- infra fixes / troubleshooting
== Next ==
GCC:
- handle feedback on FDPIC and noinit patches
- binutils/linker support for non-contiguous memory regions
- GNU-583
- GCC upstream validation: Add a config for cortex-m33 (v8-m)
== Holidays ==
Aug 2-11 (next week)
[PR42719] BasicAA UnitTest failure on AArch64 when compiled with GCC
- Patch submitted upstream
[PR42853] LLD support for TPREL_G0 relocations
- In theory a simple change, but llvm-mc seems to be deliberately
doing something strange with MOVZ encodings fixMOVZ and I haven't
worked out why it is needed.
Investigations with respect to inline assembler constraints.
- Some patch review comments for my ABE (Linaro GCC build system)
patch for GCC RM multilibs
- LLD review for smaller AArch64 images.
- Wrote a summary of what TCWG do for the upstream community, may turn
into a Linaro blogpost
- Raised GCC PR91299 to cover incorrect weak definition inlining in
GCC LTO in presence of non-weak definition.
On holiday Friday 2nd August, back in the office on Monday.
[VIRT-263 # ARMv8.1-VHE Virtual Host Extensions ]
Merged some fixes from Alex.
Starting to test kvm-inside-tcg.
[VIRT-327 # Richard's upstream QEMU work ]
Posted v1 of aa32 base isa conversion to decodetree.
Reviewed v5 of the sparc64 invert endian tlb bit patches.
r~
[ACTIVITY] On buildbot and Linux kernel CI duty
- One obscure alias analysis bug that only failed on GCC on AArch64
that suddenly started failing a unit test. Tracked down to an
unitialised variable when API called directly via unit-test. Test has
been reverted, but I've put enough information in a PR for an AA
expert to either fix the test or initialise class member pointer to
nullptr.
- A long review of an LLD patch that changes page-alignment rules and
this has impact on the TLS address. Spent way too long trying to
reverse engineer why the formula used would work, needed to find the
corresponding loader code to find the other side.
- Assertion added to LLVM triggered a failure in Linux kernel build,
reproduced example and forwarded on
- Code size investigation Linaro Connect proposal accepted, now have
to write it.
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ QEMU 4.1 rc2 tagged
+ investigated and sent patches for a problem reported by Mark Rutland
where we still were sometimes putting the initrd on top of the kernel
in our built-in bootloader code
+ spent a couple of days tracking down the cause of LP:1696773, an
intermittent bug when running AArch64 Go programs under QEMU linux-user
mode. This turned out to be an incorrect implementation of 'sigaltstack'
as setting a process-wide signal stack rather than a per-thread one.
+ prompted by a patch from Greensocs fixing a vmstate migration bug
in the pl330 model, improved the vmstate macros to catch that category
of bug; this detected one other bug lurking in a different device.
thanks
-- PMM
== Progress ==
* LLVM 8.0.1 final binaries uploaded
* Use ninja in release job [LLVM-536]
- Patches ready, but waiting for 9.0.0-rc1 so I can test (was
supposed to come out this week but got postponed to Monday)
* Investigate running benchmarks in containers [TCWG-1513]
- Still having trouble, but working on it
* IR SVE reviews [LLVM-545]
- Posted some feedback to D53137
* A bit of fuzzing of GlobalISel CallLowering for AArch32
== Plan ==
* Upcoming vacation: 6 - 13 August
[LLVM-478] Clang and GCC code size comparison
- Looked at CMSIS-DSP, clang consistently produces smaller code than
GCC in contrast to Zephyr. Recorded some specific areas
- Tidied up scripts and build system patches to post for review
- Wrote up a readme for how to reproduce the results
[Misc]
- LLD reviews for reducing image-size using some VA/PA address alignment tricks.
- MC and LLD changes to add MOV[WNZ] relocations.
- Looked into why our container might be giving Resource unavailable
during ninja check-all
Some thoughts on ABI process.
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ QEMU 4.1 rc1 tagged
+ investigating various bugs:
- LP:1836501 (assert using vexpress-a15 board with KVM) : couldn't
reproduce; this reminded me I needed to do a debian upgrade on my
cubietruck devboard, though.
- LP:1830864 (assert using -cpu host,aarch64=off with KVM on a host
kernel older than 4.15): diagnosed problem and sent a patch to fix it
- sent a patch to fix a URL in our configure script which pointed
users at the binary downloads page of the project website when it
wanted the source downloads page
- sent a patch fixing a problem building elf2dmp when libcurl's header
files are in a non-standard location
thanks
-- PMM
== Progress ==
* LLVM 8.0.1 rc4 binaries uploaded
* Buildbot and kernel builds monitoring
- Investigated/reported/fixed a couple of issues
- Tried to reproduce a clang-native-arm-lnt-perf failure that's been
keeping the bot red since the 3rd of July, but it turns out to be very
tricky
* Investigate running benchmarks in containers [TCWG-1513]
- Got quite far with this, but got a bit stuck with a file that
cannot be accessed for reasons that are not clear to me yet
* IR SVE reviews [LLVM-545]
- Looking at Graham's rebased size queries patch
== Plan ==
* Upcoming vacation: 6 - 13 August
Good afternoon,
GDB has a valuable feature consisting of process record and replay. In
fact, GDB can record a log of process execution and save it. This record
can be loaded later on, and used for debugging. This is called offline
debugging. it offers the advantage that you can catch the issue once, and
replay it as much as needed to find the root cause and fix it. this is
extremely valuable for non reproduce-able or hard to reproduce bugs. you
can replay the record either forwards or backwards, which is very convivial
for observing and analyzing the software.
To realize this functionality, GDB is in fact executing the software, one
assembly instruction after another and recording relevant registers and
memory locations. This is a slow operation that can drastically change the
timing of process execution, and thus change the conditions that raise the
bug. To overcome this limitation, GDB can use available SoC IPs to
accelerate the operation. As per today, GDB has support for "Intel
Processor Trace" and " Branch Trace Store" IP on Intel processors.
ARM based SoCs have also IPs that can be used to assist process record,
namely CoreSight trace sources (ETM, PTM ..), trace links ( Funnels ...)
and trace sinks (ETB, ETR, TPIU...). They are now supported in Linux
kernel, through corresponding drivers and the extension of perf. A library
for decoding ETM traces (OpenCSD) is also available. The way is now paved
to bring acceleration of process record for ARM based SoC to GDB.
I am re-sending RFC and making it available as basis for discussions for
implementing this feature. it is also attached as text file
B.R.
Zied Guermazi
Non intrusive execution recording
for GDB using ARM CoreSight
Status of this Memo
This memo provides information for Linaro coresight and toolchain
communities.
Distribution of this memo is unlimited.
Abstract
A method of realizing execution recording in GDB in a non-intrusive way.
This method is based on the use of CoreSight hardware tracing, available on
ARM Cortex devices.
Table of Contents
1 Introduction
2 State of the art
3 Use cases
3.1 Self hosted debug monitor
3.2 Remote debug monitor
3.3 External debugger
4 Implementation needs
4.1 Self hosted debug monitor
4.2 Remote Debug monitor
4.3 External debugger
5 Remote protocol execution sequence
6 Remote protocol extensions
7 Solutions and alternatives .
7.1 Scope definition
7.2 CoreSight infrastructure exposure to the user
7.3 Parameters needed for parsing traces
1. Introduction
CoreSight technology offers a toolset for tracing the execution of a
program on a CPU, as well as routing the traces to an external trace port
analyzer or storing it in a dedicated internal memory. Those traces do not
affects system performance, and can be used as a record for program
execution.
GDB offers reverse debugging by recording program execution and storing
it. GDB offers either full record or program flow (branch) record. Records
can be replayed later-on for forwards or backwards debugging.
This request for comments is about realizing GDB record and replay
functionality using CoreSight technology. it presents typical use cases
and discuss different alternatives for realizing above mentioned feature.
2. State of the art
GDB currently supports two execution recording variants:
- full record: where registers as well as memory are recorded for each
instruction. in this case GDB collects the registers as well as involved
memory area after each instruction. currently this has no support for
hardware accelerators
- branch record: where only program flow is recorded. In this case GDB
collects program execution flow. currently branch record is implemented
either with or without hardware acceleration by using Intel branch trace
store "bts" and Intel processor trace "pt" hardware accelerator on
supported cpus.
3. Use cases
Programs running on ARM processors can be be debugged in many
configurations. three of them are selected in this RFC as base for
discussion :
3.1. Self hosted debug monitor
Those are systems where the debugger program runs on the same cpu as the
debugged program and monitors it. user interacts with the debugging session
on the target host itself.
Linux GDB is an example of such systems. in such a system following
setup is considered
- Target: a process running on an ARM cortex A
- Debugger: gnu GDB via ptrace API (arm-linux-gnueabihf-gdb)
+-----------------------------------+
| Target |
| +------------+ |
| +------+ | Coresight | |
| | | | components:| |
| | GDB |<--------->| | |
| | | ^ | DWT, ETM, | |
| +------+ | | ITM, TPIU | |
| ^ | | TMC, ETB | |
| | | +------------+ |
+----|---------|--------------------+
| |
| |
arm-linux- |
gnueabihf- |
gdb |
debug: ptrace
trace: perf/CoreSight drivers
3.2. Remote debug monitor
Those are systems where the debugger program runs on the same cpu as the
debugged program and monitors it. user interacts with the debugging session
remotely from a PC
Linux GDB is an example of such systems. in such a system following
setup is considered
- Target: a process running on an ARM cortex A
- GDB server: gnu gdbserver (arm-linux-gnueabihf-gdbserver)
- GDB client: gnu GDB (arm-linux-gnueabihf-gdb)
- UI: eclipse with needed plugins, MI interface is used.
+--------------------------+ +---------------------------------------+
| Host | | Target |
| | | +------------+ |
| +-----+ +------+ | | +------+ | Coresight | |
| | | | GDB | | | | GDB | | components:| |
| | UI |<--->| |<--->|<--->|<--->| |<--------->| | |
| | | ^ |Client| ^ | ^ | |Server| ^ | DWT, ETM, | |
| +-----+ | +------+ | | | | +------+ | | ITM, TPIU | |
| ^ | ^ | | | | ^ | | TMC, ETB | |
| | | | | | | | | | +------------+ |
+----|-----|-----|------|--+ | +--------|---------|--------------------+
| | | | | | |
| | | | | | |
Eclipse | arm-linux- | | arm-linux- |
| gnueabihf- | TCP/IP gnueabihf- |
| gdb | UART gdbserver |
GDB MI GDB remote debug: ptrace
protocol trace: perf/CoreSight drivers
3.3. External debugger
Those are systems where an external debugger is used. It accesses the
target using JTAG or SWD. Target is usually a bare metal embedded systems
or systems with an rtos.
as an example, following setup is considered:
- Target: firmware running on ARM cortex M.
- Debugger: external debug and trace device.
- GDB server: OpenOcd.
- GDB Client: arm-none-eabi-gdb.
- UI: eclipse with needed plugins, MI interface is used.
+--------------------------------------+ +-------+ +-------------+
| Host | | dbggr | | Target |
| | | | | |
| +-----+ +------+ +------+ | | | | Coresight |
| | | | GDB | | GDB | | | Debug | | components: |
| | UI |<--->| |<--->| |<-->|<--->| + |<--->| |
| | | ^ |Client| ^ |Server| | ^ | Trace | ^ | DWT, ETM, |
| +-----+ | +------+ | +------+ | | | | | | ITM, TPIU |
| ^ | ^ | ^ | | | | | | |
| | | | | | | | | | | | |
+----|-----|-----|------|-----|--------+ | +-------+ | +-------------+
| | | | | | |
| | | | | | |
Eclipse | arm-none- | OpenOcd | |
| eabi-gdb | PyOcd | |
| | | |
GDB MI GDB remote Ethernet debug: JTAG/SWD
protocol USB trace: Serial/Parallel
4. Implementation needs
4.1 Self hosted debug monitor
GDB : arm-linux-gnueabihf-gdb
the interface defined in btrace.h for capturing and processing traces
has to be implemented for arm CoreSight.
needed actions:
- in btrace-common.h: add needed structures for capturing and
handling etm traces
- in linux-btrace.h:
- add btrace_tinfo_etm
- amend btrace_target_info
- in linux-btrace.c: change following functions to support etm
traces
- linux_enable_btrace
- linux_disable_btrace
- linux_read_btrace
- linux_btrace_conf
- in arm-linux-nat.c:add an api to
- configure btrace
- enable btrace
- disable btrace
- read btrace
- in btrace.c
- btrace_add_pc btrace_fetch has to be implemented for
Coresight this means using opencsd library to parse etms and then
reconstruct executed instructions accordingly (btrace_compute_ftrace_1)
- in record-btrace.c
- add command for showing record btrace etm options
- add command for starting tracing with CoreSight and its
handler (cmd_record_btrace_etm_start)
- adapt cmd_show_record_btrace_cpu
...
perf:
needed actions:
- make sure that perf can start/stop tracing a process with its
threads, collect etm traces and deliver them to the user
4.2 Remote Debug monitor
changes described in 7.1 are needed. in addition, and to support remote
protocol following changes are needed
GDB server: arm-linux-gnueabihf-gdbserver
needed actions:
- in linux-low
- linux_low_read_btrace: add support for etm traces formatting.
- linux_low_btrace_conf: :add support for etm configuration
formatting.
GDB client: arm-linux-gnueabihf-gdb
needed actions:
- in remote.c
- adapt enable_btrace
- adapt disable_btrace
- in btrace.c
- parse_xml_btrace: update btrace.dtd [2] and related data
structures btrace_xxx
- parse_xml_btrace_conf: update btrace-conf.dtd [3] and related
data structures btrace_conf_xxx
- extend Remote protocol handling to support coresight etm traces
UI: eclipse
needed actions
make sure that the plugin for recoding execution and replaying it
is coping well in case of arm-linux
Remote protocol needs to be extended by
-1- Adding Qbtrace:CoreSight (or etm) to start collecting etm traces
-2- Amending 'Branch Trace Format' xml specification to consider etm
traces transfer
-3- Amending 'Branch Trace Configuration Format' xml specification to
consider parameters needed for etm
4.3 External debugger
changes described in 7.2 are needed. in addition, and to support tracing
a remote dealing with an external debugger (bare metal embedded system)
following changes are needed
GDB server: OpenOcd
needed actions:
- rework etm driver to make it up to date.
- add a driver for configuring trace interconnect IPs
- rework the driver for TPIU.
- integrate support for a Trace port analyzer.
- extend remote protocol implementation to support recording
Coresight infrastructure of the SoC is to be set in OpenOcd through
configuration files. Parameters that are not relevant for GDB are also
specified in configuration files (trace sink, trace protocol, port size,
trace synch frequency, cycle accurate tracing etc ...)
GDB client: arm-none-eabi-gdb
needed actions:
- extend Remote protocol to support coresight etm traces
- integrate etm trace parsing library
- interface the parser to record_btrace_target
Remote protocol needs -in addition to 7.2- to be extended by
- Adding Qbtrace-conf:CoreSight:core=value to support multicore SoC
- Adding btrace-conf:CoreSight:id=value to support demultiplexing
multiple trace sources
- Adding Qbtrace-conf:CoreSight:filter:context=value to support
filtering traces belonging to a given process/thread
- Adding Qbtrace-conf:CoreSight:filter:start-address=value
and Qbtrace-conf:CoreSight:filter:end-address=value to
support filtering traces for given functions/blocks/lib
- Adding Qbtrace-conf:CoreSight:trigger:on-address=value
and Qbtrace-conf:CoreSight:trigger:off-address=value to
support triggering tracing or stop tracing if a certain function/block/lib
is executed
alternatively some of configurations related to filtering and
triggering can be delegated to the GDB server.
UI: eclipse
test and verify that existing plugins cope well with GDB extensions
5. Remote protocol execution sequence
GDB and gdbserver are communicating using the GDB remote protocol.
on a semantic level a tracing session runs though following sequence
(1) GDB client queries gdb server support for branch trace
(2) GDB server answers with
- qXfer:btrace:read
- qXfer:btrace-conf:read
- Qbtrace:off
- Qbtrace:CoreSight
- Qbtrace-conf:CoreSight:xxx where xxx is the parameter name
(3) GDB client sends command to let start emitting and collecting
traces (Qbtrace:CoreSight)
(4) GDB server executes the commands
(5) GDB client sends command to stop emitting and collecting traces
(Qbtrace:off)
(6) GDB server exectues the command
(7) GDB client sends command to get collected traces from trace sink
(qXfer:btrace:read:annex:offset,length)
(8) GDB server executes the command and sends back collected traces
(9) GDB client parses the traces and reconstructs target states
6. Remote protocol extensions
the remote protocol needs be extended with following primitives to
support CoreSight tracing
- start tracing and traces capture using CoreSight (Qbtrace:CoreSight)
the remote protocol can be extended with following primitives to take
advantages of etm functionalities.
- select the core to trace on in the case of a multicore system
GDB client sends command to select the core to trace
(Qbtrace-conf:CoreSight:core=value)
- set the trace id for the traces
GDB client sends command to set trace id
(Qbtrace-conf:CoreSight:id=value)
- select the context to trace
GDB client sends command to select the context to trace
(Qbtrace-conf:CoreSight:filter:context=value)
- select the address range to trace
GDB client sends command to select the address range to trace
(Qbtrace-conf:CoreSight:filter:start-address=value)
(Qbtrace-conf:CoreSight:filter:end-address=value)
- set triggers for starting and stopping tracing
GDB client sends command to select the address to trigger tracing
(Qbtrace-conf:CoreSight:trigger:on-address=value)
(Qbtrace-conf:CoreSight:trigger:off-address=value)
7. alternatives and discussions
7.1. Scope definition
Coresight ETM IP comes in many versions and many implementations.
According to its capabilities, it can trace instructions only or
instructions and involved data/data address. All ETMs variants support
instructions tracing and can therefore be used for for branch tracing.
7.2. CoreSight infrastructure exposure to the user
it is here about assigning the responsibility of configuring Coresight
infrastructure to generate and route traces. two alternatives are possible:
- coresight infrastructure exposed to GDB client (and UI):
in this alternative the user or the UI is responsible for
configuring coresight IPs in the SoC, by accessing their registers
directly or via coresigh driver. Remote protocol is used to configure trace
sink (ETB or TPA) to start/stop collecting traces
- coresight infrastructure is not exposed outside of gdbserver.
in this case high level commands can be provided by gdbserver
remote protocol to setup and configure coresight IPs in the SoC.
My recommendation is to extend remote protocol to provide high level
commands to setup and configure coresight IPs in the SoC, or to use a
different channel to pass configuration parameters to GDB server
7.3. Parameters needed for parsing traces
Some configuration parameters like etm version, trace id ... (content of
registers ETMCR, ETMIDR, ETMCCER, ETMTRACEIDR) are needed for extracting
and parsing etm trace, those parameters needs to be exchanged between GDB
server and client. following alternatives are possible:
- extend the remote protocol to get those params with explicit queries
- add them to the content of the response to qXfer:btrace-conf:read
- add them to the content of the response to qXfer:btrace:read
[VIRT-263 # ARMv8.1-VHE Virtual Host Extensions ]
Got to "kvm enabled with vhe" kernel message, but then
the kernel hangs there. Irritatingly works with the
kernel I built myself, but not a distro supplied kernel.
Need to track down the config difference so I can continue
using gdbstub.
[VIRT-344 # ARMv8.5-MemTag, Memory Tagging Extension ]
Regenerated an mte+linux-user branch for Google engineers
to use to develop llvm. This is code previously posted,
but my current branch striped out linux-user for ease of
review of the system code.
[VIRT-327 # Richard's upstream QEMU work ]
Fixed mmap assert, signal handler method.
Fixed constant folding of extract2.
Fixed aarch64 host output of extract2.
Posted pull request for those.
Started reviewing the GSoC risugen patches, v3 for avx.
r~
== This Week ==
* PR90723
- Committed fix to trunk in r273466.
* PR90724
- Posted patch upstream, waiting for feedback.
* Validation
- SPEC2k6 with SVE seems to compile, but spotted couple of infra issues.
- Sent abe patch to store sum files.
* Misc
- Meetings
== Progress ==
* GCC:
- FDPIC: received feedback on generic patches, will address after holidays
- noinit attribute: iterated on generic attribute patch, not approved yet
* GNU-583 (Fix Linux kernel built for Thumb-2 with GCC using LTO)
- no progress this week
* GCC upstream validation:
- reported a few regressions.
* Binutils:
- Non-contiguous memory regions support in the BFD linker: proposal
looks OK, will start implementation after holidays
* misc:
- infra fixes / troubleshooting
- reported several regressions in QEMU, promptly fixed by our awesome
team members
== Next ==
GCC:
- handle feedback on FDPIC and noinit patches
- binutils/linker support for non-contiguous memory regions
- GNU-583
- GCC upstream validation: Add a config for cortex-m33 (v8-m)
== Holidays ==
July 13-27
Aug 2-11
QEMU Tooling ([VIRT-252])
=========================
QEMU plugin support ([VIRT-280])
- posted {PATCH for semihosting-tests} semihosting tests: add v7m
tests Message-Id: <20190711135726.14191-1-alex.bennee(a)linaro.org>
- semihosting re-factor now in v4 branch
- cleaned up translator_ld stuff for arm
- posted {PATCH for 4.1?} includes: remove stale {smp|max}_cpus
externs Message-Id: <20190711130546.18578-1-alex.bennee(a)linaro.org>
- fixed up code needing smp/max_cpus
[VIRT-280] https://projects.linaro.org/browse/VIRT-280
[v4 branch] https://github.com/stsquad/qemu/tree/plugins/plugins-v4
GSoC Mentoring ([VIRT-348])
- starting to look quite workable
- looks like chunks of CONFIG_PROFILER can be made runtime
select-able
Upstream Work ([VIRT-109])
==========================
- more regression hunting for 4.1 release
- looked at bugs [1834496] and [1836078]
- posted {PATCH v2 for 4.1} target/arm: report ARMv8-A FP support
for AArch32 -cpu max Message-Id:
<20190711103737.10017-1-alex.bennee(a)linaro.org>
- rth and pm215 also posted various fixes
- ieee_6 test looks like a [fortran/gcc runtime issue]
- posted {PATCH for 4.1? v1 0/7} testing/next (docker, win-cross)
Message-Id: <20190712111849.9006-1-alex.bennee(a)linaro.org>
[VIRT-109] https://projects.linaro.org/browse/VIRT-109
[1834496] https://bugs.launchpad.net/bugs/1834496
[1836078] https://bugs.launchpad.net/bugs/1836078
[fortran/gcc runtime issue]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78314
Completed Reviews [5/5]
=======================
{PATCH 0/5} tcg: Fix mmap_lock assertion failure, take 2
Message-Id: <87zhlned2x.fsf(a)zen.linaroharston>
{PATCH for-4.1} target/arm: Set VFP-related MVFR0 fields for arm926 and arm1026
Message-Id: <20190711121231.3601-1-peter.maydell(a)linaro.org>
{PATCH for-4.1 0/2} Compatibility fixes for nettle 2.7 vs 3.0 vs 3.5
Message-Id: <20190712101849.8993-3-berrange(a)redhat.com>
{PATCH v2 0/5} tests/docker: add podman support
Message-Id: <20190709194330.837-1-marcandre.lureau(a)redhat.com>
- CLOSING NOTE [2019-07-12 Fri 18:07]
Looks ok - need to get a podman system up for testing
{RISU PATCH v3 00/18} Support for generating x86 SIMD test images
Message-Id: <20190711223300.6061-5-jan.bobek(a)gmail.com>
Absences
========
- 18-19th July
Current Review Queue
====================
* {PATCH 0/2} tests/acceptance: Add test of NeXTcube framebuffer using OCR
Message-Id: <20190629150056.9071-1-f4bug(a)amsat.org>
* {Qemu-devel} {PATCH 0/4} Introduce the microvm machine type
Message-Id: <20190628115349.60293-1-slp(a)redhat.com>
* {PATCH 0/3} tests/acceptance: Add tests for the Leon3 board
Message-Id: <20190627115331.2373-1-f4bug(a)amsat.org>
* {PATCH 0/5} tests/acceptance: Add bFLT loader linux-user test
Message-Id: <20190625101524.13447-1-philmd(a)redhat.com>
* {PATCH v2 0/9} KVM: arm/arm64: vgic: ITS translation cache
Message-Id: <20190611170336.121706-1-marc.zyngier(a)arm.com>
* {Qemu-devel} {RFC PATCH 0/7} Proof of concept for Meson integration
Message-Id: <1560165301-39026-1-git-send-email-pbonzini(a)redhat.com>
--
Alex Bennée
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ QEMU 4.1 rc0 sent out of the door
+ investigated and sent fix for a regression with arm926 and arm1020
emulation: we accidentally turned off VFP double-precision support
on these cores with the recent VFP refactoring
+ helped track down a booting failure Beata ran into on aarch64 hosts
to a regression in the TCG backend, which RTH has now sent a patch for
+ sent a cleanup for some dead code spotted by Coverity in the imx6ul SoC
thanks
-- PMM
== Progress ==
* Investigate running benchmarks in containers [TCWG-1513]
- Faffing about with our benchmarking scripts, not sure how to test
changes without disrupting our infrastructure
- Cooked up some viz scripts so I can easily look at the noise
levels in benchmark results with/without containers
* Started LLVM 8.0.1 rc4 build
- In progress on ARM, infrastructure issues on AArch64
== Plan ==
* Upcoming vacation: 6 - 13 August
[LLVM-583] LLVM Code Size reduction ideas from Zephyr and CMSIS
- Started a ticket to record areas of improvement where GCC does
better than LLVM.
- Upstream defaults to -mno-unaligned-access for clang which needs to
be corrected for.
- Much of the difference goes away when inlining is disabled, implying
that different inlining strategies could be most significant
difference.
- Sent in Linaro Connect presentation submission to cover all of TCWGs
code-size improvement work.
Planned absences
- Rest of this week, back in the office on the 15th July
[Code size investigation]
Results (clang 2% larger than gcc) replicated on cortex-m0 and
cortex-m4 on Zephyr.
- Clang optimisation to use BLX rather than BL when same function
called multiple times is a pessimisation on Zephyr, especially on M0.
- GCC register allocation seems to result in fewer spills
TODO: Get an estimate of how much code-size difference is down to
different inlining decisions.
On CMSIS DSP cortex-m4f clang appears to be producing smaller than
GCC, not measured averages yet.
[LLD]
- Quite a few upstream reviews, PRs and investigations surrounding them.
- Likely that LLD will be converting to the new variable naming convention.
- Received a request to add cortex-a8 erratum fix for Google Android team.
[Linaro Connect]
Registered and contacted travel.
Drafted a submission for presentation, will submit next week.
Planned Absences:
On holiday Wednesday, Thursday, Friday next week
Progress:
* VIRT-65 [QEMU upstream maintainership]
+ catching up with email and code review -- managed to get some
series reviewed in time for softfreeze on Tuesday, notably the
'sbsa-ref' reference platform model that Hongbo Zhang was working on
+ a lot of release-herding, working through the huge pile of pull
requests that need merging
+ fixed a silly bug in recent VFP refactoring, spotted by coverity
+ fixed a memory leak that broke our CI sanitizer build (not a new
piece of code, but we currently only sanitize the x86-64 targets
and a recent change meant this old code is now used on x86-64 for
the ATI PCI display device model)
* Misc:
+ first KVM Forum Programme Committee meeting (and attendant
review of all the submitted abstracts; bumper crop this year)
thanks
-- PMM
== Progress ==
* GCC:
- FDPIC: No progress, still waiting for feedback
- noinit attribute: reviewers asked to make it a generic attribute,
rather than target-specific. New patch sent.
* GNU-583 (Fix Linux kernel built for Thumb-2 with GCC using LTO)
- no progress this week
* GCC upstream validation:
- reported a few regressions.
* Binutils:
- PR24709 (linker crash and assertion failure with CMSE). Use case not
considered worth the headache of supporting correctly CSME+long-branch
stubs (tricky to get right). Replaced the linker crash with a user
error message.
- Non-contiguous memory regions support in the BFD linker: Received a
good summary of the consensus reached in 2017.
* misc:
- infra fixes / troubleshooting
== Next ==
GCC:
- handle feedback on FDPIC and noinit patches
- binutils/linker support for non-contiguous memory regions
- GNU-583
- GCC upstream validation: Add a config for cortex-m33 (v8-m)
== Holidays ==
July 13-27
Aug 2-11
== This Week ==
* PR88833
- Fixed pending issues with x86 and committed fix to trunk
* PR90723
- Issue seems to be infinite recursion overflowing the stack, investigating.
* Misc
- Meetings
== Next Week ==
- PR90723
- Add testsuite comparison to tcwg_gnu
== Progress ==
* LLVM SPEC2k6 Performance Analysis [LLVM-134]
- Still working around perf version mismatches, going to investigate
if we can use a newer version of perf to collect data
- Had a look at the assembly for sphinx from gcc-6, clang-3.9.1 and
clang-8.0.0, but going to wait for better perf before I rush to
conclusions
* IR SVE Reviews [ LLVM-545]
- Had a look at the clang patches, gave some feedback for one of
them; the other ones are very subtle and best left to the clang
maintainers
* [GlobalISel] Refactor CallLowering [LLVM-568]
- Fixed a little ASAN snag, should be done for good now
* Trying to get up an ABI fuzzer for GlobalISel
== Plan ==
* Update benchmarking infrastructure (in support of LLVM-134)
* Deprioritize GlobalISel
* Upcoming vacation: 6 - 13 August
Short week; 3 days.
[VIRT-263 # ARMv8.1-VHE Virtual Host Extensions ]
Fixed 3 bugs:
* SVE length calculation,
* PNX bit while in EL2&0 regime,
* Interrupt routing w/ TGE bit.
A bare 5.2 kernel boots to root file system not found.
A 4.19 kernel hangs during boot somewhere.
Now doing a fedora30 install, which I believe has a 5.x kernel...
[VIRT-327 # Richard's upstream QEMU work ]
Patch review:
* GSoC x86 risugen,
* arm semihost cleanups.
r~
== This Week ==
* PR88833 (6/10)
- Patch approved by Richard.
- Regresses pr88152.C due to a possibly latent issue with combine.
* PR90722 (3/10)
- Investigating the issue
* Misc (1/10)
- Meetings
o LLVM:
* 8.0.1-rc3: Built ARM Binaries, AArch64 on-going.
* Machine Outliner:
- Uncovered issues in stack fixup handling, working on a fix.
o Misc
* Various meetings and discussions.