[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 11/30] ARM: GICv3 ITS: introduce device mapping





On 06/04/17 17:42, Stefano Stabellini wrote:
On Thu, 6 Apr 2017, Julien Grall wrote:
Hi Stefano,

On 06/04/17 00:41, Stefano Stabellini wrote:
+    /* An Interrupt Translation Table needs to be 256-byte aligned. */
+    itt_addr = _xzalloc(nr_events * hw_its->itte_size, 256);
+    if ( !itt_addr )
+        goto out_unlock;
+
+    dev = xzalloc(struct its_devices);
+    if ( !dev )
+        goto out_unlock;
+
+    /*
+     * Allocate the pending_irqs for each virtual LPI. They will be put
+     * into the domain's radix tree upon the guest's MAPTI command.
+     */

Please expand the comment with a link to the xen-devel conversation
about allocation strategy and a TODO saying that we shouldn't need to
preallocate all pending_irq struct, but we do it for simplicity at the
moment.

It would have been useful to provide a link of the conversation you mention to
allow us answering properly rather than loosing a day for confirmation.
Anyway, I guess you are speaking about [1].
[1] https://lists.xenproject.org/archives/html/xen-devel/2017-03/msg03758.html

Yes, that's right.


I agree that we would need to take into account the memory to the guest, but
this is a work beyond GICv3 ITS support as it is not
supported by Xen today.

Even if you do memory accounting, this would have to be reserved in advance to
avoid failure afterwards. Which is very similar to memory allocation...

So can you explain what you would do here?

I don't think we need a full plan written down in a comment, but I think
it is fair to say that there is room for improvement, especially given
that we are already introducing other data structures such as the host
LPI array. I would write the following:

  Allocate the pending_irqs for each virtual LPI. They will be put into
  the domain's radix tree upon the guest's MAPTI command.

  TODO. For now, allocate all pending_irqs immediately.  However,
  delayed allocation strategies are possible, see this discussion:
  https://lists.xenproject.org/archives/html/xen-devel/2017-03/msg03758.html

Sounds good to me. We can discuss about the strategies later on.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.