All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/19] xen: arm: cleanup traps.c
@ 2015-03-31 10:07 Ian Campbell
  2015-03-31 10:07 ` [PATCH 01/19] xen: arm: constify union hsr and struct hsr_* where possible Ian Campbell
                   ` (18 more replies)
  0 siblings, 19 replies; 62+ messages in thread
From: Ian Campbell @ 2015-03-31 10:07 UTC (permalink / raw)
  To: xen-devel; +Cc: Julien Grall, Tim Deegan, Stefano Stabellini

While working on reenabling 32-bit user space on arm63 I concluded that
the trap handling in traps.c had grown into a twisty confusing mess.
Lets try and sort that out.

This series contains to halves (after a couple of preparatory cleanups).

First clean up the goto maze which we've found ourselves in, by
providing a selection of handle_* helpers e.g. for raz/ro etc and by
calling those and the existing inject_* helpers directly instead of
trying to have only one call to each of the latter by using goto. The
handle_* helpers can also deal with the minimum allowable exception
level, which simplifies things further.

To keep things simpler I've used "return handle_..." when the caller and
callee both return void, since that avoids the need for 3 more lines (2
braces and the return), I think this improves clarity.

Second go through init_traps and for each bit there consolidate the
handling for each type of trap (e.g. do_cp15_32, do_cp15_64, do_sysreg
etc) such that all the registers whose traps are associated with that
bit are kept together beneath a comment which documents why those bits
are trapped, references the appropriate section of the ARMv7 and ARMv8
ARM (the v8 one in particular has a series of very useful tables per
bit) and notes which registers are not explicitly handled (and therefore
take the default case).

For traps which have no explicit handling (i.e. those which trap
implementation defined registers) and which always hit the default case
add the comment above that instead.

Do the same for the GICv3 ICC traps and timer traps.

There is probably scope for doing more, i.e. refactoring related
functionality into subsystem helpers (like we do for vtimer) and even
moving into separate files, but I think this is a good start.

This is a lot of patches, sorry, because I wanted to mostly go through
the trap bits one at a time per patch to keep each one manageable,
although I did end up compressing some of the more obvious ones.

Ian.

^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2015-04-21  8:42 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31 10:07 [PATCH 00/19] xen: arm: cleanup traps.c Ian Campbell
2015-03-31 10:07 ` [PATCH 01/19] xen: arm: constify union hsr and struct hsr_* where possible Ian Campbell
2015-04-02 10:44   ` Julien Grall
2015-04-02 15:10     ` Julien Grall
2015-03-31 10:07 ` [PATCH 02/19] xen: arm: add missing break Ian Campbell
2015-04-02 15:09   ` Julien Grall
2015-04-16 16:08     ` Ian Campbell
2015-04-17  6:06       ` Julien Grall
2015-03-31 10:07 ` [PATCH 03/19] xen: arm: call inject_undef_exception directly Ian Campbell
2015-04-02 15:08   ` Julien Grall
2015-03-31 10:07 ` [PATCH 04/19] xen: arm: provide and use a handle_raz_wi helper Ian Campbell
2015-04-02 15:14   ` Julien Grall
2015-04-02 15:31     ` Ian Campbell
2015-04-02 15:45       ` Julien Grall
2015-04-02 15:50         ` Ian Campbell
2015-04-02 16:01           ` Ian Campbell
2015-04-02 16:19             ` Ian Campbell
2015-04-03 12:39               ` Julien Grall
2015-04-16 16:35                 ` Ian Campbell
2015-03-31 10:07 ` [PATCH 05/19] xen: arm: Add and use r/o+raz and w/o+wi helpers Ian Campbell
2015-04-03 12:51   ` Julien Grall
2015-04-16 16:22     ` Ian Campbell
2015-04-17  6:18       ` Julien Grall
2015-04-17 10:34         ` Ian Campbell
2015-03-31 10:07 ` [PATCH 06/19] xen: arm: add minimum exception level argument to trap handler helpers Ian Campbell
2015-04-03 12:58   ` Julien Grall
2015-04-16 16:24     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 07/19] xen: arm: Annotate trap handler for HCR_EL2.{TWI, TWE, TSC} Ian Campbell
2015-04-03 13:05   ` Julien Grall
2015-04-16 16:34     ` Ian Campbell
2015-04-17  6:26       ` Julien Grall
2015-03-31 10:07 ` [PATCH 08/19] xen: arm: implement handling of ACTLR_EL1 trap Ian Campbell
2015-04-03 13:42   ` Julien Grall
2015-04-16 16:40     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 09/19] xen: arm: Annotate registers trapped by HSR_EL1.TIDCP Ian Campbell
2015-04-03 13:47   ` Julien Grall
2015-03-31 10:07 ` [PATCH 10/19] xen: arm: Annotate registers trapped by CPTR_EL2.TTA Ian Campbell
2015-04-06 11:10   ` Julien Grall
2015-04-16 16:45     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 11/19] xen: arm: Annotate handlers for PCTR_EL2.Tx Ian Campbell
2015-04-06 11:18   ` Julien Grall
2015-04-16 16:53     ` Ian Campbell
2015-04-17  6:31       ` Julien Grall
2015-03-31 10:07 ` [PATCH 12/19] xen: arm: Annotate the handlers for HSTR_EL2.Tx Ian Campbell
2015-04-06 11:25   ` Julien Grall
2015-03-31 10:07 ` [PATCH 13/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDRA Ian Campbell
2015-04-06 13:24   ` Julien Grall
2015-04-17 11:51     ` Ian Campbell
2015-04-21  8:26       ` Julien Grall
2015-04-21  8:42         ` Ian Campbell
2015-03-31 10:07 ` [PATCH 14/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDOSA Ian Campbell
2015-03-31 10:07 ` [PATCH 15/19] xen: arm: Annotate registers trapped by MDCR_EL2.TDA Ian Campbell
2015-04-06 13:41   ` Julien Grall
2015-04-17 12:08     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 16/19] xen: arm: Annotate registers trapped by MDCR_EL2.TPM and TPMCR Ian Campbell
2015-03-31 10:07 ` [PATCH 17/19] xen: arm: Remove CNTPCT_EL0 trap handling Ian Campbell
2015-04-06 13:52   ` Julien Grall
2015-03-31 10:07 ` [PATCH 18/19] xen: arm: Annotate registers trapped when CNTHCTL_EL2.EL1PCEN == 0 Ian Campbell
2015-04-06 13:58   ` Julien Grall
2015-04-17 12:12     ` Ian Campbell
2015-03-31 10:07 ` [PATCH 19/19] xen: arm: Annotate source of ICC SGI register trapping Ian Campbell
2015-04-06 14:08   ` Julien Grall

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.