From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
vijay.kilari@gmail.com
Cc: Ian.Campbell@citrix.com, Prasun.Kapoor@caviumnetworks.com,
Vijaya Kumar K <vijaya.kumar@caviumnetworks.com>,
tim@xen.org, xen-devel@lists.xen.org,
stefano.stabellini@citrix.com, manish.jaggi@caviumnetworks.com
Subject: Re: [RFC PATCH 14/19] xen/arm: vits: Map ITS translation space
Date: Tue, 03 Mar 2015 17:41:00 +0000 [thread overview]
Message-ID: <54F5F22C.3060401@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1503031730010.15212@kaball.uk.xensource.com>
On 03/03/15 17:31, Stefano Stabellini wrote:
> On Mon, 2 Mar 2015, vijay.kilari@gmail.com wrote:
>> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>>
>> ITS translation space contains GITS_TRANSLATOR
>> register which is written by device to raise
>> LPI. This space needs to mapped to every domain
>> address space so that device can access GITS_TRANSLATOR
>> register using SMMU
>>
>> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
>> ---
>> xen/arch/arm/vgic-v3-its.c | 33 +++++++++++++++++++++++++++++++--
>> 1 file changed, 31 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
>> index 48c880a..e7e587e 100644
>> --- a/xen/arch/arm/vgic-v3-its.c
>> +++ b/xen/arch/arm/vgic-v3-its.c
>> @@ -1504,7 +1504,35 @@ static const struct mmio_handler_ops vgic_gits_mmio_handler = {
>> .write_handler = vgic_v3_gits_mmio_write,
>> };
>>
>> -int vgic_its_domain_init(struct domain *d)
>> +/*
>> + * Map the 64K ITS translation space in guest.
>> + * This is required purely for device smmu writes.
>> + */
>> +
>> +static int vgic_map_translation_space(struct domain *d)
>> +{
>> + u64 addr, size;
>> + int ret;
>> + addr = d->arch.vits->phys_base + SZ_64K;
>> + size = SZ_64K;
>> +
>> + ret = map_mmio_regions(d,
>> + paddr_to_pfn(addr & PAGE_MASK),
>> + DIV_ROUND_UP(size, PAGE_SIZE),
>> + paddr_to_pfn(addr & PAGE_MASK));
>> +
>> + if ( ret )
>> + {
>> + printk(XENLOG_ERR "Unable to map to dom%d access to"
>> + " 0x%"PRIx64" - 0x%"PRIx64"\n",
>> + d->domain_id,
>> + addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
>> + }
>> +
>> + return ret;
>> +}
>
> Although we might want to map it 1:1 anyway, I think that this function
> should be able to cope with a virtual GITS_TRANSLATOR address different
> from the physical translator address.
FWIW, a 1:1 mapping won't work for guest.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-03-03 17:41 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 12:30 [RFC PATCH 00/19] xen/arm: Add ITS support vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 01/19] xen/arm: add linked list apis vijay.kilari
2015-03-02 13:21 ` Jan Beulich
2015-03-02 12:30 ` [RFC PATCH 02/19] xen/arm: its: Import GICv3 ITS driver from linux vijay.kilari
2015-03-13 10:24 ` Julien Grall
2015-03-13 10:35 ` Julien Grall
2015-03-16 9:55 ` Vijay Kilari
2015-03-16 10:12 ` Stefano Stabellini
2015-03-16 13:04 ` Julien Grall
2015-03-16 13:15 ` Julien Grall
2015-03-16 13:32 ` Vijay Kilari
2015-03-02 12:30 ` [RFC PATCH 03/19] xen/arm: its: Port ITS driver to xen vijay.kilari
2015-03-13 11:46 ` Julien Grall
2015-03-16 14:06 ` Vijay Kilari
2015-03-16 14:20 ` Julien Grall
2015-03-16 16:03 ` Vijay Kilari
2015-03-16 16:18 ` Julien Grall
2015-03-02 12:30 ` [RFC PATCH 04/19] xen/arm: its: Move ITS command encode helper functions vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 05/19] xen/arm: its: Remove unused code in ITS driver vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 06/19] xen/arm: its: Add helper functions to decode ITS Command vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 07/19] xen/arm: vits: Move LPI handling to basic virtual its driver vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 08/19] xen/arm: Add helper function to get domain page vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 09/19] xen/arm: Update irq descriptor for LPIs support vijay.kilari
2015-03-02 14:17 ` Julien Grall
2015-03-03 17:54 ` Stefano Stabellini
2015-03-02 12:30 ` [RFC PATCH 10/19] xen/arm: its: Add virtual ITS command support vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 11/19] xen/arm: its: Add emulation of ITS control registers vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 12/19] xen/arm: its: Add support to emulate GICR register for LPIs vijay.kilari
2015-03-03 17:16 ` Stefano Stabellini
2015-03-04 12:10 ` Stefano Stabellini
2015-03-02 12:30 ` [RFC PATCH 13/19] xen/arm: its: implement hw_irq_controller " vijay.kilari
2015-03-03 17:28 ` Stefano Stabellini
2015-03-09 13:03 ` Vijay Kilari
2015-03-09 16:09 ` Stefano Stabellini
2015-03-09 16:32 ` Vijay Kilari
2015-03-02 12:30 ` [RFC PATCH 14/19] xen/arm: vits: Map ITS translation space vijay.kilari
2015-03-03 17:31 ` Stefano Stabellini
2015-03-03 17:41 ` Julien Grall [this message]
2015-03-02 12:30 ` [RFC PATCH 15/19] xen/arm: gicv3: Refactor redistributor information vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 16/19] xen/arm: its: Dynamic allocation of LPI descriptors vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 17/19] xen/arm: its: Support ITS interrupt handling vijay.kilari
2015-03-03 18:07 ` Stefano Stabellini
2015-03-03 19:49 ` Julien Grall
2015-03-04 9:57 ` Stefano Stabellini
2015-03-02 12:30 ` [RFC PATCH 18/19] xen/arm: its: Generate ITS node for Dom0 vijay.kilari
2015-03-02 12:30 ` [RFC PATCH 19/19] xen/arm: its: Initialize virtual and physical ITS driver vijay.kilari
2015-03-02 13:19 ` [RFC PATCH 00/19] xen/arm: Add ITS support Julien Grall
2015-03-03 3:55 ` Vijay Kilari
2015-03-03 11:43 ` Julien Grall
2015-03-09 12:57 ` Vijay Kilari
2015-03-09 16:06 ` Stefano Stabellini
2015-03-09 18:16 ` Julien Grall
2015-03-13 4:48 ` Vijay Kilari
2015-03-13 10:13 ` Julien Grall
2015-03-16 10:30 ` Vijay Kilari
2015-03-02 14:53 ` Ian Campbell
2015-03-02 17:39 ` Ian Campbell
2015-03-03 4:02 ` Vijay Kilari
2015-03-03 10:07 ` Ian Campbell
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=54F5F22C.3060401@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=manish.jaggi@caviumnetworks.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=vijay.kilari@gmail.com \
--cc=vijaya.kumar@caviumnetworks.com \
--cc=xen-devel@lists.xen.org \
/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.