>>> On 12.09.16 at 10:16, <dongli.zh...@oracle.com> wrote: > This patch cleaned up the code by replacing complicated tlbflush check with > an inline function. We should use this inline function to avoid the long > and complicated to read tlbflush check when implementing TODOs left in > commit a902c12ee45fc9389eb8fe54eeddaf267a555c58.
> --- a/xen/include/xen/mm.h > +++ b/xen/include/xen/mm.h > @@ -567,4 +567,15 @@ int prepare_ring_for_helper(struct domain *d, unsigned > long gmfn, > struct page_info **_page, void **_va); > void destroy_ring_for_helper(void **_va, struct page_info *page); > > +static inline int page_needs_tlbflush(struct page_info *page, bool and const please. > + bool_t need_tlbflush, bool But really passing this into a function with this name is kind of awkward. Perhaps a better function name would be e.g. accumulate_tlbflush(), and then this parameter would maybe better be the first one. > + uint32_t tlbflush_timestamp, > + uint32_t tlbflush_current_time) I don't think you should pass this into the function ... > +{ > + return page->u.free.need_tlbflush && > + page->tlbflush_timestamp <= tlbflush_current_time && ... and use tlbflush_current_time() here instead. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel