libs/guest: don't use unsigned long as type for PFNs
PATCH 1/1 libs/guest: don't use unsigned long as type for PFNs
Declarations of xc_dom_console_init() and xc_dom_console_set_disconnected() in libxenguest.h don't match their implementation in the library.
Use xen_pfn_t for PFNs in the library to fix that.
--- tools/libs/guest/xg_dom_boot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/libs/guest/xg_dom_boot.c +3 -3
@@ -430,7 +430,7 @@ int xc_dom_gnttab_init(struct xc_dom_image *dom)static int dom_console_init (xc_interface *xch,uint32_t domid, -unsigned long dst_pfn, +xen_pfn_t dst_pfn,bool clear) {const size_t size =PAGE_SIZE ;
@@ -451,14 +451,14 @@ static int dom_console_init(xc_interface *xch,int xc_dom_console_init (xc_interface *xch,uint32_t domid, -unsigned long dst_pfn) +xen_pfn_t dst_pfn) {return dom_console_init (xch, domid, dst_pfn, true); }int xc_dom_console_set_disconnected (xc_interface *xch,uint32_t domid, -unsigned long dst_pfn) +xen_pfn_t dst_pfn) {return dom_console_init (xch, domid, dst_pfn, false); }
Signature · 1 line
2.51.0
Quoted 3 lines · Juergen Gross
Declarations of
xc_dom_console_init()andxc_dom_console_set_disconnected()inlibxenguest.hdon't match their implementation in the library.
"Under arm32, xen_pfn_t is a uint64_t and wider than unsigned long."
Quoted 7 lines
Use
xen_pfn_tfor PFNs in the library to fix that.Fixes b6fc307b0b00 ("libs/guest: Set console as disconnected on resume")Fixes 971b7d5ecbcd ("libs/guest: Set console page to disconnected")Reported-by Luca Fancellu <[email protected]>Signed-off-by Juergen Gross <[email protected]>
For this patch, Reveiwed-by: Andrew Cooper <[email protected]>
However, another bug in these patches is the use of pfn. gfn is the correct term to be using.
~Andrew
Hi Jurgen,
Quoted 6 lines · Juergen Gross
Declarations of
xc_dom_console_init()andxc_dom_console_set_disconnected()inlibxenguest.hdon't match their implementation in the library.
Quoted 6 lines
Use
xen_pfn_tfor PFNs in the library to fix that.Fixes b6fc307b0b00 ("libs/guest: Set console as disconnected on resume")Fixes 971b7d5ecbcd ("libs/guest: Set console page to disconnected")Reported-by Luca Fancellu <[email protected]>Signed-off-by Juergen Gross <[email protected]>
Thanks for the quick patch, I’ve built the arm32 configuration and this solves the compilation issue.
Cheers,
Luca