xen/domctl: Add XEN_DOMCTL_vmtrace_op
authorMichał Leszczyński <michal.leszczynski@cert.pl>
Sun, 28 Jun 2020 21:48:09 +0000 (23:48 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Feb 2021 17:37:28 +0000 (17:37 +0000)
commit1cee4bd97c88633c4a39f56f6722be0727c9ea8f
tree1ba0d11080fd977475d27eb9f077efdfe905c237
parent71cb03f03ce309e8cc1dacd18aa383ccea6af231
xen/domctl: Add XEN_DOMCTL_vmtrace_op

Implement an interface to configure and control tracing operations.  Reuse the
existing SETDEBUGGING flask vector rather than inventing a new one.

Userspace using this interface is going to need platform specific knowledge
anyway to interpret the contents of the trace buffer.  While some operations
(e.g. enable/disable) can reasonably be generic, others cannot.  Provide an
explicitly-platform specific pair of get/set operations to reduce API churn as
new options get added/enabled.

For the VMX specific Processor Trace implementation, tolerate reading and
modifying a safe subset of bits in CTL, STATUS and OUTPUT_MASK.  This permits
userspace to control the content which gets logged, but prevents modification
of details such as the position/size of the output buffer.

Signed-off-by: Michał Leszczyński <michal.leszczynski@cert.pl>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/hvm.h
xen/include/public/domctl.h
xen/xsm/flask/hooks.c