[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V9] xen/vm_event: Clean up control-register-write vm_events and add XCR0 event
On Wed, Jun 3, 2015 at 3:48 PM, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx> wrote: On 06/03/2015 04:29 PM, Lengyel, Tamas wrote: Right now if you want to access a bit using the index on the ctrlreg fields, you would for example do (monitor.write_ctrlreg_enabled & index). This is actually going to perform two bitmask operations. First, monitor.write_ctrlreg_enabled does a masking operating to get you only the 4 bits corresponding to this field, then you do another mask with the index. In general bitmasks are pretty slow operations, thus IMHO minimizing them would be ideal. What I meant by doing a uint8_t separately would be like "uint8_t write_ctrlreg_enabled;" which would eliminate the first bitmask operation. You would have to do that for the other two bitfields as well, write_ctrlreg_sync and write_ctrlreg_onchangeonly. The trade-off with this is that now we will have 12 bits that are not used for anything (yet). On the other hand this way we could also reduce the size of the remaining bitfield from uint16_t to uint8_t, so IMHO it's not that big of an issue. Â
I'm fine with having the index-based bitfield approach, don't get me wrong. This is about how those bitfields are stored. Â
Sorry for the last minute addition here, I know you want to close this patch now that you have the acks on it. If the maintainers don't share my concern here then feel free to ignore it ;) Cheers! --
Tamas K Lengyel Senior Security Researcher 7921 Jones Branch Drive McLean VA 22102 Email Âtlengyel@novetta.com _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |