x86/MCFG: fix off-by-one in E820 check
PATCH 1/1 x86/MCFG: fix off-by-one in E820 check
Also adjust the comment ahead of e820_all_mapped() to clarify that the range is not inclusive at its end.
xen/arch/x86/e820.c +1 -1
@@ -38,7 +38,7 @@ struct e820map e820;struct e820map __initdata e820_raw;/* -* This function checks if the entire range <start,end> is mapped with type. +* This function checks if the entire range [start,end) is mapped with type. * * Note: this function only works correct if the e820 table is sorted and * not-overlapping, which is the case
xen/arch/x86/x86_64/mmconfig-shared.c +1 -1
@@ -337,7 +337,7 @@ static int __init is_mmconf_reserved(u64 old_size = size;int valid =0 ; -while (!e820_all_mapped (addr, addr + size -1 ,E820_RESERVED )) { +while (!e820_all_mapped (addr, addr + size,E820_RESERVED )) { size >>=1 ;if (size < (16UL <<20 ))break ;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Jan Beulich
Also adjust the comment ahead of
e820_all_mapped()to clarify that the range is not inclusive at its end.Reported-by Roger Pau Monné <[email protected]>Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/e820.c struct e820map e820; · line 41
Quoted 9 lines
xen/arch/x86/e820.c +1
-1@@ -38,7 +38,7 @@ struct e820map e820;struct e820map __initdata e820_raw;/* -* This function checks if the entire range <start,end> is mapped with type. +* This function checks if the entire range [start,end) is mapped with type.
There is another instance of <> inside e820_all_mapped. It would be good if that's fixed too.
Quoted 6 lines
xen/arch/x86/e820.c +0
-0* * Note: this function only works correct if the e820 table is sorted and * not-overlapping, which is the case
xen/arch/x86/x86_64/mmconfig-shared.c static int __init is_mmconf_reserved( · line 343
Quoted 8 lines
xen/arch/x86/x86_64/mmconfig-shared.c +1
-1@@ -337,7 +337,7 @@ static int __init is_mmconf_reserved(u64 old_size = size;int valid =0 ; -while (!e820_all_mapped (addr, addr + size -1 ,E820_RESERVED )) { +while (!e820_all_mapped (addr, addr + size,E820_RESERVED )) { size >>=1 ;if (size < (16UL <<20 ))break ;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · Wei Liu
Quoted 5 lines · Jan Beulich
Also adjust the comment ahead of
e820_all_mapped()to clarify that the range is not inclusive at its end.Reported-by Roger Pau Monné <[email protected]>Signed-off-by Jan Beulich <[email protected]>Reviewed-by Wei Liu <[email protected]>
Thanks.
Quoted 11 lines
xen/arch/x86/e820.c struct e820map e820; · line 41
Quoted 8 lines
xen/arch/x86/e820.c +1
-1@@ -38,7 +38,7 @@ struct e820map e820;struct e820map __initdata e820_raw;/* -* This function checks if the entire range <start,end> is mapped with type. +* This function checks if the entire range [start,end) is mapped with type. There is another instance of <> inside
e820_all_mapped. It would be good if that's fixed too.
That one isn't misleading (talking about just the start of the region), so I left it alone. But since you've asked for it - fixed.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 9 lines · Jan Beulich
Also adjust the comment ahead of
e820_all_mapped()to clarify that the range is not inclusive at its end.Reported-by Roger Pau Monné <[email protected]>Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/e820.c struct e820map e820; · line 43
Quoted 7 lines
xen/arch/x86/e820.c +1
-1@@ -38,7 +38,7 @@ struct e820map e820;struct e820map __initdata e820_raw;/* -* This function checks if the entire range <start,end> is mapped with type. +* This function checks if the entire range [start,end) is mapped with type. * * Note: this function only works correct if the e820 table is sorted and
Wouldn't mind if you took the opportunity to also s/correct/correctly/ in the sentence above.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel