x86/mm: set_p2m_entry() should return 0 on error
PATCH 1/1 x86/mm: set_p2m_entry() should return 0 on error
set_p2m_entry() ignores halfway errors.
It should return 0 on error, shouldn't it?
Signed-off-by Kouya Shimura <[email protected]>
xen/arch/x86/mm/p2m.c +3 -2
@@ -1497,7 +1497,7 @@ int set_p2m_entry(struct domain *d, unsi {unsigned long todo =1ul << page_order;unsigned int order; -int rc =0 ; +int rc =1 ;while ( todo ) {
@@ -1506,7 +1506,8 @@ int set_p2m_entry(struct domain *d, unsi 9 : 0; else order =0 ; - rc = d->arch.p2m->set_entry (d, gfn, mfn, order, p2mt); +if ( !d->arch.p2m->set_entry (d, gfn, mfn, order, p2mt) ) + rc =0 ; gfn +=1ul << order;if (mfn_x (mfn) !=INVALID_MFN ) mfn =_mfn (mfn_x (mfn) + (1ul << order));
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · Kouya Shimura
set_p2m_entry()ignores halfway errors.
It should return 0 on error, shouldn't it?Signed-off-by Kouya Shimura <[email protected]>
Needs an Ack from Tim.
-- Keir
Quoted 2 lines · Kouya Shimura
set_p2m_entry()ignores halfway errors.
It should return 0 on error, shouldn't it?
Since all of its callers discard the return value, it hardly matters. :( But yes, this patch makes the semantics more sensible.
Quoted 1 line
Signed-off-by Kouya Shimura <[email protected]>
Acked-by Tim Deegan <[email protected]>
Signature · 3 lines
Tim Deegan <[email protected]> Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]