-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The vvar_vclock was introduced by [1]. Basically, the old vvar vma has been splited on two parts. In term of C/R, these two vma-s can be still treated as one. [1] e93d2521b27f ("x86/vdso: Split virtual clock pages into dedicated mapping") Signed-off-by: Andrei Vagin <[email protected]>
- Loading branch information
Showing
4 changed files
with
53 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -579,7 +579,8 @@ static int handle_vma(pid_t pid, struct vma_area *vma_area, const char *file_pat | |
} else if (!strcmp(file_path, "[vdso]")) { | ||
if (handle_vdso_vma(vma_area)) | ||
goto err; | ||
} else if (!strcmp(file_path, "[vvar]")) { | ||
} else if (!strcmp(file_path, "[vvar]") || | ||
!strcmp(file_path, "[vvar_vclock]")) { | ||
if (handle_vvar_vma(vma_area)) | ||
goto err; | ||
} else if (!strcmp(file_path, "[heap]")) { | ||
|
@@ -771,7 +772,7 @@ static int task_size_check(pid_t pid, VmaEntry *entry) | |
|
||
int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, dump_filemap_t dump_filemap) | ||
{ | ||
struct vma_area *vma_area = NULL; | ||
struct vma_area *vma_area = NULL, *prev_vma_area = NULL; | ||
unsigned long start, end, pgoff, prev_end = 0; | ||
char r, w, x, s; | ||
int ret = -1, vm_file_fd = -1; | ||
|
@@ -813,8 +814,21 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list, dump_filemap_t du | |
continue; | ||
} | ||
|
||
if (vma_area && vma_list_add(vma_area, vma_area_list, &prev_end, &vfi, &prev_vfi)) | ||
goto err; | ||
if (vma_area && vma_area_is(vma_area, VMA_AREA_VVAR) && | ||
prev_vma_area && vma_area_is(prev_vma_area, VMA_AREA_VVAR)) { | ||
if (prev_vma_area->e->end != vma_area->e->start) { | ||
pr_err("two nonconsecutive vvar vma-s: %lx-%lx %lx-%lx", | ||
prev_vma_area->e->start, prev_vma_area->e->end, | ||
Check warning on line 821 in criu/proc_parse.c GitHub Actions / build
|
||
vma_area->e->start, vma_area->e->end); | ||
goto err; | ||
} | ||
/* Merge all vvar vma-s into one. */ | ||
prev_vma_area->e->end = vma_area->e->end; | ||
} else { | ||
if (vma_area && vma_list_add(vma_area, vma_area_list, &prev_end, &vfi, &prev_vfi)) | ||
goto err; | ||
prev_vma_area = vma_area; | ||
} | ||
|
||
if (eof) | ||
break; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,21 +310,27 @@ static int vdso_parse_maps(pid_t pid, struct vdso_maps *s) | |
|
||
while (1) { | ||
unsigned long start, end; | ||
char *has_vdso, *has_vvar; | ||
char *has_vdso, *has_vvar, *has_vvar_vclock; | ||
|
||
buf = breadline(&f); | ||
if (buf == NULL) | ||
break; | ||
if (IS_ERR(buf)) | ||
goto err; | ||
|
||
has_vdso = strstr(buf, "[vdso]"); | ||
if (!has_vdso) | ||
has_vvar = NULL; | ||
has_vvar_vclock = NULL; | ||
do { | ||
has_vdso = strstr(buf, "[vdso]"); | ||
if (has_vdso) | ||
break; | ||
has_vvar = strstr(buf, "[vvar]"); | ||
else | ||
has_vvar = NULL; | ||
if (has_vvar) | ||
break; | ||
has_vvar_vclock = strstr(buf, "[vvar_vclock]"); | ||
} while(0); | ||
Check warning on line 331 in criu/vdso.c GitHub Actions / build
|
||
|
||
if (!has_vdso && !has_vvar) | ||
if (!has_vdso && !has_vvar && !has_vvar_vclock) | ||
continue; | ||
|
||
if (sscanf(buf, "%lx-%lx", &start, &end) != 2) { | ||
|
@@ -339,13 +345,21 @@ static int vdso_parse_maps(pid_t pid, struct vdso_maps *s) | |
} | ||
s->vdso_start = start; | ||
s->sym.vdso_size = end - start; | ||
} else { | ||
} else if (has_vvar) { | ||
if (s->vvar_start != VVAR_BAD_ADDR) { | ||
pr_err("Got second VVAR entry\n"); | ||
goto err; | ||
} | ||
s->vvar_start = start; | ||
s->sym.vvar_size = end - start; | ||
} else { | ||
if (s->vvar_start == VDSO_BAD_ADDR || | ||
s->vvar_start + s->sym.vvar_size != start) { | ||
pr_err("VVAR and VVAR_VCLOCK entries are not subsequent\n"); | ||
goto err; | ||
} | ||
s->sym.vvar_vclock_size = end - start; | ||
s->sym.vvar_size += s->sym.vvar_vclock_size; | ||
} | ||
} | ||
|
||
|