All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: shankerd@codeaurora.org,
	xen-devel <xen-devel@lists.xensource.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: Philip Elcan <pelcan@codeaurora.org>,
	Vikram Sethi <vikrams@codeaurora.org>
Subject: Re: [PATCH V4 10/11] xen/arm: io: Use binary search for mmio handler lookup
Date: Fri, 15 Jul 2016 10:52:52 +0100	[thread overview]
Message-ID: <5788B274.2090506@arm.com> (raw)
In-Reply-To: <57884C08.3060104@codeaurora.org>

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@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-15  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 16:17 [PATCH V4 08/11] arm/io: Use separate memory allocation for mmio handlers Shanker Donthineni
2016-07-14 16:18 ` [PATCH V4 10/11] xen/arm: io: Use binary search for mmio handler lookup Shanker Donthineni
2016-07-14 16:46   ` Julien Grall
2016-07-15  2:35     ` Shanker Donthineni
2016-07-15  9:52       ` Julien Grall [this message]
2016-07-15 13:18       ` Shanker Donthineni
2016-07-14 16:18 ` [PATCH V4 11/11] arm/vgic: Change fixed number of mmio handlers to variable number Shanker Donthineni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5788B274.2090506@arm.com \
    --to=julien.grall@arm.com \
    --cc=pelcan@codeaurora.org \
    --cc=shankerd@codeaurora.org \
    --cc=sstabellini@kernel.org \
    --cc=vikrams@codeaurora.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.