Update makedumpfile to 1.6.7
Signed-off-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
parent
cee618593c
commit
69b920db5d
@ -1,44 +0,0 @@
|
|||||||
From c1b834f80311706db2b5070cbccdcba3aacc90e5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
Date: Tue, 23 Jul 2019 11:50:52 -0400
|
|
||||||
Subject: [PATCH 1/2] Do not proceed when get_num_dumpable_cyclic() fails
|
|
||||||
|
|
||||||
Currently, when get_num_dumpable_cyclic() fails and returns FALSE in
|
|
||||||
create_dump_bitmap(), info->num_dumpable is set to 0 and makedumpfile
|
|
||||||
proceeds to write a broken dumpfile slowly with incorrect progress
|
|
||||||
indicator due to the value.
|
|
||||||
|
|
||||||
It should not proceed when get_num_dumpable_cyclic() fails.
|
|
||||||
|
|
||||||
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
---
|
|
||||||
makedumpfile.c | 6 ++++--
|
|
||||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile.c b/makedumpfile.c
|
|
||||||
index d76a4358a2b2..88df788fd6e7 100644
|
|
||||||
--- a/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
+++ b/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
@@ -7344,7 +7344,8 @@ create_dump_bitmap(void)
|
|
||||||
if (!prepare_bitmap2_buffer())
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- info->num_dumpable = get_num_dumpable_cyclic();
|
|
||||||
+ if (!(info->num_dumpable = get_num_dumpable_cyclic()))
|
|
||||||
+ goto out;
|
|
||||||
|
|
||||||
if (!info->flag_elf_dumpfile)
|
|
||||||
free_bitmap2_buffer();
|
|
||||||
@@ -7362,7 +7363,8 @@ create_dump_bitmap(void)
|
|
||||||
if (!create_2nd_bitmap(&cycle))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- info->num_dumpable = get_num_dumpable_cyclic();
|
|
||||||
+ if (!(info->num_dumpable = get_num_dumpable_cyclic()))
|
|
||||||
+ goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = TRUE;
|
|
||||||
--
|
|
||||||
2.18.1
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
From b461971bfac0f193a0c274c3b657d158e07d4995 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
Date: Thu, 29 Aug 2019 14:51:56 -0400
|
|
||||||
Subject: [PATCH] Fix exclusion range in find_vmemmap_pages()
|
|
||||||
|
|
||||||
In the function, since pfn ranges are literally start and end, not start
|
|
||||||
and end+1, if the struct page of endpfn is at the last in a vmemmap page,
|
|
||||||
the vmemmap page is dropped by the following code, and not excluded.
|
|
||||||
|
|
||||||
npfns_offset = endpfn - vmapp->rep_pfn_start;
|
|
||||||
vmemmap_offset = npfns_offset * size_table.page;
|
|
||||||
// round down to page boundary
|
|
||||||
vmemmap_offset -= (vmemmap_offset % pagesize);
|
|
||||||
|
|
||||||
We can use (endpfn+1) here to fix.
|
|
||||||
|
|
||||||
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
---
|
|
||||||
makedumpfile.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile-1.6.6/makedumpfile.c b/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
index 88df788..37df77d 100644
|
|
||||||
--- a/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
+++ b/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
@@ -6315,7 +6315,7 @@ find_vmemmap_pages(unsigned long startpfn, unsigned long endpfn, unsigned long *
|
|
||||||
start_vmemmap_pfn = vmapp->vmap_pfn_start + vmemmap_pfns;
|
|
||||||
*vmappfn = start_vmemmap_pfn;
|
|
||||||
|
|
||||||
- npfns_offset = endpfn - vmapp->rep_pfn_start;
|
|
||||||
+ npfns_offset = (endpfn+1) - vmapp->rep_pfn_start;
|
|
||||||
vmemmap_offset = npfns_offset * size_table.page;
|
|
||||||
// round down to page boundary
|
|
||||||
vmemmap_offset -= (vmemmap_offset % pagesize);
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,327 +0,0 @@
|
|||||||
From 8425342a52b23d462f10bceeeb1c8a3a43d56bf0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
Date: Fri, 6 Sep 2019 09:50:34 -0400
|
|
||||||
Subject: [PATCH] Fix inconsistent return value from find_vmemmap()
|
|
||||||
|
|
||||||
When -e option is given, the find_vmemmap() returns FAILED(1) if
|
|
||||||
it failed on x86_64, but on architectures other than that, it is
|
|
||||||
stub_false() and returns FALSE(0).
|
|
||||||
|
|
||||||
if (info->flag_excludevm) {
|
|
||||||
if (find_vmemmap() == FAILED) {
|
|
||||||
ERRMSG("Can't find vmemmap pages\n");
|
|
||||||
|
|
||||||
#define find_vmemmap() stub_false()
|
|
||||||
|
|
||||||
As a result, on the architectures other than x86_64, the -e option
|
|
||||||
does some unnecessary processing with no effect, and marks the dump
|
|
||||||
DUMP_DH_EXCLUDED_VMEMMAP unexpectedly.
|
|
||||||
|
|
||||||
Also, the functions for the -e option return COMPLETED or FAILED,
|
|
||||||
which are for command return value, not for function return value.
|
|
||||||
|
|
||||||
So let's fix the issue by following the common style that returns
|
|
||||||
TRUE or FALSE, and avoid confusion.
|
|
||||||
|
|
||||||
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
---
|
|
||||||
arch/x86_64.c | 12 ++++-----
|
|
||||||
makedumpfile.c | 70 ++++++++++++++++++++++++--------------------------
|
|
||||||
2 files changed, 40 insertions(+), 42 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile-1.6.6/arch/x86_64.c b/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
index 4eeaf4925f43..876644f932be 100644
|
|
||||||
--- a/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
+++ b/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
@@ -673,7 +673,7 @@ find_vmemmap_x86_64()
|
|
||||||
|
|
||||||
if (init_level4_pgt == NOT_FOUND_SYMBOL) {
|
|
||||||
ERRMSG("init_level4_pgt/init_top_pgt not found\n");
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NUMBER(sme_mask) != NOT_FOUND_NUMBER)
|
|
||||||
@@ -715,7 +715,7 @@ find_vmemmap_x86_64()
|
|
||||||
if (!readmem(PADDR, (unsigned long long)pgdp, (void *)&pud_addr,
|
|
||||||
sizeof(unsigned long))) {
|
|
||||||
ERRMSG("Can't get pgd entry for slot %d.\n", pgd_index);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* mask the pgd entry for the address of the pud page */
|
|
||||||
@@ -726,7 +726,7 @@ find_vmemmap_x86_64()
|
|
||||||
if (!readmem(PADDR, (unsigned long long)pud_addr, (void *)pud_page,
|
|
||||||
PTRS_PER_PUD * sizeof(unsigned long))) {
|
|
||||||
ERRMSG("Can't get pud entry for pgd slot %ld.\n", pgdindex);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
/* step thru each pmd address in the pud page */
|
|
||||||
/* pudp points to an entry in the pud page */
|
|
||||||
@@ -739,7 +739,7 @@ find_vmemmap_x86_64()
|
|
||||||
if (!readmem(PADDR, pmd_addr, (void *)pmd_page,
|
|
||||||
PTRS_PER_PMD * sizeof(unsigned long))) {
|
|
||||||
ERRMSG("Can't get pud entry for slot %ld.\n", pudindex);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
/* pmdp points to an entry in the pmd */
|
|
||||||
for (pmdp = (unsigned long *)pmd_page, pmdindex = 0;
|
|
||||||
@@ -815,7 +815,7 @@ find_vmemmap_x86_64()
|
|
||||||
num_pmds_valid++;
|
|
||||||
if (!(pmd & _PAGE_PSE)) {
|
|
||||||
printf("vmemmap pmd not huge, abort\n");
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (last_valid) {
|
|
||||||
@@ -947,7 +947,7 @@ find_vmemmap_x86_64()
|
|
||||||
i++;
|
|
||||||
} while (cur != vmaphead);
|
|
||||||
nr_gvmem_pfns = i;
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* x86_64 */
|
|
||||||
diff --git a/makedumpfile-1.6.6/makedumpfile.c b/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
index 37df77d181dd..af4db3c006c9 100644
|
|
||||||
--- a/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
+++ b/makedumpfile-1.6.6/makedumpfile.c
|
|
||||||
@@ -6213,20 +6213,20 @@ init_save_control()
|
|
||||||
flags = O_RDWR|O_CREAT|O_TRUNC;
|
|
||||||
if ((sc.sc_fd = open(sc.sc_filename, flags, S_IRUSR|S_IWUSR)) < 0) {
|
|
||||||
ERRMSG("Can't open the pfn file %s.\n", sc.sc_filename);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
unlink(sc.sc_filename);
|
|
||||||
|
|
||||||
sc.sc_buf = malloc(info->page_size);
|
|
||||||
if (!sc.sc_buf) {
|
|
||||||
ERRMSG("Can't allocate a page for pfn buf.\n");
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
sc.sc_buflen = info->page_size;
|
|
||||||
sc.sc_bufposition = 0;
|
|
||||||
sc.sc_fileposition = 0;
|
|
||||||
sc.sc_filelen = 0;
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -6243,7 +6243,7 @@ save_deletes(unsigned long startpfn, unsigned long numpfns)
|
|
||||||
if (i != sc.sc_buflen) {
|
|
||||||
ERRMSG("save: Can't write a page to %s\n",
|
|
||||||
sc.sc_filename);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
sc.sc_filelen += sc.sc_buflen;
|
|
||||||
sc.sc_bufposition = 0;
|
|
||||||
@@ -6252,12 +6252,12 @@ save_deletes(unsigned long startpfn, unsigned long numpfns)
|
|
||||||
scp->startpfn = startpfn;
|
|
||||||
scp->numpfns = numpfns;
|
|
||||||
sc.sc_bufposition += sizeof(struct sc_entry);
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get a starting pfn and number of pfns for delete from bitmap.
|
|
||||||
- * Return 0 for success, 1 for 'no more'
|
|
||||||
+ * Return TRUE(1) for success, FALSE(0) for 'no more'
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
get_deletes(unsigned long *startpfn, unsigned long *numpfns)
|
|
||||||
@@ -6266,14 +6266,14 @@ get_deletes(unsigned long *startpfn, unsigned long *numpfns)
|
|
||||||
struct sc_entry *scp;
|
|
||||||
|
|
||||||
if (sc.sc_fileposition >= sc.sc_filelen) {
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sc.sc_bufposition == sc.sc_buflen) {
|
|
||||||
i = read(sc.sc_fd, sc.sc_buf, sc.sc_buflen);
|
|
||||||
if (i <= 0) {
|
|
||||||
ERRMSG("Can't read a page from %s.\n", sc.sc_filename);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
sc.sc_bufposition = 0;
|
|
||||||
}
|
|
||||||
@@ -6282,7 +6282,7 @@ get_deletes(unsigned long *startpfn, unsigned long *numpfns)
|
|
||||||
*numpfns = scp->numpfns;
|
|
||||||
sc.sc_bufposition += sizeof(struct sc_entry);
|
|
||||||
sc.sc_fileposition += sizeof(struct sc_entry);
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -6290,7 +6290,7 @@ get_deletes(unsigned long *startpfn, unsigned long *numpfns)
|
|
||||||
* that represent them.
|
|
||||||
* (pfn ranges are literally start and end, not start and end+1)
|
|
||||||
* see the array of vmemmap pfns and the pfns they represent: gvmem_pfns
|
|
||||||
- * Return COMPLETED for delete, FAILED for not to delete.
|
|
||||||
+ * Return TRUE(1) for delete, FALSE(0) for not to delete.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
find_vmemmap_pages(unsigned long startpfn, unsigned long endpfn, unsigned long *vmappfn,
|
|
||||||
@@ -6323,12 +6323,12 @@ find_vmemmap_pages(unsigned long startpfn, unsigned long endpfn, unsigned long *
|
|
||||||
end_vmemmap_pfn = vmapp->vmap_pfn_start + vmemmap_pfns;
|
|
||||||
npages = end_vmemmap_pfn - start_vmemmap_pfn;
|
|
||||||
if (npages == 0)
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
*nmapnpfns = npages;
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -6359,12 +6359,12 @@ find_unused_vmemmap_pages(void)
|
|
||||||
if (lseek(bitmap1->fd, new_offset1, SEEK_SET) < 0 ) {
|
|
||||||
ERRMSG("Can't seek the bitmap(%s). %s\n",
|
|
||||||
bitmap1->file_name, strerror(errno));
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
if (read(bitmap1->fd, bitmap1->buf, BUFSIZE_BITMAP) != BUFSIZE_BITMAP) {
|
|
||||||
ERRMSG("Can't read the bitmap(%s). %s\n",
|
|
||||||
bitmap1->file_name, strerror(errno));
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
bitmap1->no_block = pfn / PFN_BUFBITMAP;
|
|
||||||
|
|
||||||
@@ -6372,12 +6372,12 @@ find_unused_vmemmap_pages(void)
|
|
||||||
if (lseek(bitmap2->fd, new_offset2, SEEK_SET) < 0 ) {
|
|
||||||
ERRMSG("Can't seek the bitmap(%s). %s\n",
|
|
||||||
bitmap2->file_name, strerror(errno));
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
if (read(bitmap2->fd, bitmap2->buf, BUFSIZE_BITMAP) != BUFSIZE_BITMAP) {
|
|
||||||
ERRMSG("Can't read the bitmap(%s). %s\n",
|
|
||||||
bitmap2->file_name, strerror(errno));
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
bitmap2->no_block = pfn / PFN_BUFBITMAP;
|
|
||||||
|
|
||||||
@@ -6422,12 +6422,11 @@ find_unused_vmemmap_pages(void)
|
|
||||||
endpfn = startpfn +
|
|
||||||
(numwords * BITS_PER_WORD) - 1;
|
|
||||||
if (find_vmemmap_pages(startpfn, endpfn,
|
|
||||||
- &vmapstartpfn, &vmapnumpfns) ==
|
|
||||||
- COMPLETED) {
|
|
||||||
- if (save_deletes(vmapstartpfn,
|
|
||||||
- vmapnumpfns) == FAILED) {
|
|
||||||
+ &vmapstartpfn, &vmapnumpfns)) {
|
|
||||||
+ if (!save_deletes(vmapstartpfn,
|
|
||||||
+ vmapnumpfns)) {
|
|
||||||
ERRMSG("save_deletes failed\n");
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
deleted_pages += vmapnumpfns;
|
|
||||||
}
|
|
||||||
@@ -6444,11 +6443,10 @@ find_unused_vmemmap_pages(void)
|
|
||||||
not start and end + 1 */
|
|
||||||
endpfn = startpfn + (numwords * BITS_PER_WORD) - 1;
|
|
||||||
if (find_vmemmap_pages(startpfn, endpfn,
|
|
||||||
- &vmapstartpfn, &vmapnumpfns) == COMPLETED) {
|
|
||||||
- if (save_deletes(vmapstartpfn, vmapnumpfns)
|
|
||||||
- == FAILED) {
|
|
||||||
+ &vmapstartpfn, &vmapnumpfns)) {
|
|
||||||
+ if (!save_deletes(vmapstartpfn, vmapnumpfns)) {
|
|
||||||
ERRMSG("save_deletes failed\n");
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
deleted_pages += vmapnumpfns;
|
|
||||||
}
|
|
||||||
@@ -6457,7 +6455,7 @@ find_unused_vmemmap_pages(void)
|
|
||||||
}
|
|
||||||
PROGRESS_MSG("\nExcluded %ld unused vmemmap pages\n", deleted_pages);
|
|
||||||
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -6468,7 +6466,7 @@ delete_unused_vmemmap_pages(void)
|
|
||||||
{
|
|
||||||
unsigned long startpfn, numpfns, pfn, i;
|
|
||||||
|
|
||||||
- while (get_deletes(&startpfn, &numpfns) == COMPLETED) {
|
|
||||||
+ while (get_deletes(&startpfn, &numpfns)) {
|
|
||||||
for (i = 0, pfn = startpfn; i < numpfns; i++, pfn++) {
|
|
||||||
clear_bit_on_2nd_bitmap_for_kernel(pfn, (struct cycle *)0);
|
|
||||||
// note that this is never to be used in cyclic mode!
|
|
||||||
@@ -6496,23 +6494,23 @@ reset_save_control()
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
if (sc.sc_bufposition == 0)
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
|
|
||||||
i = write(sc.sc_fd, sc.sc_buf, sc.sc_buflen);
|
|
||||||
if (i != sc.sc_buflen) {
|
|
||||||
ERRMSG("reset: Can't write a page to %s\n",
|
|
||||||
sc.sc_filename);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
sc.sc_filelen += sc.sc_bufposition;
|
|
||||||
|
|
||||||
if (lseek(sc.sc_fd, 0, SEEK_SET) < 0) {
|
|
||||||
ERRMSG("Can't seek the pfn file %s).", sc.sc_filename);
|
|
||||||
- return FAILED;
|
|
||||||
+ return FALSE;
|
|
||||||
}
|
|
||||||
sc.sc_fileposition = 0;
|
|
||||||
sc.sc_bufposition = sc.sc_buflen; /* trigger 1st read */
|
|
||||||
- return COMPLETED;
|
|
||||||
+ return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
@@ -6602,11 +6600,11 @@ create_2nd_bitmap(struct cycle *cycle)
|
|
||||||
|
|
||||||
/* --exclude-unused-vm means exclude vmemmap page structures for unused pages */
|
|
||||||
if (info->flag_excludevm) {
|
|
||||||
- if (init_save_control() == FAILED)
|
|
||||||
+ if (!init_save_control())
|
|
||||||
return FALSE;
|
|
||||||
- if (find_unused_vmemmap_pages() == FAILED)
|
|
||||||
+ if (!find_unused_vmemmap_pages())
|
|
||||||
return FALSE;
|
|
||||||
- if (reset_save_control() == FAILED)
|
|
||||||
+ if (!reset_save_control())
|
|
||||||
return FALSE;
|
|
||||||
delete_unused_vmemmap_pages();
|
|
||||||
finalize_save_control();
|
|
||||||
@@ -10095,7 +10093,7 @@ create_dumpfile(void)
|
|
||||||
|
|
||||||
/* create an array of translations from pfn to vmemmap pages */
|
|
||||||
if (info->flag_excludevm) {
|
|
||||||
- if (find_vmemmap() == FAILED) {
|
|
||||||
+ if (!find_vmemmap()) {
|
|
||||||
ERRMSG("Can't find vmemmap pages\n");
|
|
||||||
info->flag_excludevm = 0;
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.18.1
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
From 7bdb468c2c99dd780c9a5321f93c79cbfdce2527 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
Date: Tue, 23 Jul 2019 12:24:47 -0400
|
|
||||||
Subject: [PATCH 2/2] Increase SECTION_MAP_LAST_BIT to 4
|
|
||||||
|
|
||||||
kernel commit 326e1b8f83a4 ("mm/sparsemem: introduce a SECTION_IS_EARLY
|
|
||||||
flag") added the flag to mem_section->section_mem_map value, and it caused
|
|
||||||
makedumpfile an error like the following:
|
|
||||||
|
|
||||||
readmem: Can't convert a virtual address(fffffc97d1000000) to physical address.
|
|
||||||
readmem: type_addr: 0, addr:fffffc97d1000000, size:32768
|
|
||||||
__exclude_unnecessary_pages: Can't read the buffer of struct page.
|
|
||||||
create_2nd_bitmap: Can't exclude unnecessary pages.
|
|
||||||
|
|
||||||
To fix this, SECTION_MAP_LAST_BIT needs to be updated. The bit has not
|
|
||||||
been used until the addition, so we can just increase the value.
|
|
||||||
|
|
||||||
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
---
|
|
||||||
makedumpfile.h | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile.h b/makedumpfile.h
|
|
||||||
index 24b2f69f400c..df745b9f53e5 100644
|
|
||||||
--- a/makedumpfile-1.6.6/makedumpfile.h
|
|
||||||
+++ b/makedumpfile-1.6.6/makedumpfile.h
|
|
||||||
@@ -195,7 +195,7 @@ isAnon(unsigned long mapping)
|
|
||||||
* 2. it has been verified that (1UL<<2) was never set, so it is
|
|
||||||
* safe to mask that bit off even in old kernels.
|
|
||||||
*/
|
|
||||||
-#define SECTION_MAP_LAST_BIT (1UL<<3)
|
|
||||||
+#define SECTION_MAP_LAST_BIT (1UL<<4)
|
|
||||||
#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
|
|
||||||
#define NR_SECTION_ROOTS() divideup(num_section, SECTIONS_PER_ROOT())
|
|
||||||
#define SECTION_NR_TO_PFN(sec) ((sec) << PFN_SECTION_SHIFT())
|
|
||||||
--
|
|
||||||
2.18.1
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From 3beef142bc003d9cf2e957c6a21e51d661f9b13e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pingfan Liu <piliu@redhat.com>
|
|
||||||
Date: Thu, 28 Nov 2019 21:23:00 +0800
|
|
||||||
Subject: [PATCH] makedumpfile: remove -lebl
|
|
||||||
|
|
||||||
Signed-off-by: Pingfan Liu <piliu@redhat.com>
|
|
||||||
---
|
|
||||||
makedumpfile-1.6.6/Makefile | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile-1.6.6/Makefile b/makedumpfile-1.6.6/Makefile
|
|
||||||
index 1fdb628..df21b93 100644
|
|
||||||
--- a/makedumpfile-1.6.6/Makefile
|
|
||||||
+++ b/makedumpfile-1.6.6/Makefile
|
|
||||||
@@ -50,7 +50,7 @@ OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
|
|
||||||
SRC_ARCH = arch/arm.c arch/arm64.c arch/x86.c arch/x86_64.c arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c arch/sparc64.c
|
|
||||||
OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
|
|
||||||
|
|
||||||
-LIBS = -ldw -lbz2 -lebl -ldl -lelf -lz
|
|
||||||
+LIBS = -ldw -lbz2 -ldl -lelf -lz
|
|
||||||
ifneq ($(LINKTYPE), dynamic)
|
|
||||||
LIBS := -static $(LIBS)
|
|
||||||
endif
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
|||||||
From aa5ab4cf6c7335392094577380d2eaee8a0a8d52 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
Date: Thu, 29 Aug 2019 12:26:34 -0400
|
|
||||||
Subject: [PATCH] x86_64: Fix incorrect exclusion by -e option with KASLR
|
|
||||||
|
|
||||||
The -e option uses info->vmemmap_start for creating a table to determine
|
|
||||||
the positions of page structures that should be excluded, but it is a
|
|
||||||
hardcoded value even with KASLR-enabled vmcore. As a result, the option
|
|
||||||
excludes incorrect pages from it.
|
|
||||||
|
|
||||||
To fix this, get the vmemmap start address from info->mem_map_data.
|
|
||||||
|
|
||||||
Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
|
|
||||||
---
|
|
||||||
arch/x86_64.c | 10 ++++++++++
|
|
||||||
1 file changed, 10 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/makedumpfile-1.6.6/arch/x86_64.c b/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
index 3c0fdc5..4eeaf49 100644
|
|
||||||
--- a/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
+++ b/makedumpfile-1.6.6/arch/x86_64.c
|
|
||||||
@@ -679,6 +679,16 @@ find_vmemmap_x86_64()
|
|
||||||
if (NUMBER(sme_mask) != NOT_FOUND_NUMBER)
|
|
||||||
pmask &= ~(NUMBER(sme_mask));
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ * vmemmap region can be randomized by KASLR.
|
|
||||||
+ * (currently we don't utilize info->vmemmap_end on x86_64.)
|
|
||||||
+ *
|
|
||||||
+ if (info->mem_map_data &&
|
|
||||||
+ info->mem_map_data[0].mem_map != NOT_MEMMAP_ADDR)
|
|
||||||
+ info->vmemmap_start = info->mem_map_data[0].mem_map;
|
|
||||||
+
|
|
||||||
+ DEBUG_MSG("vmemmap_start: %16lx\n", info->vmemmap_start);
|
|
||||||
+
|
|
||||||
pagestructsize = size_table.page;
|
|
||||||
hugepagesize = PTRS_PER_PMD * info->page_size;
|
|
||||||
vaddr_base = info->vmemmap_start;
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
%global eppic_ver d84c3541035d95077aa8571f5d5c3e07c6ef510b
|
%global eppic_ver d84c3541035d95077aa8571f5d5c3e07c6ef510b
|
||||||
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
|
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
|
||||||
%global mkdf_ver 1.6.6
|
%global mkdf_ver 1.6.7
|
||||||
|
|
||||||
Name: kexec-tools
|
Name: kexec-tools
|
||||||
Version: 2.0.20
|
Version: 2.0.20
|
||||||
@ -82,8 +82,6 @@ Patch0: kexec-tools-2.0.20-fix-broken-multiboot2-buliding-for-i386.patch
|
|||||||
#
|
#
|
||||||
# Patches 101 through 200 are meant for x86_64 kexec-tools enablement
|
# Patches 101 through 200 are meant for x86_64 kexec-tools enablement
|
||||||
#
|
#
|
||||||
Patch101: kexec-tools-2.0.20-makedumpfile-x86_64-Fix-incorrect-exclusion-by-e-option.patch
|
|
||||||
Patch102: kexec-tools-2.0.20-makedumpfile-Fix-exclusion-range-in-find_vmemmap_pages.patch
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Patches 301 through 400 are meant for ppc64 kexec-tools enablement
|
# Patches 301 through 400 are meant for ppc64 kexec-tools enablement
|
||||||
@ -99,10 +97,6 @@ Patch102: kexec-tools-2.0.20-makedumpfile-Fix-exclusion-range-in-find_vmemmap_pa
|
|||||||
#
|
#
|
||||||
# Patches 601 onward are generic patches
|
# Patches 601 onward are generic patches
|
||||||
#
|
#
|
||||||
Patch601: kexec-tools-2.0.20-makedumpfile-Do-not-proceed-when-get_num_dumpable_cyclic-fails.patch
|
|
||||||
Patch602: kexec-tools-2.0.20-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-4.patch
|
|
||||||
Patch603: kexec-tools-2.0.20-makedumpfile-Fix-inconsistent-return-value-from-find_vmemmap.patch
|
|
||||||
Patch604: kexec-tools-2.0.20-makedumpfile-remove-lebl.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
kexec-tools provides /sbin/kexec binary that facilitates a new
|
kexec-tools provides /sbin/kexec binary that facilitates a new
|
||||||
@ -119,12 +113,6 @@ tar -z -x -v -f %{SOURCE9}
|
|||||||
tar -z -x -v -f %{SOURCE19}
|
tar -z -x -v -f %{SOURCE19}
|
||||||
|
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch601 -p1
|
|
||||||
%patch602 -p1
|
|
||||||
%patch101 -p1
|
|
||||||
%patch102 -p1
|
|
||||||
%patch603 -p1
|
|
||||||
%patch604 -p1
|
|
||||||
|
|
||||||
%ifarch ppc
|
%ifarch ppc
|
||||||
%define archdef ARCH=ppc
|
%define archdef ARCH=ppc
|
||||||
|
2
sources
2
sources
@ -1,3 +1,3 @@
|
|||||||
SHA512 (eppic-d84c354.tar.gz) = 455b3386c3e4cc546b858f1f8b0e6874072aaae708ebe072452fb5f0b6a81b1f3a315b40f94c3967f38525cadd276864a7bc7f0f12fa421655dcc3b15b70914d
|
SHA512 (eppic-d84c354.tar.gz) = 455b3386c3e4cc546b858f1f8b0e6874072aaae708ebe072452fb5f0b6a81b1f3a315b40f94c3967f38525cadd276864a7bc7f0f12fa421655dcc3b15b70914d
|
||||||
SHA512 (makedumpfile-1.6.6.tar.gz) = f4926d7800fe21b9125c03b8ce043e7cc3420b997a7d9f4ce7b565cde7f5b4aaf9ac958dbbefe5868ee3cb639ccb2d40c10f774ac2720baeac2242fc0bf66df2
|
|
||||||
SHA512 (kexec-tools-2.0.20.tar.xz) = 3112b6202c1030705c53e3f65a2b58aec14d65333a35aad681d48b9f2bd1c51a2e05c985a1e5e867ab02f8a9c97708483d9d225619db7c6993676f1a242e2d99
|
SHA512 (kexec-tools-2.0.20.tar.xz) = 3112b6202c1030705c53e3f65a2b58aec14d65333a35aad681d48b9f2bd1c51a2e05c985a1e5e867ab02f8a9c97708483d9d225619db7c6993676f1a242e2d99
|
||||||
|
SHA512 (makedumpfile-1.6.7.tar.gz) = fdd78bfea5f96eda094269480ebbceead6ae8d9d2bb1184ffa1e18c6effda5c6df296fbcecc25735109194c0690d6f9ca684c37da1825d7d65568ba18a71a940
|
||||||
|
Loading…
Reference in New Issue
Block a user