From: Julien Grall <julien.grall@citrix.com>
To: Vijay Kilari <vijay.kilari@gmail.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
manish.jaggi@caviumnetworks.com,
Julien Grall <julien.grall@linaro.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Julien Grall <julien.grall@citrix.com>,
Stefano Stabellini <stefano.stabellini@citrix.com>
Subject: Re: Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling)
Date: Mon, 25 May 2015 14:44:07 +0200 [thread overview]
Message-ID: <55631917.80800@citrix.com> (raw)
In-Reply-To: <CALicx6vE_Epd=i4Jf3VE=JDYcQHuPeeMtHrYKZp3-2qSGjPTdg@mail.gmail.com>
Hi,
On 25/05/2015 12:40, Vijay Kilari wrote:
> On Mon, May 25, 2015 at 3:02 PM, Julien Grall
> <julien.grall.oss@gmail.com> wrote:
>>
>>
>> On 25/05/2015 11:06, Vijay Kilari wrote:
>>>
>>> On Sun, May 24, 2015 at 4:05 PM, Julien Grall <julien.grall@citrix.com>
>>> wrote:
>>>>>
>>>>> 1) Command translation:
>>>>> -----------------------------------
>>>>>
>>>>> - ITS commands contains device ID, Event ID (vID), Collection ID
>>>>> (vCID), Target Address (vTA)
>>>>> parameters
>>>>> - All these parameters should be validated
>>>>> - These parameters should be translated from Virtual to Physical
>>>>>
>>>>> Of the existing GICv3 ITS commands, MAPC, MAPD, MAPVI/MAPI are the time
>>>>> consuming commands as these commands creates entry in the Xen ITS
>>>>> structures,
>>>>> which are used to validate other ITS commands.
>>>>>
>>>>> 1.1 MAPC command translation
>>>>> -----------------------------------------------
>>>>> Format: MAPC vCID, vTA
>>>>>
>>>>> - vTA is validated against Re-distributor address by searching
>>>>> Redistributor region /
>>>>> CPU number based on GITS_TYPER.PAtype and Physical Collection
>>>>> ID & Physical
>>>>> Target address are retrieved
>>>>> - Each vITS will have cid_map (struct cid_mapping) which holds
>>>>> mapping of
>>>>> Virtual Collection ID, Virtual Targets address and Physical
>>>>> Collection ID.
>>>>> - MAPC pCID, pTA physical ITS command is generated
>>>>>
>>>>> Here there is no overhead, the cid_map entries (approx 32 entries)
>>>>> are preallocated when
>>>>> vITS is created.
>>>>
>>>>
>>>>
>>>> How did you decide the 32 entries? The ITS must at least provide N + 1
>>>> collection when N is the number of processors.
>>>
>>>
>>> It should be MAX_VIRT_VCPUS.
>>
>>
>> Why not allocating dynamically rather than wasting memory?
>>
>>>>
>>>> Also, how do you handle collection re-mapping?
>>>
>>>
>>> There is one collection per cpu. The vTA of MAPC should fall within
>>> vcpus range (GITS_TYPE.PTAtype is 0).
>>
>>
>> It's not what I asked...
>>
>>> In case of remapping, if the vCID does not exists in cid_map,
>>> then new entry is made (vCID, pCID, vTA)
>>>
>>> If vCID exists, the existing entry is updated with pCID, vTA
>>>
>>> However this cid_map should be used to inject to right pCPU where
>>> vCPU is running.
>>
>>
>> What do you mean by injecting? The MAPC should never be injected to the
>> physical CPU. As I said earlier, the collection is shared with all the vCPU
>> and Xen.
>>
>
> It does not mean MAPC is sent to physical CPU,
>
> All interrupts mapped to collection are taken on cpus 0 to nr_vcpus.
> when vCID is mapped to pCID, all pCID fall in the range of 0 to nr_vcpus
vCID can be higher than the number of VCPUs (the vITS has to support
nr_vcpus + 1 collection).
Also, the number of physical collection may be lower than the virtual
collection because the user created a guest with num vCPUs > num pCPU.
> So, irrespective of vcpus running on physical cpus all interrupts are routed
> to pCPU 0 to nr_vcpus
>
> Similar to below patch done for SPIs. LPIs should also be injected.
I know that LPIs should be injected...
>
> http://lists.xen.org/archives/html/xen-devel/2014-09/msg04176.html
>
> Correct me if I have not understood your question correctly.
AFAIU your proposal, the function mapping(vCID) will always return the
same pCID, right?
[..]
>>>> What about device remapping?
>>>
>>>
>>> IMO, device cannot be remapped. It has to removed (MAPD with valid bit 0)
>>> so that ITS HW can remove the entries and added with new MAPD command.
>>
>>
>> Your opinion is not the spec...
>>
>> Device remapping is allowed by the spec (see 4.9.18 "Re-mapping and
>> Un-mapping devices in PRD03-GENC-010745 24.0). So even it's not possible
>> (with a spec ref in proof), you have to protect it...
>
> I am no saying that is my opinion, I mean the same as told in 4.9.18,
IMO === In My Opinion... I can't guess that you were talking about 4.9.18.
> To unmap the device, the MAPD should be sent with valid bit 0, which will
s/unmap/re-map/ ?
> remove the device from the list and added again on MAPD with valid bit 1
I can't see where the spec says that 2 MAPD (one with V=1 and the other
with V=0) is required. The section 4.9.18 contains an 'or':
"Issue a mapping command (MAPD; see section 5.13.11) or an un-mapping
command"
This is related to "Interrupts can be re-mapped or un-mapped".
4.9.18 and 5.13.11 (PRD03-GENC-010745 24.0) are only speaking about a
single MAPD:
"Note: software might issue a MAPD command to re-map an already mapped
device and the ITS must invalidate all cached data for that device."
>>
>> new pID may not be re-generated but there is some care to take when an vID
>> is remapped. (see 4.9.17 "Re-mapping and Un-mapping Interrupts" in
>> PRD03-GENC-010745 24.0).
>>
>>> If vCID is changed, a new pCID is generated based on MAPC command
>>
>>
>> Which is wrong...
>
> When you say vID is remapped, then vCID should be different right?
Yes. I was confuse by "MAPC command" at the end.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-05-25 12:44 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 12:14 Xen/arm: Virtual ITS command queue handling Vijay Kilari
2015-05-05 13:51 ` Stefano Stabellini
2015-05-05 13:54 ` Julien Grall
2015-05-05 15:56 ` Vijay Kilari
2015-05-05 14:09 ` Julien Grall
2015-05-05 16:09 ` Vijay Kilari
2015-05-05 16:27 ` Julien Grall
2015-05-12 15:02 ` Ian Campbell
2015-05-12 17:35 ` Julien Grall
2015-05-13 13:23 ` Ian Campbell
2015-05-13 14:26 ` Julien Grall
2015-05-15 10:59 ` Ian Campbell
2015-05-15 11:26 ` Vijay Kilari
2015-05-15 11:30 ` Ian Campbell
2015-05-15 12:03 ` Julien Grall
2015-05-15 12:47 ` Vijay Kilari
2015-05-15 12:52 ` Julien Grall
2015-05-15 12:53 ` Ian Campbell
2015-05-15 13:14 ` Vijay Kilari
2015-05-15 13:24 ` Ian Campbell
2015-05-15 13:44 ` Julien Grall
2015-05-15 14:04 ` Vijay Kilari
2015-05-15 15:05 ` Julien Grall
2015-05-15 15:38 ` Ian Campbell
2015-05-15 17:31 ` Julien Grall
2015-05-16 4:03 ` Vijay Kilari
2015-05-16 8:49 ` Julien Grall
2015-05-19 11:38 ` Vijay Kilari
2015-05-19 11:48 ` Ian Campbell
2015-05-19 11:55 ` Ian Campbell
2015-05-19 12:10 ` Vijay Kilari
2015-05-19 12:19 ` Ian Campbell
2015-05-19 12:48 ` Vijay Kilari
2015-05-19 13:12 ` Ian Campbell
2015-05-19 14:05 ` Julien Grall
2015-05-19 14:48 ` Ian Campbell
2015-05-19 15:44 ` Julien Grall
2015-05-15 14:05 ` Ian Campbell
2015-05-15 12:19 ` Julien Grall
2015-05-15 12:58 ` Ian Campbell
2015-05-15 13:24 ` Julien Grall
2015-05-19 12:14 ` Ian Campbell
2015-05-19 13:27 ` Julien Grall
2015-05-19 13:36 ` Ian Campbell
2015-05-19 13:46 ` Julien Grall
2015-05-19 13:54 ` Ian Campbell
2015-05-19 14:04 ` Vijay Kilari
2015-05-19 14:18 ` Ian Campbell
2015-05-21 12:37 ` Manish Jaggi
2015-05-26 13:04 ` Ian Campbell
2015-06-01 22:57 ` Manish Jaggi
2015-06-02 8:29 ` Ian Campbell
2015-05-19 14:06 ` Julien Grall
2015-05-13 16:27 ` Vijay Kilari
2015-05-15 11:28 ` Ian Campbell
2015-05-15 12:38 ` Vijay Kilari
2015-05-15 13:06 ` Ian Campbell
2015-05-15 13:17 ` Julien Grall
2015-05-15 11:45 ` Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling) Ian Campbell
2015-05-15 14:55 ` Julien Grall
2015-05-19 12:10 ` Ian Campbell
2015-05-19 13:37 ` Julien Grall
2015-05-19 13:51 ` Ian Campbell
2015-05-22 12:16 ` Vijay Kilari
2015-05-22 12:49 ` Julien Grall
2015-05-22 13:58 ` Vijay Kilari
2015-05-22 14:35 ` Julien Grall
2015-05-22 14:54 ` Vijay Kilari
2015-05-24 10:35 ` Julien Grall
2015-05-25 9:06 ` Vijay Kilari
2015-05-25 9:32 ` Julien Grall
2015-05-25 10:40 ` Vijay Kilari
2015-05-25 12:44 ` Julien Grall [this message]
2015-05-25 13:38 ` Vijay Kilari
2015-05-25 17:11 ` Julien Grall
2015-05-27 11:22 ` Ian Campbell
2015-05-27 11:22 ` 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=55631917.80800@citrix.com \
--to=julien.grall@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=ian.campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=manish.jaggi@caviumnetworks.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=vijay.kilari@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).