Skip to content

Commit

Permalink
dump: allow target to set the physical base
Browse files Browse the repository at this point in the history
crash assumes the physical base in the kdump subheader of
makedumpfile formatted dumps is correct. Zero is not correct
for all architectures, so allow it to be changed.

(No functional change.)

Signed-off-by: Andrew Jones <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
Andrew Jones authored and pm215 committed Jan 15, 2016
1 parent 8161bef commit b6e05aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ static void create_header32(DumpState *s, Error **errp)

/* 64bit max_mapnr_64 */
kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
kh->phys_base = cpu_to_dump32(s, PHYS_BASE);
kh->phys_base = cpu_to_dump32(s, s->dump_info.phys_base);
kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);

offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
Expand Down Expand Up @@ -875,7 +875,7 @@ static void create_header64(DumpState *s, Error **errp)

/* 64bit max_mapnr_64 */
kh->max_mapnr_64 = cpu_to_dump64(s, s->max_mapnr);
kh->phys_base = cpu_to_dump64(s, PHYS_BASE);
kh->phys_base = cpu_to_dump64(s, s->dump_info.phys_base);
kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);

offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
Expand Down
1 change: 1 addition & 0 deletions include/sysemu/dump-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ typedef struct ArchDumpInfo {
int d_class; /* ELFCLASS32 or ELFCLASS64 */
uint32_t page_size; /* The target's page size. If it's variable and
* unknown, then this should be the maximum. */
uint64_t phys_base; /* The target's physmem base. */
} ArchDumpInfo;

struct GuestPhysBlockList; /* memory_mapping.h */
Expand Down
1 change: 0 additions & 1 deletion include/sysemu/dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#define KDUMP_SIGNATURE "KDUMP "
#define SIG_LEN (sizeof(KDUMP_SIGNATURE) - 1)
#define PHYS_BASE (0)
#define DUMP_LEVEL (1)
#define DISKDUMP_HEADER_BLOCKS (1)

Expand Down

0 comments on commit b6e05aa

Please sign in to comment.