Skip to contentSkip to conversation

Change x86 Machine check handler to use unlocked_iocl instead of ioctl

PATCH Applied Nikanth Karthikesan 3 participants 3 messages Jan 9, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change x86 Machine check handler to use unlocked_iocl instead of ioctl

The Machine check handler registers ioctl handler that is called with the BKL held. Changing to register unlocked_ioctl instead. Also mce ioctl handler does not seem to need any lock protection.

To: Andi Kleen <[email protected]>
Cc: [email protected]
Cc: [email protected]

Change the Machine check handler to use unlocked_ioctl instead of ioctl handler. Also the mce ioctl handler does not need any lock protection.

---

(quoted diff) +0 -0

b/arch/x86/kernel/cpu/mcheck/mce_64.c
index 4b21d29..d3baa62 100644

arch/x86/kernel/cpu/mcheck/mce_64.c +0 -0
@@ -634,8 +634,7 @@ static unsigned int mce_poll(struct file *file,

poll_table *wait)
return 0;
}

-static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd,
- unsigned long arg)
+static long mce_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
{
int __user *p = (int __user *)arg;

@@ -664,7 +663,7 @@ static const struct file_operations mce_chrdev_ops = {
.release = mce_release,
.read = mce_read,
.poll = mce_poll,
- .ioctl = mce_ioctl,
+ .unlocked_ioctl = mce_ioctl,
};

static struct miscdevice mce_log_device = {

#1 lore raw
Quoted 3 lines · Nikanth Karthikesan

The Machine check handler registers ioctl handler that is called with the BKL held. Changing to register unlocked_ioctl instead. Also mce ioctl handler does not seem to need any lock protection.

Thanks, but I already did that here on my own.

-Andi

Applied
#2 lore raw
In reply to Nikanth Karthikesan
Quoted 7 lines · Nikanth Karthikesan

The Machine check handler registers ioctl handler that is called with the BKL held. Changing to register unlocked_ioctl instead. Also mce ioctl handler does not seem to need any lock protection.

Change the Machine check handler to use unlocked_ioctl instead of ioctl handler. Also the mce ioctl handler does not need any lock protection.

thanks, applied to x86.git. Mcelog functionality uses cmpxchg so no need for the BKL there. The ioctl still being BKL is purely historic and it was never relied on.

Ingo