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

[Xen-devel] [RFC PATCH 00/10] ARM VGIC rework: remove rank, introduce per-IRQ lock



Hi,

this is a sketch of the first step of some ARM VGIC rework.
While working more closely with the code during the ITS patch series, we
identified some shortcomings with the existing code which should be fixed.
This series addresses two, somewhat related, fields:
It introduces a per-IRQ lock to protect our struct pending_irq, and moves
the data from the separate irq_rank structure into pending_irq. The latter
is useful because we don't have to deal with two locks, also it helps with
the ITS/LPI emulation.

The first two patches are somewhat fixes, which help to simplify the
following patches. Patch 03/10 introduces a lock to cover some members
of struct pending_irq, patch 04/10 introduces the proper lock/unlock
calls in functions dealing with the structure. At this point the lock
doesn't really protect anything, but the following four patches change that.
They move the member of struct irq_rank over to struct pending_irq.
We give up our optimized MMIO access, but in fact this was quite pointless
given the extremly low frequency of these traps compared to far more
dominant code paths dealing with IRQ injection and the entry/exit path.
Patch 09/10 introduces some put/get functionality for getting a struct
pending_irq pointer. For now this is pretty pointless on its own, but allows
to introduce ref-counting for LPIs more easily later on.
The final patch 10/10 then removes all remaining code having dealt with
the irq_rank, because we don't need this structure at all anymore.

This is more of a suggestion to pave the way for proper ITS emulation and
to get the discussion going. I am sure I missed some places where we need
the lock and introduces some other bugs, so please have a look and tell me
what you think.

There is more (admittedly controversial) rework in my pipe, which helps
to simplify the locking scheme.

The code can also be found on the vgic-rework/rfc branch here:
git://linux-arm.org/xen-ap.git
http://www.linux-arm.org/git?p=xen-ap.git;a=shortlog;h=refs/heads/vgic-rework/rfc

Cheers,
Andre

Andre Przywara (10):
  ARM: vGIC: remove rank lock from IRQ routing functions
  ARM: vGIC: rework gic_raise_*_irq() functions
  ARM: vGIC: introduce and initialize pending_irq lock
  ARM: vGIC: add struct pending_irq locking
  ARM: vGIC: move priority from irq_rank to struct pending_irq
  ARM: vGIC: move config from irq_rank to struct pending_irq
  ARM: vGIC: move enable status from irq_rank to struct pending_irq
  ARM: vGIC: move target vcpu from irq_rank to struct pending_irq
  ARM: vGIC: introduce vgic_get/put_pending_irq
  ARM: vGIC: remove struct irq_rank and support functions

 xen/arch/arm/gic.c           |  84 +++++++------
 xen/arch/arm/vgic-v2.c       | 157 +++++++++--------------
 xen/arch/arm/vgic-v3.c       | 190 +++++++++++++---------------
 xen/arch/arm/vgic.c          | 287 +++++++++++++++++++++----------------------
 xen/include/asm-arm/domain.h |   6 +-
 xen/include/asm-arm/event.h  |  20 ++-
 xen/include/asm-arm/gic.h    |   5 +-
 xen/include/asm-arm/vgic.h   | 107 +++++-----------
 8 files changed, 382 insertions(+), 474 deletions(-)

-- 
2.9.0


_______________________________________________
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®.