rangeset: make inquiry functions tolerate NULL inputs
PATCH 1/1 rangeset: make inquiry functions tolerate NULL inputs
Rather than special casing the ->iomem_caps check in x86's get_page_from_l1e() for the dom_xen case, let's be more tolerant in general, along the lines of rangeset_is_empty(): A never allocated rangeset can't possibly contain or overlap any range.
xen/common/rangeset.c +6 -0
@@ -256,6 +256,9 @@ bool_t rangeset_contains_range(ASSERT (s <= e); +if ( !r ) +return false; +read_lock (&r->lock); x =find_range (r, s); contains = (x && (x->e >= e));
@@ -272,6 +275,9 @@ bool_t rangeset_overlaps_range(ASSERT (s <= e); +if ( !r ) +return false; +read_lock (&r->lock); x =find_range (r, e); overlaps = (x && (s <= x->e));
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Jan Beulich
Rather than special casing the ->iomem_caps check in x86's
get_page_from_l1e()for thedom_xencase, let's be more tolerant in general, along the lines ofrangeset_is_empty(): A never allocated rangeset can't possibly contain or overlap any range.Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>
LGTM:
As said in the commit message, this is done to avoid an extra check in get_page_from_l1e I assume, so should the extra check also be dropped here?
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 17.08.18 at 11:29, <[email protected]> wrote:
Quoted 5 lines · Jan Beulich
Rather than special casing the ->iomem_caps check in x86's
get_page_from_l1e()for thedom_xencase, let's be more tolerant in general, along the lines ofrangeset_is_empty(): A never allocated rangeset can't possibly contain or overlap any range.
Quoted 6 lines
Quoted 2 lines
Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>LGTM:
Reviewed-by Roger Pau Monné <[email protected]>
Thanks.
Quoted 3 lines
As said in the commit message, this is done to avoid an extra check in
get_page_from_l1eI assume, so should the extra check also be dropped here?
I'm afraid I don't understand: I indeed mean to avoid adding a NULL check in get_page_from_l1e(). But what check are you thinking of that could be dropped? Or in other words, what is "here" in your reply?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 9 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 17.08.18 at 11:29, <[email protected]> wrote:
As said in the commit message, this is done to avoid an extra check in
get_page_from_l1eI assume, so should the extra check also be dropped here?I'm afraid I don't understand: I indeed mean to avoid adding a NULL check in
get_page_from_l1e(). But what check are you thinking of that could be dropped? Or in other words, what is "here" in your reply?
Oh, I understand now, this is to prevent adding a check, not to remove a check that's already in the code.
'here' meant the patch, since I wrongly assumed that this was to remove a check that was already in the code base.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Jan Beulich
Rather than special casing the ->iomem_caps check in x86's
get_page_from_l1e()for thedom_xencase, let's be more tolerant in general, along the lines ofrangeset_is_empty(): A never allocated rangeset can't possibly contain or overlap any range.Reported-by Andrew Cooper <[email protected]>Signed-off-by Jan Beulich <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel