On 04/20/2015 04:50 AM, Jan Beulich wrote:
On 09.04.15 at 17:44, <boris.ostrov...@oracle.com> wrote:
--- /dev/null
+++ b/xen/include/public/pmu.h
@@ -0,0 +1,38 @@
+#ifndef __XEN_PUBLIC_PMU_H__
+#define __XEN_PUBLIC_PMU_H__
+
+#include "xen.h"
+#if defined(__i386__) || defined(__x86_64__)
+#include "arch-x86/pmu.h"
+#elif defined (__arm__) || defined (__aarch64__)
+#include "arch-arm.h"
+#else
+#error "Unsupported architecture"
+#endif
+
+#define XENPMU_VER_MAJ    0
+#define XENPMU_VER_MIN    1
+
+
+/* Shared between hypervisor and PV domain */
+struct xen_pmu_data {
Iirc this sharing is r/o - if so, please state so in the comment. If not,
please extend the comment to briefly explain why writable sharing
is safe/secure.

This data structure is writeable by guest (specifically, PMU registers and APIC_LVTPC). There is a flag (PMU_CACHED, which is part of this structure) that the hypervisor sets to let the guest know that it can write those fields without having to trap. When the guest is done, it issues XENPMU_flush command and the hypervisor writes out those values to HW.

I'll update the comments to make this clear.

-boris

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to