[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH V4 10/11] xen/arm: io: Use binary search for mmio handler lookup
Hello Shanker, On 15/07/16 03:35, Shanker Donthineni wrote: On 07/14/2016 11:46 AM, Julien Grall wrote: [...] +{ + struct vmmio *vmmio = &v->domain->arch.vmmio; + struct mmio_handler key = {.addr = gpa};I know it is not currently the case, but should not we take into account the size of the access?I agree with you, we definitely need to consider size of the access for traps/emulation drivers similar to what Linux KVM code does currently. Do you know which emulation drivers are using non aligned accesses? Sorry, I don't understand your question. + const struct mmio_handler *handler; + read_lock(&vmmio->lock); + handler = bsearch(&key, vmmio->handlers, vmmio->num_entries, + sizeof(*handler), cmp_mmio_handler); read_unlock(&vmmio->lock); return handler; [...] @@ -131,6 +135,10 @@ void register_mmio_handler(struct domain *d, vmmio->num_entries++; + /* Sort mmio handlers in ascending order based on base address */ + sort(vmmio->handlers, vmmio->num_entries, sizeof(struct mmio_handler), + cmp_mmio_handler, NULL);The indentation looks wrong here.I don't quite understand what you mean. It has 8 spaces, do I need more than 8 spaces or something else? If the list of arguments is on multiples lines, the lines should be aligned to the first arguments. I.e: sort(foo, bar, fish); Your editor should already do it. Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |