From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 01/15] xen/arm: register mmio handler at runtime Date: Tue, 08 Apr 2014 11:25:55 +0100 Message-ID: <5343CEB3.6060705@linaro.org> References: <1396612593-443-1-git-send-email-vijay.kilari@gmail.com> <1396612593-443-2-git-send-email-vijay.kilari@gmail.com> <533EA307.4000900@linaro.org> <533ECF5F.1040403@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 04/08/2014 07:35 AM, Vijay Kilari wrote: > On Fri, Apr 4, 2014 at 8:57 PM, Julien Grall wrote: >> On 04/04/2014 04:24 PM, Vijay Kilari wrote: >> >>>>> As I said on the previous version, it would be nice to remove check >>>>> callback in the mmio_handler and replace it by addr/size. It's better if >>>>> we might want to change the place in the memory following the guest. >>>>> >>>>> So the result function would be: >>>>> >>>>> register_mmio_handler(struct domain *d, read_t read, write_t write, >>>>> addr, size); >>>>> >>>> OK. >>> Though you suggested, I kept this check handler because it gives flexibility >>> for driver to make additional checks if required apart from just checking for >>> address range. >> >> What kind of checks? If the handler is registered to a domain that means >> we want to use it, right? It would seem strange to trap once a while. > > IMO, with check handler it will give more flexibility for driver to > various kinds of checks. > Ex: Driver wants to check for multiple addr ranges etc., >>From driver POV it's easier to have one range by set of callbacks rather than multiple range. Because you will end up to check in 2 place the address (once in check and once in read/write callback). You don't use this feature in your code and I don't think it will be use, so I would prefer to get a rid of check and let handle_mmio do the job for us. Regards, -- Julien Grall