It can be beneficial for some dom0less systems to further reduce Xen footprint via disabling some hypercalls handling code, which may not to be used & required in such systems. Each hypercall has a separate option to keep configuration flexible.
Options to disable hypercalls: - sysctl - domctl - hvm - physdev - platform This patch serie is only focusing on introducing CONFIG_DOMCTL. Different options will be covered in different patch serie. Features, like VM event, or paging log-dirty support, which fully rely on domctl op, will be wrapped with CONFIG_SYSCTL, to reduce Xen footprint as much as possible. It is derived from Stefano Stabellini's commit "xen: introduce kconfig options to disable hypercalls"( https://lore.kernel.org/xen-devel/20241219092917.3006174-1-sergiy_kib...@epam.com) Penny Zheng (25): xen/x86: move domctl.o out of PV_SHIM_EXCLUSIVE xen/x86: consolidate vram tracking support xen/x86: complement PG_log_dirty wrapping xen: consolidate CONFIG_VM_EVENT xen: introduce CONFIG_DOMCTL xen/domctl: provide stub for domctl_lock_{acquire,release} xen/domctl: wrap around XEN_DOMCTL_pausedomain xen/domctl: wrap around XEN_DOMCTL_soft_reset xen/domctl: wrap around XEN_DOMCTL_destroydomain xen/domctl: wrap around XEN_DOMCTL_setnodeaffinity xen/domctl: wrap around XEN_DOMCTL_{getvcpuaffinity,setvcpuaffinity} xen/domctl: wrap around XEN_DOMCTL_scheduler_op xen/domctl: wrap around XEN_DOMCTL_getvcpucontext xen/domctl: wrap around XEN_DOMCTL_{irq_permission,iomem_permission} xen/domctl: wrap around XEN_DOMCTL_settimeoffset xen/domctl: wrap around XEN_DOMCTL_set_target xen: add stub for XEN_DOMCTL_getdomaininfo xen/domctl: wrap around XEN_DOMCTL_set_access_required xen: make CONFIG_VM_EVENT depend on DOMCTL xen/domctl: wrap around XEN_DOMCTL_set_virq_handler xen/domctl: wrap aound iommu-related domctl op xen/domctl: wrap around XEN_DOMCTL_{get,set}_paging_mempool_size xen/x86: make CONFIG_X86_PSR depend on SYSCTL || DOMCTL xen/domctl: wrap around arch-specific domctl op xen/domctl: wrap around domctl hypercall xen/arch/arm/arm32/Makefile | 2 +- xen/arch/arm/arm64/Makefile | 2 +- xen/arch/arm/domain.c | 5 ++ xen/arch/arm/include/asm/tee/tee.h | 2 + xen/arch/arm/mem_access.c | 2 + xen/arch/arm/mmu/p2m.c | 8 +++ xen/arch/arm/mpu/p2m.c | 2 + xen/arch/arm/tee/ffa.c | 4 ++ xen/arch/arm/tee/optee.c | 4 ++ xen/arch/arm/tee/tee.c | 2 + xen/arch/arm/time.c | 2 + xen/arch/ppc/stubs.c | 6 ++ xen/arch/riscv/stubs.c | 2 + xen/arch/x86/Kconfig | 1 + xen/arch/x86/Makefile | 4 +- xen/arch/x86/configs/pvshim_defconfig | 1 + xen/arch/x86/domain.c | 4 ++ xen/arch/x86/domctl.c | 4 ++ xen/arch/x86/emul-i8254.c | 2 + xen/arch/x86/gdbsx.c | 4 ++ xen/arch/x86/hvm/Makefile | 4 +- xen/arch/x86/hvm/hvm.c | 4 ++ xen/arch/x86/hvm/pmtimer.c | 2 + xen/arch/x86/hvm/save.c | 2 + xen/arch/x86/hvm/svm/svm.c | 8 +++ xen/arch/x86/hvm/vmx/vmx.c | 16 +++++ xen/arch/x86/include/asm/hvm/hvm.h | 22 +++++++ xen/arch/x86/include/asm/hvm/monitor.h | 65 ++++++++++++++++++++- xen/arch/x86/include/asm/hvm/vm_event.h | 4 ++ xen/arch/x86/include/asm/hypercall.h | 2 + xen/arch/x86/include/asm/mem_access.h | 9 +++ xen/arch/x86/include/asm/monitor.h | 15 +++++ xen/arch/x86/include/asm/p2m.h | 8 ++- xen/arch/x86/include/asm/paging.h | 34 +++++------ xen/arch/x86/mm/hap/hap.c | 38 ++++++++++++ xen/arch/x86/mm/mem_access.c | 2 + xen/arch/x86/mm/mem_paging.c | 2 + xen/arch/x86/mm/mem_sharing.c | 4 ++ xen/arch/x86/mm/p2m-pod.c | 2 + xen/arch/x86/mm/p2m.c | 2 + xen/arch/x86/mm/paging.c | 36 ++---------- xen/arch/x86/mm/shadow/common.c | 8 +++ xen/arch/x86/mm/shadow/none.c | 4 ++ xen/arch/x86/psr.c | 18 ------ xen/arch/x86/time.c | 2 + xen/common/Kconfig | 9 ++- xen/common/Makefile | 5 +- xen/common/argo.c | 2 + xen/common/device-tree/device-tree.c | 2 + xen/common/domain.c | 10 ++++ xen/common/event_channel.c | 2 + xen/common/grant_table.c | 2 + xen/common/sched/arinc653.c | 2 + xen/common/sched/core.c | 6 ++ xen/common/sched/credit.c | 4 ++ xen/common/sched/credit2.c | 4 ++ xen/common/sched/private.h | 4 ++ xen/common/sched/rt.c | 4 ++ xen/common/vm_event.c | 2 + xen/drivers/passthrough/amd/pci_amd_iommu.c | 8 +++ xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 ++ xen/drivers/passthrough/arm/smmu-v3.c | 4 ++ xen/drivers/passthrough/arm/smmu.c | 4 ++ xen/drivers/passthrough/device_tree.c | 6 ++ xen/drivers/passthrough/iommu.c | 2 + xen/drivers/passthrough/pci.c | 6 ++ xen/drivers/passthrough/vtd/iommu.c | 6 ++ xen/include/hypercall-defs.c | 10 +++- xen/include/xen/domain.h | 18 ++++-- xen/include/xen/mem_access.h | 36 +++++++++++- xen/include/xen/monitor.h | 8 ++- xen/include/xen/vm_event.h | 24 +++++++- xen/include/xsm/dummy.h | 2 + xen/include/xsm/xsm.h | 40 ++++++++++--- xen/lib/x86/Makefile | 2 +- xen/xsm/dummy.c | 16 ++++- xen/xsm/flask/hooks.c | 36 +++++++++--- 77 files changed, 550 insertions(+), 118 deletions(-) -- 2.34.1