[PATCH 0/7] x86: Make MAX_ALTP2M configurable

Petr Beneš posted 7 patches 1 week, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1713990376.git.w1benny@gmail.com
There is a newer version of this series
docs/man/xl.cfg.5.pod.in                      | 14 +++++
tools/golang/xenlight/helpers.gen.go          |  2 +
tools/golang/xenlight/types.gen.go            |  1 +
tools/include/libxl.h                         |  8 +++
tools/libs/light/libxl_create.c               |  9 ++++
tools/libs/light/libxl_types.idl              |  1 +
tools/ocaml/libs/xc/xenctrl.ml                |  1 +
tools/ocaml/libs/xc/xenctrl.mli               |  1 +
tools/ocaml/libs/xc/xenctrl_stubs.c           | 17 +++---
.../paging-mempool/test-paging-mempool.c      |  2 +-
tools/xl/xl_parse.c                           |  4 ++
xen/arch/x86/domain.c                         |  6 +++
xen/arch/x86/hvm/hvm.c                        |  8 ++-
xen/arch/x86/hvm/vmx/vmx.c                    |  2 +-
xen/arch/x86/include/asm/domain.h             |  7 ++-
xen/arch/x86/include/asm/p2m.h                |  4 +-
xen/arch/x86/mm/altp2m.c                      | 27 +++++++++-
xen/arch/x86/mm/hap/hap.c                     | 12 ++---
xen/arch/x86/mm/mem_access.c                  | 14 ++---
xen/arch/x86/mm/mem_sharing.c                 |  2 +-
xen/arch/x86/mm/p2m-ept.c                     |  6 +--
xen/arch/x86/mm/p2m.c                         | 54 ++++++++++---------
xen/common/domain.c                           |  7 +++
xen/include/public/domctl.h                   |  1 +
xen/include/xen/sched.h                       |  2 +
25 files changed, 152 insertions(+), 60 deletions(-)
[PATCH 0/7] x86: Make MAX_ALTP2M configurable
Posted by Petr Beneš 1 week, 3 days ago
From: Petr Beneš <w1benny@gmail.com>

This series introduces the ability to configure the maximum number of altp2m
tables during domain creation. Previously, the limits were hardcoded to a
maximum of 10. This change allows for greater flexibility in environments that
require more or fewer altp2m views.

Adjustments include:
- "Prepare" commits with style changes.
- Adding a new `max_altp2m` parameter to xl.
- Adding a new `max_altp2m` parameter to the OCaml bindings.
- Adding a new `max_altp2m` parameter to the xl.cfg manual.
- Introducing `max_altp2m` into `xen_domctl_createdomain`, which, after sanity
  checks, is stored in newly introduced `max_altp2m` field of `struct domain` -
  leaving room for other architectures to implement the altp2m feature.
- Replacing MAX_ALTP2M macro occurrences with `domain->max_altp2m`.
- Finally, adjusting the initial allocation of pages in `hap_enable` from 256
  to 1024 pages to accommodate potentially larger `max_altp2m` values (i.e.,
  maximum of 512).

This enhancement is particularly relevant for users leveraging Xen's features
for virtual machine introspection.

Petr Beneš (7):
  x86/p2m: Add braces for better code clarity
  x86/hap: Refactor boolean field assignments
  tools/xl: Add max_altp2m parameter
  tools/ocaml: Add max_altp2m parameter
  docs/man: Add max_altp2m parameter to the xl.cfg manual
  x86: Make the maximum number of altp2m views configurable
  x86/hap: Increase the number of initial mempool_size to 1024 pages

 docs/man/xl.cfg.5.pod.in                      | 14 +++++
 tools/golang/xenlight/helpers.gen.go          |  2 +
 tools/golang/xenlight/types.gen.go            |  1 +
 tools/include/libxl.h                         |  8 +++
 tools/libs/light/libxl_create.c               |  9 ++++
 tools/libs/light/libxl_types.idl              |  1 +
 tools/ocaml/libs/xc/xenctrl.ml                |  1 +
 tools/ocaml/libs/xc/xenctrl.mli               |  1 +
 tools/ocaml/libs/xc/xenctrl_stubs.c           | 17 +++---
 .../paging-mempool/test-paging-mempool.c      |  2 +-
 tools/xl/xl_parse.c                           |  4 ++
 xen/arch/x86/domain.c                         |  6 +++
 xen/arch/x86/hvm/hvm.c                        |  8 ++-
 xen/arch/x86/hvm/vmx/vmx.c                    |  2 +-
 xen/arch/x86/include/asm/domain.h             |  7 ++-
 xen/arch/x86/include/asm/p2m.h                |  4 +-
 xen/arch/x86/mm/altp2m.c                      | 27 +++++++++-
 xen/arch/x86/mm/hap/hap.c                     | 12 ++---
 xen/arch/x86/mm/mem_access.c                  | 14 ++---
 xen/arch/x86/mm/mem_sharing.c                 |  2 +-
 xen/arch/x86/mm/p2m-ept.c                     |  6 +--
 xen/arch/x86/mm/p2m.c                         | 54 ++++++++++---------
 xen/common/domain.c                           |  7 +++
 xen/include/public/domctl.h                   |  1 +
 xen/include/xen/sched.h                       |  2 +
 25 files changed, 152 insertions(+), 60 deletions(-)

-- 
2.34.1