qemu-s390x
[Top][All Lists]
Advanced

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

Re: [PATCH v2 03/11] dump: Split write of section headers and data and a


From: Janosch Frank
Subject: Re: [PATCH v2 03/11] dump: Split write of section headers and data and add a prepare step
Date: Thu, 14 Jul 2022 13:45:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

On 7/13/22 17:31, Marc-André Lureau wrote:
Hi

On Wed, Jul 13, 2022 at 5:07 PM Janosch Frank <frankja@linux.ibm.com> wrote:

By splitting the writing of the section headers and (future) section
data we prepare for the addition of a string table section and
architecture sections.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---

[...]

@@ -557,12 +600,22 @@ static void dump_begin(DumpState *s, Error **errp)
      /* Write elf header to buffer */
      prepare_elf_header(s);

+    prepare_elf_sections(s, errp);
+    if (*errp) {
+        return;
+    }
+
      /* Start to write stuff into files*/
      write_elf_header(s, errp);
      if (*errp) {
          return;
      }

+    write_elf_section_headers(s, errp);

Why do you reorder the sections? Could you explain in the commit
message why? Is this is format compliant? and update the comment
above? thanks


Having the section data at the end of the file is unfortunately a s390 PV requirement since we can only grab the encrypted page tweaks and counts *after* all of the memory has been encrypted.

The sections are the most obvious way to add such data to the file since they are basically unused right now and we're able to write a string table at the very end after everyone registered their strings.

All of this is ELF compliant AFAIK, that's why elf specifies offsets of the headers and the data. From what I see only the main elf header needs to start at offset 0.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]