[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
  • Date: Mon, 8 Feb 2016 18:57:59 +0200
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Mon, 08 Feb 2016 16:58:30 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=G3R2SQgwjQA4xpHlP0E82Ma095HI8HwR6iKzRdtmln2gERC65bY2N7CWXlMs3tIknmIM/9qASyfjqy2xQjGyN8oFxBrhkSt1ZVeiVLiQ6zDwd/KPwvsFUF6toooeMK2Q6qGOWOox+FXqXbuM/MZT+CkiH5FnHZYOVa1FdlDOR5Xe402p18czBER6Mm4CBFqst1chtGCiEtzA3M0X8QfUrH6sisFQxsibnyehJ9EcaBOdRax5a3EHp6vBaIcRUXwzZ3tOP5Wqb4Y61EAp4IgRTLNl24hgP4GmjQ9c80YqPmatU+f7iGbAZiG8VOt2mQD7VcMwss4B/W3XfE2FfAsOqQ==; h=Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

(last commit before this one explains why this was necessary)

Signed-off-by: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
---
 xen/arch/x86/Makefile              |  2 +-
 xen/arch/x86/monitor.c             | 72 +++++++++++++++++++++++++++++++++++++
 xen/arch/x86/monitor_x86.c         | 72 -------------------------------------
 xen/common/monitor.c               |  2 +-
 xen/include/asm-arm/monitor.h      | 53 +++++++++++++++++++++++++++
 xen/include/asm-arm/monitor_arch.h | 53 ---------------------------
 xen/include/asm-x86/monitor.h      | 74 ++++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/monitor_arch.h | 74 --------------------------------------
 8 files changed, 201 insertions(+), 201 deletions(-)
 create mode 100644 xen/arch/x86/monitor.c
 delete mode 100644 xen/arch/x86/monitor_x86.c
 create mode 100644 xen/include/asm-arm/monitor.h
 delete mode 100644 xen/include/asm-arm/monitor_arch.h
 create mode 100644 xen/include/asm-x86/monitor.h
 delete mode 100644 xen/include/asm-x86/monitor_arch.h

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 6e80cf0..8e6e901 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -36,7 +36,7 @@ obj-y += microcode_intel.o
 # This must come after the vendor specific files.
 obj-y += microcode.o
 obj-y += mm.o x86_64/mm.o
-obj-y += monitor_x86.o
+obj-y += monitor.o
 obj-y += mpparse.o
 obj-y += nmi.o
 obj-y += numa.o
diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
new file mode 100644
index 0000000..568def2
--- /dev/null
+++ b/xen/arch/x86/monitor.c
@@ -0,0 +1,72 @@
+/*
+ * arch/x86/monitor.c
+ *
+ * Arch-specific monitor_op domctl handler.
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
+ * Copyright (c) 2016, Bitdefender S.R.L.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <asm/monitor.h>
+
+bool_t arch_monitor_domctl_event(struct domain *d,
+                                 struct xen_domctl_monitor_op *mop,
+                                 int *rc)
+{
+    struct arch_domain *ad = &d->arch;
+    bool_t requested_status = (XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op);
+
+    switch ( mop->event )
+    {
+        case XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR:
+        {
+            bool_t old_status = ad->monitor.mov_to_msr_enabled;
+
+            if ( unlikely(old_status == requested_status) )
+                return -EEXIST;
+
+            if ( XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op &&
+                 mop->u.mov_to_msr.extended_capture &&
+                 !hvm_enable_msr_exit_interception(d) )
+                return -EOPNOTSUPP;
+
+            domain_pause(d);
+
+            if ( XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op &&
+                 mop->u.mov_to_msr.extended_capture )
+                ad->monitor.mov_to_msr_extended = 1;
+            else
+                ad->monitor.mov_to_msr_extended = 0;
+
+            ad->monitor.mov_to_msr_enabled = !old_status;
+            domain_unpause(d);
+            break;
+        }
+
+        default:
+            return 0;
+    }
+
+    return 1;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/monitor_x86.c b/xen/arch/x86/monitor_x86.c
deleted file mode 100644
index d19fd15..0000000
--- a/xen/arch/x86/monitor_x86.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * arch/x86/monitor_x86.c
- *
- * Arch-specific monitor_op domctl handler.
- *
- * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
- * Copyright (c) 2016, Bitdefender S.R.L.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License v2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <asm/monitor_arch.h>
-
-bool_t arch_monitor_domctl_event(struct domain *d,
-                                 struct xen_domctl_monitor_op *mop,
-                                 int *rc)
-{
-    struct arch_domain *ad = &d->arch;
-    bool_t requested_status = (XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op);
-
-    switch ( mop->event )
-    {
-        case XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR:
-        {
-            bool_t old_status = ad->monitor.mov_to_msr_enabled;
-
-            if ( unlikely(old_status == requested_status) )
-                return -EEXIST;
-
-            if ( XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op &&
-                 mop->u.mov_to_msr.extended_capture &&
-                 !hvm_enable_msr_exit_interception(d) )
-                return -EOPNOTSUPP;
-
-            domain_pause(d);
-
-            if ( XEN_DOMCTL_MONITOR_OP_ENABLE == mop->op &&
-                 mop->u.mov_to_msr.extended_capture )
-                ad->monitor.mov_to_msr_extended = 1;
-            else
-                ad->monitor.mov_to_msr_extended = 0;
-
-            ad->monitor.mov_to_msr_enabled = !old_status;
-            domain_unpause(d);
-            break;
-        }
-
-        default:
-            return 0;
-    }
-
-    return 1;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/common/monitor.c b/xen/common/monitor.c
index 7bbeba5..1165aeb 100644
--- a/xen/common/monitor.c
+++ b/xen/common/monitor.c
@@ -25,7 +25,7 @@
 #include <xsm/xsm.h>
 #include <public/domctl.h>
 
-#include <asm/monitor_arch.h>       /* for monitor_arch_# */
+#include <asm/monitor.h>            /* for monitor_arch_# */
 
 #if CONFIG_X86
 #include <public/vm_event.h>        /* for VM_EVENT_X86_CR3 */
diff --git a/xen/include/asm-arm/monitor.h b/xen/include/asm-arm/monitor.h
new file mode 100644
index 0000000..eb770da
--- /dev/null
+++ b/xen/include/asm-arm/monitor.h
@@ -0,0 +1,53 @@
+/*
+ * include/asm-arm/monitor.h
+ *
+ * Arch-specific monitor_op domctl handler.
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
+ * Copyright (c) 2016, Bitdefender S.R.L.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ASM_ARM_MONITOR_H__
+#define __ASM_ARM_MONITOR_H__
+
+#include <xen/sched.h>
+#include <public/domctl.h>
+
+static inline
+uint32_t arch_monitor_get_capabilities(struct domain *d)
+{
+    /* No monitor vm-events implemented on ARM. */
+    return 0;
+}
+
+static inline
+bool_t arch_monitor_domctl_op(struct domain *d,
+                              struct xen_domctl_monitor_op *mop,
+                              int *rc)
+{
+    /* No arch-specific monitor ops on ARM. */
+    return 0;
+}
+
+static inline
+bool_t arch_monitor_domctl_event(struct domain *d,
+                                 struct xen_domctl_monitor_op *mop,
+                                 int *rc)
+{
+    /* No arch-specific monitor vm-events on ARM. */
+    return 0;
+}
+
+#endif /* __ASM_ARM_MONITOR_H__ */
diff --git a/xen/include/asm-arm/monitor_arch.h 
b/xen/include/asm-arm/monitor_arch.h
deleted file mode 100644
index d0df66c..0000000
--- a/xen/include/asm-arm/monitor_arch.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * include/asm-arm/monitor_arch.h
- *
- * Arch-specific monitor_op domctl handler.
- *
- * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
- * Copyright (c) 2016, Bitdefender S.R.L.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License v2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_ARM_MONITOR_ARCH_H__
-#define __ASM_ARM_MONITOR_ARCH_H__
-
-#include <xen/sched.h>
-#include <public/domctl.h>
-
-static inline
-uint32_t arch_monitor_get_capabilities(struct domain *d)
-{
-    /* No monitor vm-events implemented on ARM. */
-    return 0;
-}
-
-static inline
-bool_t arch_monitor_domctl_op(struct domain *d,
-                              struct xen_domctl_monitor_op *mop,
-                              int *rc)
-{
-    /* No arch-specific monitor ops on ARM. */
-    return 0;
-}
-
-static inline
-bool_t arch_monitor_domctl_event(struct domain *d,
-                                 struct xen_domctl_monitor_op *mop,
-                                 int *rc)
-{
-    /* No arch-specific monitor vm-events on ARM. */
-    return 0;
-}
-
-#endif /* __ASM_ARM_MONITOR_ARCH_H__ */
diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h
new file mode 100644
index 0000000..b12823c
--- /dev/null
+++ b/xen/include/asm-x86/monitor.h
@@ -0,0 +1,74 @@
+/*
+ * include/asm-x86/monitor.h
+ *
+ * Arch-specific monitor_op domctl handler.
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
+ * Copyright (c) 2016, Bitdefender S.R.L.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __ASM_X86_MONITOR_H__
+#define __ASM_X86_MONITOR_H__
+
+#include <xen/sched.h>              /* for struct domain, is_hvm_domain, ... */
+#include <public/domctl.h>          /* for XEN_DOMCTL_MONITOR_#, ... */
+#include <asm/cpufeature.h>         /* for cpu_has_vmx */
+#include <asm/hvm/hvm.h>            /* for hvm_is_singlestep_supported */
+
+static inline
+uint32_t arch_monitor_get_capabilities(struct domain *d)
+{
+    uint32_t capabilities = 0;
+
+    /*
+     * At the moment only Intel HVM domains are supported. However, event
+     * delivery could be extended to AMD and PV domains.
+     */
+    if ( !is_hvm_domain(d) || !cpu_has_vmx )
+        return capabilities;
+
+    capabilities = (1 << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) |
+                   (1 << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) |
+                   (1 << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) |
+                   (1 << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST);
+
+    /* Since we know this is on VMX, we can just call the hvm func */
+    if ( hvm_is_singlestep_supported() )
+        capabilities |= (1 << XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP);
+
+    return capabilities;
+}
+
+static inline
+bool_t arch_monitor_domctl_op(struct domain *d,
+                              struct xen_domctl_monitor_op *mop,
+                              int *rc)
+{
+    if( likely(XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP == mop->op) )
+    {
+        domain_pause(d);
+        d->arch.mem_access_emulate_each_rep = !!mop->event;
+        domain_unpause(d);
+        *rc = 0;
+        return 1;
+    }
+    return 0;
+}
+
+bool_t arch_monitor_domctl_event(struct domain *d,
+                                 struct xen_domctl_monitor_op *mop,
+                                 int *rc);
+
+#endif /* __ASM_X86_MONITOR_H__ */
diff --git a/xen/include/asm-x86/monitor_arch.h 
b/xen/include/asm-x86/monitor_arch.h
deleted file mode 100644
index d9daf65..0000000
--- a/xen/include/asm-x86/monitor_arch.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * include/asm-x86/monitor_arch.h
- *
- * Arch-specific monitor_op domctl handler.
- *
- * Copyright (c) 2015 Tamas K Lengyel (tamas@xxxxxxxxxxxxx)
- * Copyright (c) 2016, Bitdefender S.R.L.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License v2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __ASM_X86_MONITOR_ARCH_H__
-#define __ASM_X86_MONITOR_ARCH_H__
-
-#include <xen/sched.h>              /* for struct domain, is_hvm_domain, ... */
-#include <public/domctl.h>          /* for XEN_DOMCTL_MONITOR_#, ... */
-#include <asm/cpufeature.h>         /* for cpu_has_vmx */
-#include <asm/hvm/hvm.h>            /* for hvm_is_singlestep_supported */
-
-static inline
-uint32_t arch_monitor_get_capabilities(struct domain *d)
-{
-    uint32_t capabilities = 0;
-
-    /*
-     * At the moment only Intel HVM domains are supported. However, event
-     * delivery could be extended to AMD and PV domains.
-     */
-    if ( !is_hvm_domain(d) || !cpu_has_vmx )
-        return capabilities;
-
-    capabilities = (1 << XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG) |
-                   (1 << XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR) |
-                   (1 << XEN_DOMCTL_MONITOR_EVENT_SOFTWARE_BREAKPOINT) |
-                   (1 << XEN_DOMCTL_MONITOR_EVENT_GUEST_REQUEST);
-
-    /* Since we know this is on VMX, we can just call the hvm func */
-    if ( hvm_is_singlestep_supported() )
-        capabilities |= (1 << XEN_DOMCTL_MONITOR_EVENT_SINGLESTEP);
-
-    return capabilities;
-}
-
-static inline
-bool_t arch_monitor_domctl_op(struct domain *d,
-                              struct xen_domctl_monitor_op *mop,
-                              int *rc)
-{
-    if( likely(XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP == mop->op) )
-    {
-        domain_pause(d);
-        d->arch.mem_access_emulate_each_rep = !!mop->event;
-        domain_unpause(d);
-        *rc = 0;
-        return 1;
-    }
-    return 0;
-}
-
-bool_t arch_monitor_domctl_event(struct domain *d,
-                                 struct xen_domctl_monitor_op *mop,
-                                 int *rc);
-
-#endif /* __ASM_X86_MONITOR_ARCH_H__ */
-- 
2.5.0


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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.