[Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table()

Julien Grall posted 1 patch 4 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200225132558.26152-1-julien@xen.org
There is a newer version of this series
xen/common/grant_table.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table()
Posted by Julien Grall 4 years, 1 month ago
One of the warning message in gnttab_grow_table() refers to a function
was removed in commit 6425f91c72 "xen/gnttab: Fold grant_table_{create,
set_limits}() into grant_table_init()".

Since the commit, gt->active will be allocated while initializing the
grant table at domain creation. Therefore gt-active will always be
valid.

Rather than replacing the warning by another one, we can now downgrade
the check to an ASSERT().

Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 xen/common/grant_table.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index bc37acae0e..930d20b346 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1793,11 +1793,7 @@ gnttab_grow_table(struct domain *d, unsigned int req_nr_frames)
     struct grant_table *gt = d->grant_table;
     unsigned int i, j;
 
-    if ( unlikely(!gt->active) )
-    {
-        gprintk(XENLOG_WARNING, "grant_table_set_limits() call missing\n");
-        return -ENODEV;
-    }
+    ASSERT(gt->active);
 
     if ( req_nr_frames < INITIAL_NR_GRANT_FRAMES )
         req_nr_frames = INITIAL_NR_GRANT_FRAMES;
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table()
Posted by Andrew Cooper 4 years, 1 month ago
On 25/02/2020 13:25, Julien Grall wrote:
> One of the warning message in gnttab_grow_table() refers to a function
> was removed in commit 6425f91c72 "xen/gnttab: Fold grant_table_{create,
> set_limits}() into grant_table_init()".
>
> Since the commit, gt->active will be allocated while initializing the
> grant table at domain creation. Therefore gt-active will always be
> valid.
>
> Rather than replacing the warning by another one, we can now downgrade
> the check to an ASSERT().
>
> Signed-off-by: Julien Grall <jgrall@amazon.com>

TBH, I'd drop the assert.  As you identify, its not helpful, and there
is no chance we're moving back to a semi-not-initialised-yet world.

Either way, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table()
Posted by Jan Beulich 4 years, 1 month ago
On 25.02.2020 14:29, Andrew Cooper wrote:
> On 25/02/2020 13:25, Julien Grall wrote:
>> One of the warning message in gnttab_grow_table() refers to a function
>> was removed in commit 6425f91c72 "xen/gnttab: Fold grant_table_{create,
>> set_limits}() into grant_table_init()".
>>
>> Since the commit, gt->active will be allocated while initializing the
>> grant table at domain creation. Therefore gt-active will always be
>> valid.
>>
>> Rather than replacing the warning by another one, we can now downgrade
>> the check to an ASSERT().
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> TBH, I'd drop the assert.

+1 fwiw

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] xen/grant-table: Remove outdated warning in gnttab_grow_table()
Posted by Julien Grall 4 years, 1 month ago

On 25/02/2020 13:29, Andrew Cooper wrote:
> On 25/02/2020 13:25, Julien Grall wrote:
>> One of the warning message in gnttab_grow_table() refers to a function
>> was removed in commit 6425f91c72 "xen/gnttab: Fold grant_table_{create,
>> set_limits}() into grant_table_init()".
>>
>> Since the commit, gt->active will be allocated while initializing the
>> grant table at domain creation. Therefore gt-active will always be
>> valid.
>>
>> Rather than replacing the warning by another one, we can now downgrade
>> the check to an ASSERT().
>>
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> TBH, I'd drop the assert.  As you identify, its not helpful, and there
> is no chance we're moving back to a semi-not-initialised-yet world.

I will drop the ASSERT then and resend the patch.

> 
> Either way, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Cheers,


-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel