Fix for gem5 Issue #550 (#636)

This Pull-Request addresses gem5 Issue #550. The code that dumps the
Dmesg buffer is now templated on the two variants of the `Metadata`
structure, and the correct one is chosen based on the detected Kernel
version.

To support this functionality, the pull request also adds Symbol Size
data to the loader Symbol Table, and adds a method to query the Kernel
Version from the image in guest memory. The new attributes in the Symbol
class are de-serialized speculatively, so no checkpoint upgrader is
required to support this change.
This commit is contained in:
Bobby R. Bruce
2023-12-01 18:06:20 -08:00
committed by GitHub
17 changed files with 409 additions and 147 deletions

View File

@@ -66,8 +66,8 @@ KernelWorkload::KernelWorkload(const Params &p) : Workload(p),
kernelSymtab = kernelObj->symtab();
auto initKernelSymtab = kernelSymtab.mask(_loadAddrMask)
->offset(_loadAddrOffset)
->rename([](std::string &name) {
name = "kernel_init." + name;
->rename([](const std::string &name) {
return "kernel_init." + name;
});
loader::debugSymbolTable.insert(*initKernelSymtab);

View File

@@ -141,7 +141,7 @@ class Workload : public SimObject
if (it == symtab.end())
return nullptr;
return new T(system, desc, fixFuncEventAddr(it->address),
return new T(system, desc, fixFuncEventAddr(it->address()),
std::forward<Args>(args)...);
}