[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mini-os master] mini-os: grants: support populated grant table at boot



commit be52abb4615196d36bdf060f493971fcdfe0844b
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Jul 9 16:41:55 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jul 9 16:41:55 2025 +0200

    mini-os: grants: support populated grant table at boot
    
    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@xxxxxxxx>
    Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
 gnttab.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnttab.c b/gnttab.c
index 8168ed5..5b04ab0 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
--
generated by git-patchbot for /home/xen/git/mini-os.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.