Skip to content

xsm: refactoring xsm hooks

Daniel P. Smith xen-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest10 patches 4 repliesIn review
  2. v510 patches 6 repliesSuperseded
  3. v411 patches 25 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v37 patches17 repliesSuperseded
v210 patches33 repliesSuperseded
v16 patches30 repliesSuperseded

v2 from the cover letter

- restructured the patches, breaking them up as needed
- incorporate Andrew Cooper's alternative call common code
- change XSM module registration, removing register_xsm
- incoporate KConfig recommendations
- reworded commit messages
- incorporate macro expansion recommendations
- misc clean-up fallout from recommendations

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10xen: Implement xen/alternative-call.h for use in common codexen/arch/x86/Kconfig xen/common/Kconfig xen/include/xen/alternative-call.h+67 -00 replies
2/10xsm: remove the ability to disable flaskxen/include/public/xsm/flask_op.h xen/xsm/flask/flask_op.c+1 -310 replies
3/10xsm: remove remnants of xsm_memtype hookxen/include/xsm/xsm.h+0 -60 replies
4/10xsm: drop dubious xsm_op_t typexen/include/xen/hypercall.h xen/include/xsm/dummy.h xen/include/xsm/xsm.h +3 more+13 -160 replies
5/10xsm: apply coding stylexen/include/xsm/dummy.h xen/include/xsm/xsm.h xen/xsm/xsm_core.c +1 more+396 -3041 reply
6/10xsm: refactor xsm_ops handlingxen/include/xsm/xsm.h xen/xsm/dummy.c xen/xsm/flask/hooks.c +2 more+161 -1540 replies
7/10xsm: convert xsm_ops hook calls to alternative callxen/include/xsm/xsm.h+96 -950 replies
8/10xsm: decouple xsm header inclusion selectionxen/include/xsm/dummy.h xen/include/xsm/xsm-core.h xen/include/xsm/xsm.h +3 more+275 -2500 replies
9/10kconfig: update xsm config to reflect realityxen/common/Kconfig xen/include/xen/sched.h xen/include/xsm/dummy.h +4 more+46 -482 replies
10/10xsm: remove alternate xsm hook interfacexen/include/xsm/xsm-core.h xen/include/xsm/xsm.h xen/xsm/Makefile +4 more+868 -1271 reply

Reviews trailers per patch

7 of 10 patches have a Reviewed-by or Acked-by.

PatchJan BeulichAndrew Cooper
1/10A-b
2/10A-b
3/10A-b
4/10A-b
5/10A-b
6/10A-b
7/10A-b
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 00/10] xsm: refactoring xsm hooks

Based on feedback from 2021 Xen Developers Summit the xsm-roles RFC patch set is being split into two separate patch sets. This is the first patch set and is focused purely on the clean up and refactoring of the XSM hooks.

This patch set refactors the xsm_ops wrapper hooks to use the alternative_call infrastructure. Then proceeds to move and realign the headers to simplify the unnecessarily complicated header inclusions, remove the facad of being able to enable/disable XSM, and simplify the XSM hooks down to a single interface and implementation. The remainder of the changes are clean up and removing no longer necessary abstractions.

v2:
- restructured the patches, breaking them up as needed
- incorporate Andrew Cooper's alternative call common code
- change XSM module registration, removing register_xsm
- incoporate KConfig recommendations
- reworded commit messages
- incorporate macro expansion recommendations
- misc clean-up fallout from recommendations

v3:
- renamed struct xsm_operations to struct xsm_ops
- flask and silo ops structs made __initconst
- fixed misplacement of __init on flask/silo_init
- lots of coding style alignment
- further clean up from FLASK_DISABLE removal
- addressed commit message comments
- removed missed guard around alternative-call include
- reworked approach to XSM hooks, merging the two interfaces instead of dropping one

v4:
- make __alt_call_maybe_initdata resolve to __read_mostly when CONFIG_ALTERNATIVE_CALL is not set
- removed the masking of void with xsm_op_t
- moved all the coding style conformity to an early commit
- fixed declaration on real and stub declarations in xsm.h
- corrected to __initconstrel
- made the xsm_ops global __read_mostly
- adjusted blank lines in xsm_ops struct to provide consistent grouping
- moved extern references to built in policy to where they are used
- Added back in the #ifdef CONFIG_XSM into struct evtchn
- split the patch removing the duplicate interface up further

v5
- changed 80 col wrapping style to preferred style
- a few additional code style cleanups caught in v4 review
- made xsm_ops_registered __initdata
- pulled duplicate if out of switch cases in xsm_core_init()
- dropped struct evtchn commit
- dropped silo hooks direct calls to xsm_default_action

v6
- adjusted alt call documentation comment
- fixed the leak of hard tabs into the commits

Andrew Cooper (1):
xen: Implement xen/alternative-call.h for use in common code

Daniel P. Smith (9):
xsm: remove the ability to disable flask
xsm: remove remnants of xsm_memtype hook
xsm: drop dubious xsm_op_t type
xsm: apply coding style
xsm: refactor xsm_ops handling
xsm: convert xsm_ops hook calls to alternative call
xsm: decouple xsm header inclusion selection
kconfig: update xsm config to reflect reality
xsm: remove alternate xsm hook interface

 xen/arch/x86/Kconfig               |   1 +
 xen/common/Kconfig                 |  52 +-
 xen/include/public/xsm/flask_op.h  |   2 +-
 xen/include/xen/alternative-call.h |  63 +++
 xen/include/xen/hypercall.h        |   4 +-
 xen/include/xen/sched.h            |   2 +-
 xen/include/xsm/dummy.h            | 215 +++++---
 xen/include/xsm/xsm-core.h         | 266 ++++++++++
 xen/include/xsm/xsm.h              | 802 +++++++++++++----------------
 xen/xsm/Makefile                   |   4 +-
 xen/xsm/dummy.c                    |   7 +-
 xen/xsm/dummy.h                    | 659 ++++++++++++++++++++++++
 xen/xsm/flask/flask_op.c           |  32 +-
 xen/xsm/flask/hooks.c              |  16 +-
 xen/xsm/silo.c                     |  11 +-
 xen/xsm/xsm_core.c                 |  93 ++--
 xen/xsm/xsm_policy.c               |   7 +-
 17 files changed, 1564 insertions(+), 672 deletions(-)
 create mode 100644 xen/include/xen/alternative-call.h
 create mode 100644 xen/include/xsm/xsm-core.h
 create mode 100644 xen/xsm/dummy.h
Signature · 1 line
2.20.1