From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas K Lengyel Subject: [PATCH V6 00/13] xen: Clean-up of mem_event subsystem Date: Wed, 18 Feb 2015 01:11:30 +0100 Message-ID: <1424218303-11331-1-git-send-email-tamas.lengyel@zentific.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: kevin.tian@intel.com, wei.liu2@citrix.com, ian.campbell@citrix.com, steve@zentific.com, stefano.stabellini@eu.citrix.com, jun.nakajima@intel.com, tim@xen.org, ian.jackson@eu.citrix.com, eddie.dong@intel.com, andres@lagarcavilla.org, jbeulich@suse.com, Tamas K Lengyel , rshriram@cs.ubc.ca, keir@xen.org, dgdegra@tycho.nsa.gov, yanghy@cn.fujitsu.com List-Id: xen-devel@lists.xenproject.org This patch series aims to clean up the mem_event subsystem within Xen. The original use-case for this system was to allow external helper applications running in privileged domains to control various memory operations performed by Xen. Amongs these were paging, sharing and access control. The subsystem has since been extended to also deliver non-memory related events, namely various HVM debugging events (INT3, MTF, MOV-TO-CR, MOV-TO-MSR). The structures and naming of related functions however has not caught up to these new use-cases, thus leaving many ambiguities in the code. Furthermore, future use-cases envisioned for this subsystem include PV domains and ARM domains, thus there is a need to establish a common base to build on. In this series we convert the mem_event system to vm_event in which we clearly define the scope of information that is transmitted via the event delivery mechanism. Afterwards, we clean up the naming of the structures and related functions to more clearly be in line with their actual operations. Finally, the control of monitor events is moved to a new domctl, monitor_op. Each patch in the series has been build-tested on x86 and ARM, both with and without XSM enabled. This PATCH series is also available at: https://github.com/tklengyel/xen/tree/mem_event_cleanup6 Tamas K Lengyel (13): xen/mem_event: Cleanup of mem_event structures xen/mem_event: Cleanup mem_event names in rings, functions and domctls xen/mem_paging: Convert mem_event_op to mem_paging_op and cleanup xen: Rename mem_event to vm_event xen/vm_event: Style fixes tools/tests: Clean-up tools/tests/xen-access x86/hvm: factor out and rename vm_event related functions xen: Introduce monitor_op domctl xen/vm_event: Deprecate VM_EVENT_FLAG_DUMMY flag xen/vm_event: Decouple vm_event and mem_access. xen/vm_event: Relocate memop checks xen/xsm: Split vm_event_op into three separate labels xen/vm_event: Add RESUME option to vm_event_op domctl MAINTAINERS | 6 +- docs/misc/xsm-flask.txt | 2 +- tools/libxc/Makefile | 3 +- tools/libxc/include/xenctrl.h | 49 ++- tools/libxc/xc_domain.c | 28 +- tools/libxc/xc_domain_restore.c | 14 +- tools/libxc/xc_domain_save.c | 4 +- tools/libxc/xc_hvm_build_x86.c | 2 +- tools/libxc/xc_mem_access.c | 56 ++- tools/libxc/xc_mem_paging.c | 80 ++-- tools/libxc/xc_memshr.c | 29 +- tools/libxc/xc_monitor.c | 137 +++++++ tools/libxc/xc_private.h | 15 +- tools/libxc/{xc_mem_event.c => xc_vm_event.c} | 59 +-- tools/libxc/xg_save_restore.h | 2 +- tools/tests/xen-access/xen-access.c | 264 +++++-------- tools/xenpaging/pagein.c | 2 +- tools/xenpaging/xenpaging.c | 155 ++++---- tools/xenpaging/xenpaging.h | 8 +- xen/arch/x86/Makefile | 1 + xen/arch/x86/domain.c | 2 +- xen/arch/x86/domctl.c | 4 +- xen/arch/x86/hvm/Makefile | 3 +- xen/arch/x86/hvm/emulate.c | 8 +- xen/arch/x86/hvm/event.c | 190 ++++++++++ xen/arch/x86/hvm/hvm.c | 187 +--------- xen/arch/x86/hvm/vmx/vmcs.c | 11 +- xen/arch/x86/hvm/vmx/vmx.c | 9 +- xen/arch/x86/mm/hap/nested_ept.c | 4 +- xen/arch/x86/mm/hap/nested_hap.c | 4 +- xen/arch/x86/mm/mem_paging.c | 60 ++- xen/arch/x86/mm/mem_sharing.c | 180 ++++----- xen/arch/x86/mm/p2m-pod.c | 4 +- xen/arch/x86/mm/p2m-pt.c | 4 +- xen/arch/x86/mm/p2m.c | 271 +++++++------- xen/arch/x86/monitor.c | 200 ++++++++++ xen/arch/x86/x86_64/compat/mm.c | 24 +- xen/arch/x86/x86_64/mm.c | 24 +- xen/common/Makefile | 18 +- xen/common/domain.c | 12 +- xen/common/domctl.c | 17 +- xen/common/mem_access.c | 55 +-- xen/common/{mem_event.c => vm_event.c} | 512 +++++++++++++------------- xen/drivers/passthrough/pci.c | 2 +- xen/include/asm-arm/monitor.h | 35 ++ xen/include/asm-arm/p2m.h | 22 +- xen/include/asm-x86/domain.h | 41 ++- xen/include/asm-x86/hvm/domain.h | 1 - xen/include/asm-x86/hvm/emulate.h | 2 +- xen/include/asm-x86/hvm/event.h | 40 ++ xen/include/asm-x86/hvm/hvm.h | 11 - xen/include/asm-x86/mem_paging.h | 5 +- xen/include/asm-x86/mem_sharing.h | 4 +- xen/include/asm-x86/monitor.h | 31 ++ xen/include/asm-x86/p2m.h | 40 +- xen/include/public/domctl.h | 113 ++++-- xen/include/public/hvm/params.h | 11 +- xen/include/public/mem_event.h | 134 ------- xen/include/public/memory.h | 27 +- xen/include/public/vm_event.h | 222 +++++++++++ xen/include/xen/mem_access.h | 18 +- xen/include/xen/mem_event.h | 143 ------- xen/include/xen/p2m-common.h | 4 +- xen/include/xen/sched.h | 28 +- xen/include/xen/vm_event.h | 88 +++++ xen/include/xsm/dummy.h | 22 +- xen/include/xsm/xsm.h | 35 +- xen/xsm/dummy.c | 13 +- xen/xsm/flask/hooks.c | 66 ++-- xen/xsm/flask/policy/access_vectors | 12 +- 70 files changed, 2259 insertions(+), 1630 deletions(-) create mode 100644 tools/libxc/xc_monitor.c rename tools/libxc/{xc_mem_event.c => xc_vm_event.c} (70%) create mode 100644 xen/arch/x86/hvm/event.c create mode 100644 xen/arch/x86/monitor.c rename xen/common/{mem_event.c => vm_event.c} (50%) create mode 100644 xen/include/asm-arm/monitor.h create mode 100644 xen/include/asm-x86/hvm/event.h create mode 100644 xen/include/asm-x86/monitor.h delete mode 100644 xen/include/public/mem_event.h create mode 100644 xen/include/public/vm_event.h delete mode 100644 xen/include/xen/mem_event.h create mode 100644 xen/include/xen/vm_event.h -- 2.1.4