mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdump/df_vmdump: Rename vmd_asibk_64_new structure to vmd_asizbk
Rename vmd_asibk_64_new structure to vmd_asizbk to be in sync with CP notations: https://www.vm.ibm.com/pubs/cp730/ASIBK.HTML Add ASIZBK magic number constant and magic number verification step. Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Acked-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
f23c207622
commit
e2ee24b3ac
@@ -38,6 +38,7 @@ const u8 ADSR_MAGIC[2] = { 0xe2, 0xd9 }; /* 'SR' EBCDIC */
|
||||
const u8 VMDUMP_MAGIC[8] = { 0xe5, 0xd4, 0xc4, 0xe4, 0xd4, 0xd7, 0x40, 0x40 }; /* 'VMDUMP ' EBCDIC */
|
||||
const u8 FMBK_MAGIC[8] = { 0xc8, 0xc3, 0xd7, 0xc4, 0xc6, 0xd4, 0xc2, 0xd2 }; /* 'HCPDFMBK' EBCDIC */
|
||||
const u8 ALBK_MAGIC[8] = { 0xc8, 0xc3, 0xd7, 0xc4, 0xc1, 0xd3, 0xc2, 0xd2 }; /* 'HCPDALBK' EBCDIC */
|
||||
const u8 ASIZBK_MAGIC[8] = { 0xc1, 0xe2, 0xc9, 0xe9, 0xc2, 0xd2, 0x40, 0x40 };/* 'ASIZBK ' EBCDIC */
|
||||
|
||||
/*
|
||||
* Layout of dump symptom record . The ADSR is always the first record in
|
||||
@@ -110,12 +111,12 @@ struct vmd_oltble {
|
||||
u64 end_addr;
|
||||
} __packed;
|
||||
|
||||
struct vmd_asibk_64_new {
|
||||
u8 id[8];
|
||||
struct vmd_asizbk {
|
||||
u8 id[sizeof(ASIZBK_MAGIC)];
|
||||
u8 as_token[8];
|
||||
u8 spaceid[33];
|
||||
u8 reserved1[2];
|
||||
u8 asibk_format;
|
||||
u8 asizbk_format;
|
||||
u8 reserved2[12];
|
||||
u64 storage_size_with_dcss;
|
||||
u64 storage_size_def_store;
|
||||
@@ -204,6 +205,6 @@ struct vmd_fir_other_64 {
|
||||
|
||||
#define DF_VMDUMP_HDR_SIZE \
|
||||
(sizeof(struct vmd_adsr) + sizeof(struct vmd_fmbk) + sizeof(struct vmd_fir_basic) + \
|
||||
sizeof(struct vmd_albk) + sizeof(struct vmd_asibk_64_new) + sizeof(struct vmd_fir_64))
|
||||
sizeof(struct vmd_albk) + sizeof(struct vmd_asizbk) + sizeof(struct vmd_fir_64))
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@ static struct {
|
||||
struct vmd_fir_basic fir_basic; /* Dump file info record */
|
||||
struct vmd_albk albk; /* Dump access list record */
|
||||
|
||||
struct vmd_asibk_64_new asibk_new;
|
||||
struct vmd_asizbk asizbk;
|
||||
struct vmd_fir_64 fir;
|
||||
struct vmd_fir_other_64 *fir_other;
|
||||
|
||||
@@ -81,7 +81,7 @@ static void vmdump64big_debug(void)
|
||||
util_log_print(UTIL_LOG_DEBUG, "Bit-Key Pages: %lu\n", l.bitkey_pages_count);
|
||||
util_log_print(UTIL_LOG_DEBUG, "Memory Offset: %#lx\n", l.memory_start_record);
|
||||
util_log_print(UTIL_LOG_DEBUG, "Total Pages : %lu\n",
|
||||
l.asibk_new.storage_size_def_store / PAGE_SIZE);
|
||||
l.asizbk.storage_size_def_store / PAGE_SIZE);
|
||||
util_log_print(UTIL_LOG_DEBUG, "Stored Pages : %lu\n", l.stored_pages_count);
|
||||
|
||||
/* adsr */
|
||||
@@ -185,9 +185,11 @@ static void vmdump64big_init(void)
|
||||
zg_seek(g.fh, (l.fmbk.rec_nr_access - 1) * PAGE_SIZE, SEEK_SET);
|
||||
zg_read(g.fh, &l.albk, sizeof(l.albk), SEEK_SET);
|
||||
|
||||
/* Record 9: asibk */
|
||||
/* Record 9: asizbk */
|
||||
zg_seek(g.fh, l.fmbk.rec_nr_access * PAGE_SIZE, ZG_CHECK);
|
||||
zg_read(g.fh, &l.asibk_new, sizeof(l.asibk_new), ZG_CHECK);
|
||||
zg_read(g.fh, &l.asizbk, sizeof(l.asizbk), ZG_CHECK);
|
||||
if (memcmp(l.asizbk.id, ASIZBK_MAGIC, sizeof(l.asizbk.id)))
|
||||
ERR_EXIT("Dump file inconsistent, invalid ASIZBK record detected");
|
||||
|
||||
l.memory_start_record = (l.fmbk.rec_nr_access + 1) * PAGE_SIZE;
|
||||
|
||||
@@ -195,8 +197,8 @@ static void vmdump64big_init(void)
|
||||
* Record 10: bitmaps:
|
||||
* Read all bitmap pages and setup bitmap array
|
||||
*/
|
||||
nr_dumped_pages = l.asibk_new.storage_size_def_store / PAGE_SIZE;
|
||||
bitmap_sz = l.asibk_new.storage_size_def_store / (PAGE_SIZE * 8);
|
||||
nr_dumped_pages = l.asizbk.storage_size_def_store / PAGE_SIZE;
|
||||
bitmap_sz = l.asizbk.storage_size_def_store / (PAGE_SIZE * 8);
|
||||
if (!bitmap_sz)
|
||||
ERR_EXIT("Dump file inconsistent, no bitmap detected");
|
||||
l.bitmap = util_zalloc(bitmap_sz);
|
||||
@@ -441,7 +443,7 @@ static u64 find_bitrange(u8 *bitmap, const u64 bit, const u64 max, const bool is
|
||||
|
||||
static void mem_init(void)
|
||||
{
|
||||
u64 nr_dumped_pages = l.asibk_new.storage_size_def_store / PAGE_SIZE;
|
||||
u64 nr_dumped_pages = l.asizbk.storage_size_def_store / PAGE_SIZE;
|
||||
u64 pos, more;
|
||||
|
||||
for (pos = 0; pos < nr_dumped_pages;) {
|
||||
|
||||
Reference in New Issue
Block a user