linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Will Deacon <will@kernel.org>,
	Luis Machado <luis.machado@linaro.org>,
	John Baldwin <jhb@FreeBSD.org>, Arnd Bergmann <arnd@arndb.de>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH v2 5/5] arm64: mte: Document the core dump file format
Date: Mon, 31 Jan 2022 16:54:56 +0000	[thread overview]
Message-ID: <20220131165456.2160675-6-catalin.marinas@arm.com> (raw)
In-Reply-To: <20220131165456.2160675-1-catalin.marinas@arm.com>

Add the program header definition and data layout for the
PT_ARM_MEMTAG_MTE segments.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Luis Machado <luis.machado@linaro.org>
---
 .../arm64/memory-tagging-extension.rst        | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/Documentation/arm64/memory-tagging-extension.rst b/Documentation/arm64/memory-tagging-extension.rst
index 7b99c8f428eb..5a70d7a3ca12 100644
--- a/Documentation/arm64/memory-tagging-extension.rst
+++ b/Documentation/arm64/memory-tagging-extension.rst
@@ -213,6 +213,29 @@ address ABI control and MTE configuration of a process as per the
 Documentation/arm64/tagged-address-abi.rst and above. The corresponding
 ``regset`` is 1 element of 8 bytes (``sizeof(long))``).
 
+Core dump support
+-----------------
+
+The allocation tags for user memory mapped with ``PROT_MTE`` are dumped
+in the core file as additional ``PT_ARM_MEMTAG_MTE`` segments. The
+program header for such segment is defined as:
+
+:``p_type``: ``PT_ARM_MEMTAG_MTE``
+:``p_flags``: 0
+:``p_offset``: segment file offset
+:``p_vaddr``: segment virtual address, same as the corresponding
+  ``PT_LOAD`` segment
+:``p_paddr``: 0
+:``p_filesz``: segment size in file, calculated as ``p_mem_sz / 32``
+  (two 4-bit tags cover 32 bytes of memory)
+:``p_memsz``: segment size in memory, same as the corresponding
+  ``PT_LOAD`` segment
+:``p_align``: 0
+
+The tags are stored in the core file at ``p_offset`` as two 4-bit tags
+in a byte. With the tag granule of 16 bytes, a 4K page requires 128
+bytes in the core file.
+
 Example of correct usage
 ========================
 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-01-31 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 16:54 [PATCH v2 0/5] arm64: mte: add core dump support Catalin Marinas
2022-01-31 16:54 ` [PATCH v2 1/5] elfcore: Replace CONFIG_{IA64, UML} checks with a new option Catalin Marinas
2022-02-15 17:39   ` [PATCH v2 1/5] elfcore: Replace CONFIG_{IA64,UML} " Will Deacon
2022-01-31 16:54 ` [PATCH v2 2/5] elf: Introduce the ARM MTE ELF segment type Catalin Marinas
2022-01-31 16:54 ` [PATCH v2 3/5] arm64: mte: Define the number of bytes for storing the tags in a page Catalin Marinas
2022-01-31 16:54 ` [PATCH v2 4/5] arm64: mte: Dump the MTE tags in the core file Catalin Marinas
2022-02-02 17:55   ` Mark Brown
2022-01-31 16:54 ` Catalin Marinas [this message]
2022-02-15 23:18 ` [PATCH v2 0/5] arm64: mte: add core dump support Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220131165456.2160675-6-catalin.marinas@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=ebiederm@xmission.com \
    --cc=jhb@FreeBSD.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=luis.machado@linaro.org \
    --cc=szabolcs.nagy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).