All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corneliu ZUZU <czuzu@bitdefender.com>
To: xen-devel@lists.xen.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Tamas K Lengyel <tamas@tklengyel.com>, Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c
Date: Mon,  8 Feb 2016 18:57:56 +0200	[thread overview]
Message-ID: <1454950682-9459-2-git-send-email-czuzu@bitdefender.com> (raw)
In-Reply-To: <1454950682-9459-1-git-send-email-czuzu@bitdefender.com>

X86-side hvm.c is @ arch/x86/hvm/hvm.c. To maintain arm<->x86 symmetry,
also move arch/arm/hvm.c to arch/arm/hvm/hvm.c.

Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
---
 xen/arch/arm/Makefile     |  2 +-
 xen/arch/arm/hvm.c        | 67 -----------------------------------------------
 xen/arch/arm/hvm/Makefile |  1 +
 xen/arch/arm/hvm/hvm.c    | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 68 insertions(+), 68 deletions(-)
 delete mode 100644 xen/arch/arm/hvm.c
 create mode 100644 xen/arch/arm/hvm/Makefile
 create mode 100644 xen/arch/arm/hvm/hvm.c

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 1783912..22f1c75 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,6 +1,7 @@
 subdir-$(CONFIG_ARM_32) += arm32
 subdir-$(CONFIG_ARM_64) += arm64
 subdir-y += platforms
+subdir-y += hvm
 subdir-$(CONFIG_ARM_64) += efi
 
 obj-$(EARLY_PRINTK) += early_printk.o
@@ -34,7 +35,6 @@ obj-y += vgic.o vgic-v2.o
 obj-$(CONFIG_ARM_64) += vgic-v3.o
 obj-y += vtimer.o
 obj-y += vuart.o
-obj-y += hvm.o
 obj-y += device.o
 obj-y += decode.o
 obj-y += processor.o
diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
deleted file mode 100644
index 5fd0753..0000000
--- a/xen/arch/arm/hvm.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/lib.h>
-#include <xen/errno.h>
-#include <xen/guest_access.h>
-#include <xen/sched.h>
-
-#include <xsm/xsm.h>
-
-#include <public/xen.h>
-#include <public/hvm/params.h>
-#include <public/hvm/hvm_op.h>
-
-#include <asm/hypercall.h>
-
-long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
-
-{
-    long rc = 0;
-
-    switch ( op )
-    {
-    case HVMOP_set_param:
-    case HVMOP_get_param:
-    {
-        struct xen_hvm_param a;
-        struct domain *d;
-
-        if ( copy_from_guest(&a, arg, 1) )
-            return -EFAULT;
-
-        if ( a.index >= HVM_NR_PARAMS )
-            return -EINVAL;
-
-        d = rcu_lock_domain_by_any_id(a.domid);
-        if ( d == NULL )
-            return -ESRCH;
-
-        rc = xsm_hvm_param(XSM_TARGET, d, op);
-        if ( rc )
-            goto param_fail;
-
-        if ( op == HVMOP_set_param )
-        {
-            d->arch.hvm_domain.params[a.index] = a.value;
-        }
-        else
-        {
-            a.value = d->arch.hvm_domain.params[a.index];
-            rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
-        }
-
-    param_fail:
-        rcu_unlock_domain(d);
-        break;
-    }
-
-    default:
-    {
-        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
-        rc = -ENOSYS;
-        break;
-    }
-    }
-
-    return rc;
-}
diff --git a/xen/arch/arm/hvm/Makefile b/xen/arch/arm/hvm/Makefile
new file mode 100644
index 0000000..6ee4054
--- /dev/null
+++ b/xen/arch/arm/hvm/Makefile
@@ -0,0 +1 @@
+obj-y += hvm.o
diff --git a/xen/arch/arm/hvm/hvm.c b/xen/arch/arm/hvm/hvm.c
new file mode 100644
index 0000000..1ae681f
--- /dev/null
+++ b/xen/arch/arm/hvm/hvm.c
@@ -0,0 +1,66 @@
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/sched.h>
+
+#include <xsm/xsm.h>
+
+#include <public/xen.h>
+#include <public/hvm/params.h>
+#include <public/hvm/hvm_op.h>
+
+#include <asm/hypercall.h>
+
+long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
+{
+    long rc = 0;
+
+    switch ( op )
+    {
+    case HVMOP_set_param:
+    case HVMOP_get_param:
+    {
+        struct xen_hvm_param a;
+        struct domain *d;
+
+        if ( copy_from_guest(&a, arg, 1) )
+            return -EFAULT;
+
+        if ( a.index >= HVM_NR_PARAMS )
+            return -EINVAL;
+
+        d = rcu_lock_domain_by_any_id(a.domid);
+        if ( d == NULL )
+            return -ESRCH;
+
+        rc = xsm_hvm_param(XSM_TARGET, d, op);
+        if ( rc )
+            goto param_fail;
+
+        if ( op == HVMOP_set_param )
+        {
+            d->arch.hvm_domain.params[a.index] = a.value;
+        }
+        else
+        {
+            a.value = d->arch.hvm_domain.params[a.index];
+            rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0;
+        }
+
+    param_fail:
+        rcu_unlock_domain(d);
+        break;
+    }
+
+    default:
+    {
+        gdprintk(XENLOG_DEBUG, "HVMOP op=%lu: not implemented\n", op);
+        rc = -ENOSYS;
+        break;
+    }
+    }
+
+    return rc;
+}
-- 
2.5.0

  reply	other threads:[~2016-02-08 16:57 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 16:57 [PATCH 0/7] Vm-events: move monitor vm-events code to common code Corneliu ZUZU
2016-02-08 16:57 ` Corneliu ZUZU [this message]
2016-02-08 17:04   ` [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c Andrew Cooper
2016-02-08 17:12     ` Corneliu ZUZU
2016-02-08 17:14       ` Andrew Cooper
2016-02-09 11:03   ` Stefano Stabellini
2016-02-09 11:28     ` Corneliu ZUZU
2016-02-09 11:55       ` Jan Beulich
2016-02-09 12:22         ` Stefano Stabellini
2016-02-09 12:32         ` Corneliu ZUZU
2016-02-09 17:40           ` Tamas K Lengyel
2016-02-09 19:19             ` Corneliu ZUZU
2016-02-08 16:57 ` [PATCH 2/7] x86: hvm events: merge 2 functions into 1 Corneliu ZUZU
2016-02-08 17:15   ` Andrew Cooper
2016-02-08 17:30     ` Tamas K Lengyel
2016-02-08 17:49     ` Corneliu ZUZU
2016-02-08 18:17       ` Tamas K Lengyel
2016-02-08 18:45         ` Corneliu ZUZU
2016-02-09 11:19   ` Jan Beulich
2016-02-09 11:52     ` Corneliu ZUZU
2016-02-09 12:12       ` Jan Beulich
2016-02-09 12:24         ` Corneliu ZUZU
2016-02-08 16:57 ` [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side Corneliu ZUZU
2016-02-08 18:15   ` Tamas K Lengyel
2016-02-08 18:43     ` Corneliu ZUZU
2016-02-08 18:50       ` Tamas K Lengyel
2016-02-08 16:57 ` [PATCH 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h Corneliu ZUZU
2016-02-08 18:18   ` Tamas K Lengyel
2016-02-08 18:55     ` Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 5/7] xen/vm-events: Move hvm_event_* functions to common-side Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 6/7] Rename event_x86.c to event.c and event_arch.h to event.h + minor fixes Corneliu ZUZU
2016-02-08 16:58 ` [PATCH 7/7] arch.monitor: move bits to common (arch_domain to domain) Corneliu ZUZU
2016-02-08 18:29   ` Tamas K Lengyel
2016-02-09  7:14     ` Corneliu ZUZU
2016-02-08 17:06 ` [PATCH 0/7] Vm-events: move monitor vm-events code to common code Corneliu ZUZU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454950682-9459-2-git-send-email-czuzu@bitdefender.com \
    --to=czuzu@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tamas@tklengyel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.