xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* x86: gnttab_clear_flag() abusing clear_bit()
@ 2012-02-06 17:06 Jan Beulich
  2012-02-07 10:34 ` [PATCH, RFC] " Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2012-02-06 17:06 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

Back in c/s 17194:af33f2054f47 bitops got restricted to 4-bytes and
larger operands only. gnttab_clear_flag() cheats in casting a uint16_t *
to unsigned long * - how is that not a problem in the context of the
goal that said c/s set, in particular for v2 of the interface? (Given that
this is being implemented as arch-specific routine - so far for reasons
that escape me - this should be simple to fix by using inline assembly
rather than clear_bit().)

Further I just spotted one instance where the or of two bit positions
gets passed to this function - that's quite definitely a bug I would say.

And, quite the opposite, __fixup_status_for_pin() ands out the
negation of bit positions rather than masks... (Which also raises
the question whether it really would need to be clear_bit() above
instead of the cheaper __clear_bit().)

Thanks, Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-09 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 17:06 x86: gnttab_clear_flag() abusing clear_bit() Jan Beulich
2012-02-07 10:34 ` [PATCH, RFC] " Jan Beulich
2012-02-07  5:10   ` Keir Fraser
2012-02-09  9:01     ` Jan Beulich
2012-02-09 12:33       ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).