When kexec-ing into a new kernel, the grant table might still have
active grants. Support that by not adding populated grant entries to
the list of free grant entries.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
gnttab.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gnttab.c b/gnttab.c
index 8168ed5d..5b04ab01 100644
--- a/gnttab.c
+++ b/gnttab.c
@@ -183,11 +183,13 @@ init_gnttab(void)
#ifdef GNT_DEBUG
memset(inuse, 1, sizeof(inuse));
#endif
- for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
- put_free_entry(i);
gnttab_table = arch_init_gnttab(NR_GRANT_FRAMES);
printk("gnttab_table mapped at %p.\n", gnttab_table);
+
+ for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
+ if (gnttab_table[i].flags == 0)
+ put_free_entry(i);
}
void
--
2.43.0