[PATCH v5 0/3] Expose PMU to the guests

Michal Orzel posted 3 patches 1 week, 3 days ago
SUPPORT.md                           |  9 +++++
docs/man/xl.cfg.5.pod.in             | 17 ++++++++++
tools/golang/xenlight/helpers.gen.go |  8 +++++
tools/golang/xenlight/types.gen.go   |  2 ++
tools/include/libxl.h                | 12 +++++++
tools/libs/light/libxl.c             |  1 +
tools/libs/light/libxl_create.c      | 10 ++++++
tools/libs/light/libxl_types.idl     |  3 ++
tools/ocaml/libs/xc/xenctrl.ml       |  2 ++
tools/ocaml/libs/xc/xenctrl.mli      |  2 ++
tools/xl/xl_info.c                   |  5 +--
tools/xl/xl_parse.c                  |  2 ++
xen/arch/arm/domain.c                | 13 +++++--
xen/arch/arm/setup.c                 |  3 ++
xen/common/domain.c                  | 12 ++++++-
xen/common/sysctl.c                  |  3 ++
xen/include/asm-arm/cpufeature.h     | 51 ++++++++++++++++++++++++++--
xen/include/asm-arm/domain.h         |  1 +
xen/include/public/domctl.h          |  4 ++-
xen/include/public/sysctl.h          |  6 ++--
xen/include/xen/domain.h             |  2 ++
21 files changed, 157 insertions(+), 11 deletions(-)

[PATCH v5 0/3] Expose PMU to the guests

Posted by Michal Orzel 1 week, 3 days ago
This patch series is a rework of an already pushed patch
exposing PMU to the guests. Since the second version the vpmu
parameter is common and prework in the form of reporting
availability of vPMU on the hardware is added.

The third version of the patch series removes the redundant check
from x86 code and modifies the way to define the flags XEN_DOMCTL_CDF and
XEN_SYSCTL_PHYSCAP, meaning not to define bit position and mask separately.

In the fourth version, the additional check is added so that we fail
if vpmu is set in the config file but XEN_SYSCTL_PHYSCAP_vpmu is not available.

In the fifth version, SUPPORT.md is updated with the information about
vPMU feature and checks for platform PMU support are improved.

The current status is that the PMU registers are not virtualized
and the physical registers are directly accessible when "vpmu"
parameter is enabled in the guest config file. There is no interrupt
support and Xen will not save/restore the register values on context
switches. This is to be done in the future.

Michal Orzel (3):
  xen+tools: Introduce XEN_SYSCTL_PHYSCAP_vpmu
  xen/arm: Check for PMU platform support
  xen: Expose the PMU to the guests

 SUPPORT.md                           |  9 +++++
 docs/man/xl.cfg.5.pod.in             | 17 ++++++++++
 tools/golang/xenlight/helpers.gen.go |  8 +++++
 tools/golang/xenlight/types.gen.go   |  2 ++
 tools/include/libxl.h                | 12 +++++++
 tools/libs/light/libxl.c             |  1 +
 tools/libs/light/libxl_create.c      | 10 ++++++
 tools/libs/light/libxl_types.idl     |  3 ++
 tools/ocaml/libs/xc/xenctrl.ml       |  2 ++
 tools/ocaml/libs/xc/xenctrl.mli      |  2 ++
 tools/xl/xl_info.c                   |  5 +--
 tools/xl/xl_parse.c                  |  2 ++
 xen/arch/arm/domain.c                | 13 +++++--
 xen/arch/arm/setup.c                 |  3 ++
 xen/common/domain.c                  | 12 ++++++-
 xen/common/sysctl.c                  |  3 ++
 xen/include/asm-arm/cpufeature.h     | 51 ++++++++++++++++++++++++++--
 xen/include/asm-arm/domain.h         |  1 +
 xen/include/public/domctl.h          |  4 ++-
 xen/include/public/sysctl.h          |  6 ++--
 xen/include/xen/domain.h             |  2 ++
 21 files changed, 157 insertions(+), 11 deletions(-)

-- 
2.29.0


Re: [PATCH v5 0/3] Expose PMU to the guests

Posted by Christian Lindig 1 week, 3 days ago

On 12 Oct 2021, at 09:13, Michal Orzel <michal.orzel@arm.com<mailto:michal.orzel@arm.com>> wrote:

This patch series is a rework of an already pushed patch
exposing PMU to the guests. Since the second version the vpmu
parameter is common and prework in the form of reporting
availability of vPMU on the hardware is added.

The third version of the patch series removes the redundant check
from x86 code and modifies the way to define the flags XEN_DOMCTL_CDF and
XEN_SYSCTL_PHYSCAP, meaning not to define bit position and mask separately.

In the fourth version, the additional check is added so that we fail
if vpmu is set in the config file but XEN_SYSCTL_PHYSCAP_vpmu is not available.

In the fifth version, SUPPORT.md is updated with the information about
vPMU feature and checks for platform PMU support are improved.

The current status is that the PMU registers are not virtualized
and the physical registers are directly accessible when "vpmu"
parameter is enabled in the guest config file. There is no interrupt
support and Xen will not save/restore the register values on context
switches. This is to be done in the future.

Michal Orzel (3):
 xen+tools: Introduce XEN_SYSCTL_PHYSCAP_vpmu
 xen/arm: Check for PMU platform support
 xen: Expose the PMU to the guests

SUPPORT.md                           |  9 +++++
docs/man/xl.cfg.5.pod.in             | 17 ++++++++++
tools/golang/xenlight/helpers.gen.go |  8 +++++
tools/golang/xenlight/types.gen.go   |  2 ++
tools/include/libxl.h                | 12 +++++++
tools/libs/light/libxl.c             |  1 +
tools/libs/light/libxl_create.c      | 10 ++++++
tools/libs/light/libxl_types.idl     |  3 ++
tools/ocaml/libs/xc/xenctrl.ml       |  2 ++
tools/ocaml/libs/xc/xenctrl.mli      |  2 ++
tools/xl/xl_info.c                   |  5 +--
tools/xl/xl_parse.c                  |  2 ++
xen/arch/arm/domain.c                | 13 +++++--
xen/arch/arm/setup.c                 |  3 ++
xen/common/domain.c                  | 12 ++++++-
xen/common/sysctl.c                  |  3 ++
xen/include/asm-arm/cpufeature.h     | 51 ++++++++++++++++++++++++++--
xen/include/asm-arm/domain.h         |  1 +
xen/include/public/domctl.h          |  4 ++-
xen/include/public/sysctl.h          |  6 ++--
xen/include/xen/domain.h             |  2 ++
21 files changed, 157 insertions(+), 11 deletions(-)

—
2.29.0


Acked-by: Christian Lindig <christian.lindig@citrix.com<mailto:christian.lindig@citrix.com>>