Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107705485
D31991.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D31991.diff
View Options
diff --git a/sys/amd64/amd64/minidump_machdep.c b/sys/amd64/amd64/minidump_machdep.c
--- a/sys/amd64/amd64/minidump_machdep.c
+++ b/sys/amd64/amd64/minidump_machdep.c
@@ -171,6 +171,7 @@
int ii, j, k, n;
int retry_count;
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
retry_count = 0;
retry:
@@ -252,8 +253,9 @@
}
/* Calculate dump size. */
+ mbp = state->msgbufp;
dumpsize = pmapsize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(sizeof(dump_avail));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -273,7 +275,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
@@ -299,7 +301,7 @@
goto fail;
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size));
+ error = blk_write(di, mbp->msg_ptr, 0, round_page(mbp->msg_size));
if (error)
goto fail;
diff --git a/sys/arm/arm/minidump_machdep.c b/sys/arm/arm/minidump_machdep.c
--- a/sys/arm/arm/minidump_machdep.c
+++ b/sys/arm/arm/minidump_machdep.c
@@ -156,6 +156,7 @@
cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state)
{
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
uint64_t dumpsize, *dump_avail_buf;
uint32_t ptesize;
uint32_t pa, prev_pa = 0, count = 0;
@@ -190,8 +191,9 @@
}
/* Calculate dump size. */
+ mbp = state->msgbufp;
dumpsize = ptesize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(nitems(dump_avail) * sizeof(uint64_t));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -209,7 +211,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.ptesize = ptesize;
mdhdr.kernbase = KERNBASE;
@@ -235,8 +237,7 @@
goto fail;
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0,
- round_page(msgbufp->msg_size));
+ error = blk_write(di, mbp->msg_ptr, 0, round_page(mbp->msg_size));
if (error)
goto fail;
diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c
--- a/sys/arm64/arm64/minidump_machdep.c
+++ b/sys/arm64/arm64/minidump_machdep.c
@@ -151,6 +151,7 @@
cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state)
{
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
pd_entry_t *l0, *l1, l1e, *l2, l2e;
pt_entry_t *l3, l3e;
vm_offset_t va, kva_end;
@@ -209,8 +210,9 @@
}
/* Calculate dump size. */
+ mbp = state->msgbufp;
dumpsize = pmapsize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(sizeof(dump_avail));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -227,7 +229,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
@@ -254,8 +256,7 @@
goto fail;
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0,
- round_page(msgbufp->msg_size));
+ error = blk_write(di, mbp->msg_ptr, 0, round_page(mbp->msg_size));
if (error)
goto fail;
diff --git a/sys/i386/i386/minidump_machdep_base.c b/sys/i386/i386/minidump_machdep_base.c
--- a/sys/i386/i386/minidump_machdep_base.c
+++ b/sys/i386/i386/minidump_machdep_base.c
@@ -164,6 +164,7 @@
pt_entry_t *pt, pte;
int j, k;
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
/* Snapshot the KVA upper bound in case it grows. */
kva_end = kernel_vm_end;
@@ -212,8 +213,9 @@
}
/* Calculate dump size. */
+ mbp = state->msgbufp;
dumpsize = ptesize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(sizeof(dump_avail));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -232,7 +234,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.ptesize = ptesize;
mdhdr.kernbase = KERNBASE;
@@ -257,7 +259,8 @@
goto fail;
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0, round_page(msgbufp->msg_size));
+ error = blk_write(di, (char *)mbp->msg_ptr, 0,
+ round_page(mbp->msg_size));
if (error)
goto fail;
diff --git a/sys/mips/mips/minidump_machdep.c b/sys/mips/mips/minidump_machdep.c
--- a/sys/mips/mips/minidump_machdep.c
+++ b/sys/mips/mips/minidump_machdep.c
@@ -109,6 +109,7 @@
cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state)
{
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
uint64_t *dump_avail_buf;
uint32_t ptesize;
vm_paddr_t pa;
@@ -148,8 +149,9 @@
}
/* Calculate dump size. */
+ mbp = state->msgbufp;
dumpsize = ptesize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(nitems(dump_avail) * sizeof(uint64_t));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -167,7 +169,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.ptesize = ptesize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
@@ -191,8 +193,7 @@
goto fail;
/* Dump msgbuf up front */
- error = write_buffer(di, (char *)msgbufp->msg_ptr,
- round_page(msgbufp->msg_size));
+ error = write_buffer(di, mbp->msg_ptr, round_page(mbp->msg_size));
if (error)
goto fail;
diff --git a/sys/powerpc/powerpc/minidump_machdep.c b/sys/powerpc/powerpc/minidump_machdep.c
--- a/sys/powerpc/powerpc/minidump_machdep.c
+++ b/sys/powerpc/powerpc/minidump_machdep.c
@@ -195,6 +195,7 @@
int error, retry_count;
uint32_t pmapsize;
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
retry_count = 0;
retry:
@@ -210,8 +211,9 @@
}
/* Calculate dump size */
+ mbp = state->msgbufp;
dumpsize = PAGE_SIZE; /* header */
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(sizeof(dump_avail));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
dumpsize += pmapsize;
@@ -229,7 +231,7 @@
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
strncpy(mdhdr.mmu_name, pmap_mmu_name(), sizeof(mdhdr.mmu_name) - 1);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS;
@@ -260,9 +262,8 @@
dump_total("header", PAGE_SIZE);
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0,
- round_page(msgbufp->msg_size));
- dump_total("msgbuf", round_page(msgbufp->msg_size));
+ error = blk_write(di, mbp->msg_ptr, 0, round_page(mbp->msg_size));
+ dump_total("msgbuf", round_page(mbp->msg_size));
/* Dump dump_avail */
_Static_assert(sizeof(dump_avail) <= sizeof(pgbuf),
diff --git a/sys/riscv/riscv/minidump_machdep.c b/sys/riscv/riscv/minidump_machdep.c
--- a/sys/riscv/riscv/minidump_machdep.c
+++ b/sys/riscv/riscv/minidump_machdep.c
@@ -158,6 +158,7 @@
pd_entry_t *l1, *l2, l2e;
pt_entry_t *l3, l3e;
struct minidumphdr mdhdr;
+ struct msgbuf *mbp;
uint32_t pmapsize;
vm_offset_t va, kva_max;
vm_paddr_t pa;
@@ -211,8 +212,9 @@
}
/* Calculate dump size */
+ mbp = state->msgbufp;
dumpsize = pmapsize;
- dumpsize += round_page(msgbufp->msg_size);
+ dumpsize += round_page(mbp->msg_size);
dumpsize += round_page(sizeof(dump_avail));
dumpsize += round_page(BITSET_SIZE(vm_page_dump_pages));
VM_PAGE_DUMP_FOREACH(pa) {
@@ -230,7 +232,7 @@
bzero(&mdhdr, sizeof(mdhdr));
strcpy(mdhdr.magic, MINIDUMP_MAGIC);
mdhdr.version = MINIDUMP_VERSION;
- mdhdr.msgbufsize = msgbufp->msg_size;
+ mdhdr.msgbufsize = mbp->msg_size;
mdhdr.bitmapsize = round_page(BITSET_SIZE(vm_page_dump_pages));
mdhdr.pmapsize = pmapsize;
mdhdr.kernbase = KERNBASE;
@@ -257,8 +259,7 @@
goto fail;
/* Dump msgbuf up front */
- error = blk_write(di, (char *)msgbufp->msg_ptr, 0,
- round_page(msgbufp->msg_size));
+ error = blk_write(di, mbp->msg_ptr, 0, round_page(mbp->msg_size));
if (error)
goto fail;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 18, 4:54 PM (13 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15875473
Default Alt Text
D31991.diff (8 KB)
Attached To
Mode
D31991: minidump: Use provided msgbuf pointer
Attached
Detach File
Event Timeline
Log In to Comment