>>+static void
>>+exclude_nodata_pages(struct cycle *cycle)
>>+{
>>+     int i;
>>+     unsigned long long phys_start, phys_end;
>>+     off_t file_size;
>>+
>>+     i = 0;
>>+     while (get_pt_load_extents(i, &phys_start, &phys_end,
>>+                                NULL, &file_size)) {
>>+             unsigned long long pfn, pfn_end;
>>+
>>+             pfn = paddr_to_pfn(phys_start + file_size);
>>+             pfn_end = paddr_to_pfn(phys_end);
>
>Does this code exclude the first pfn of out of PT_LOAD even if there is
>no unstored pages ? pfn and pfn_end will point at the next pfn to the
>last pfn of PT_LOAD.
>This will be problem for the environments which have a overlapped PT_LOAD
>segment like ia64.
>
>>+             if (pfn < cycle->start_pfn)
>>+                     pfn = cycle->start_pfn;
>>+             if (pfn_end >= cycle->end_pfn)
>>+                     pfn_end = cycle->end_pfn - 1;
>>+             while (pfn <= pfn_end) {
>
>Should we change this condition to "pfn < pfn_end" ?
>
>>+                     clear_bit_on_2nd_bitmap(pfn, cycle);
>>+                     ++pfn;
>>+             }
>>+             ++i;
>>+     }
>>+}

I fixed this as below for v1.6.0.
Of course your comment would still be helpful.

--
Author: Atsushi Kumagai <[email protected]>
Date:   Thu May 26 15:17:25 2016 +0900

    [PATCH] Fix boundary value bug for checking memory holes

    Now the next pfn to the last pfn of PT_LOAD is always excluded
    by boundary value bug.

         --------- PT_LOAD ----------|
         ----+-----------------------+---------------------+----
             |         pfn:N         |       pfn:N+1       | ...
         ----+-----------------------+---------------------+----
                                              ^ this pfn

    This will be problem in the environments which have a overlapped
    PT_LOAD segment like ia64 because the pfn excluded by this bug
    can be included in another PT_LOAD.

    Signed-off-by: Atsushi Kumagai <[email protected]>

diff --git a/makedumpfile.c b/makedumpfile.c
index 4f17686..8a80976 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -4449,7 +4449,7 @@ exclude_nodata_pages(struct cycle *cycle)
                        pfn = cycle->start_pfn;
                if (pfn_end >= cycle->end_pfn)
                        pfn_end = cycle->end_pfn - 1;
-               while (pfn <= pfn_end) {
+               while (pfn < pfn_end) {
                        clear_bit_on_2nd_bitmap(pfn, cycle);
                        ++pfn;
                }

Thanks,
Atsushi Kumagai

>
>Thanks,
>Atsushi Kumagai
>
>>+
>> int
>> read_flat_data_header(struct makedumpfile_data_header *fdh)
>> {
>>@@ -6087,6 +6113,12 @@ create_2nd_bitmap(struct cycle *cycle)
>>      }
>>
>>      /*
>>+      * If re-filtering ELF dump, exclude pages that were already
>>+      * excluded in the original file.
>>+      */
>>+     exclude_nodata_pages(cycle);
>>+
>>+     /*
>>       * Exclude cache pages, cache private pages, user data pages,
>>       * and hwpoison pages.
>>       */
>>
>>_______________________________________________
>>kexec mailing list
>>[email protected]
>>http://lists.infradead.org/mailman/listinfo/kexec
>
>_______________________________________________
>kexec mailing list
>[email protected]
>http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to