--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -55,8 +55,6 @@ static xen_kexec_image_t kexec_image[KEX
static unsigned long kexec_flags = 0; /* the lowest bits are for KEXEC_IMAGE... */
-static spinlock_t kexec_lock = SPIN_LOCK_UNLOCKED;
-
static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
static size_t vmcoreinfo_size = 0;
@@ -851,10 +849,9 @@ static int do_kexec_op_internal(unsigned
XEN_GUEST_HANDLE_PARAM(void) uarg,
bool_t compat)
{
- unsigned long flags;
- int ret = -EINVAL;
+ static DEFINE_SPINLOCK(kexec_lock);
+ int ret = xsm_kexec(XSM_PRIV);
- ret = xsm_kexec(XSM_PRIV);
if ( ret )
return ret;
@@ -868,7 +865,7 @@ static int do_kexec_op_internal(unsigned
break;
case KEXEC_CMD_kexec_load:
case KEXEC_CMD_kexec_unload:
- spin_lock_irqsave(&kexec_lock, flags);
+ spin_lock(&kexec_lock);
if (!test_bit(KEXEC_FLAG_IN_PROGRESS, &kexec_flags))
{
if (compat)
@@ -876,7 +873,7 @@ static int do_kexec_op_internal(unsigned
else
ret = kexec_load_unload(op, uarg);
}
- spin_unlock_irqrestore(&kexec_lock, flags);
+ spin_unlock(&kexec_lock);
break;
case KEXEC_CMD_kexec:
ret = kexec_exec(uarg);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel