|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling)
Hi Vijay, On 22/05/2015 13:16, Vijay Kilari wrote: On Tue, May 19, 2015 at 7:21 PM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:On Tue, 2015-05-19 at 14:37 +0100, Julien Grall wrote:Hi Ian, On 19/05/15 13:10, Ian Campbell wrote:On Fri, 2015-05-15 at 15:55 +0100, Julien Grall wrote: [...]Translation of certain commands can be expensive (XXX citation needed).The term "expensive" is subjective. I think we can end up to cheap translation if we properly pre-allocate information (such as device, LPIs...). We can have all the informations before the guest as boot or during hotplug part. It wouldn't take more memory than it should use. During command translation, we would just need to enable the device/LPIs. The remaining expensive part would be the validation. I think we can improve most of them of O(1) (such as collection checking) or O(log(n)) (such as device checking).[...]XXX need a solution for this.Command translation can be improved. It may be good too add a section explaining how translation of command foo can be done. I gave a second look to your proposal. How did you decide the 32 entries? The ITS must at least provide N + 1 collection when N is the number of processors. Also, how do you handle collection re-mapping? What about device remapping? Interrupt remapping? __text__ We can discuss and add how to reduce translation time. I wrote my though for the validation bits (see below) and add some definitions useful for people which don't have the spec. Emulation of ITS commands ========================= # Introduction This document is based on the section 5.13 of GICv3 specification (PRD03-GENC-010745 24.0). The goal is to provide insight of the cost to emulate ITS commands in Xen. The ITS provides 12 commands in order to manage interrupt collection, device and interrupts. # Definitions ## Device identifier Each device using the ITS is associated to an unique identifier. It's discoverable via the firwmare and a specific algorithm (not described here). The number of identifiers is variable and can be discovered via GITS_TYPER.Devbits. The field allow this ITS to have up to 2^32 device. ## CollectionEach interrupt is a member of an Interrupt Collection. This allows software to manage large numbers of physical interrupts with a small number of commands rather than issuing command per interrupt. On a system with N processors, the ITS must provide at least N+1 collections. ## Target AddressesThe Target Address correspond to a specific re-distributor. The format of this field depend on the value of the bit GITS_TYPER.PTA:
- 1: the base address of the re-distributor target is used
- 0: a unique processor number is used. The mapping between the
processor affinity value (MPIDR) and the processor number can be
discoverable via GICR_TYPER.ProcessorNumber.
# Validation of the parameters
Each command contains parameters that needs to be validated before any
usage in Xen or passing to the hardware.
This section will describe the validation of the main parameters. ## Device IDThis parameter is used in commands which manage the device and the interrupts associated to this device. Checking if a device is present and retrieving the data structure must be fast. The device identifiers may not be assigned contiguously and the maximum number is very high (2^32). The possible efficient data structure would be: 1) List: The lookup/deletion is in O(n) and the insertion will depend if the device should be sort following their identifier. The memory overhead is 18 bytes per element. 2) Red-black tree: All the operations are O(log(n)). The memory overhead is 24 bytes per element. The solution 2) seems the more suitable for having fast deviceID validation even though the memory overhead is a bit higher compare to the list. ## CollectionThis parameter is used in commands which manage collections and interrupt in order to move them for one CPU to another. The ITS is only mandatory to implement N + 1 collections where N is the number of processor on the platform. Furthermore, the identifier are always contiguous. If we decide to implement the strict minimum (i.e N + 1), an array is enough and will allow operations in O(1). ## Target Address This parameter is used in commands to manage collection. It's a unique identifier per processor. The format is different following the valueof the bit GITS_TYPER.PTA (see definition). The value of the field pre-defined by the ITS and the software has to handle the 2 cases. The solution with GITS_TYPER.PTA set to one will require some computationin order to find the VCPU associated with the redistributor address. It will be similar to get_vcpu_from_rdist in the vGICv3 emulation (xen/arch/arm/vgic-v3.c). On another hand, setting GITS_TYPER.PTA to zero will give us control to decide the linear process number which could simply be the vcpu_id (always linear). -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |