Re: hwclock failure in x86.git

From: Zach Brown
Date: Thu Jan 10 2008 - 21:55:59 EST


I'm no expert, but I happened to notice this go by.

> The first thing I notice about the path is that ioport_32.c and the unified ioport.c use __clear_bit,
> while ioport_64.c uses clear_bit.

That doesn't seem too critical.

> +#ifdef CONFIG_X86_32
> +asmlinkage long sys_iopl(unsigned long regsp)
> +{
> + volatile struct pt_regs *regs = (struct pt_regs *)&regsp;
> + unsigned int level = regs->bx;
> + unsigned int old = (regs->flags >> 12) & 3;
> +
> + if (level > 3)
> + return -EINVAL;
> + /* Trying to gain more privileges? */
> + if (level > old) {
> + if (!capable(CAP_SYS_RAWIO))
> + return -EPERM;
> + }
> + regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | (level << 12);
> +
> + return 0;
> +}

> -asmlinkage long sys_iopl(unsigned long regsp)
> -{
> - volatile struct pt_regs *regs = (struct pt_regs *)&regsp;
> - unsigned int level = regs->bx;
> - unsigned int old = (regs->flags >> 12) & 3;
> - struct thread_struct *t = &current->thread;
> -
> - if (level > 3)
> - return -EINVAL;
> - /* Trying to gain more privileges? */
> - if (level > old) {
> - if (!capable(CAP_SYS_RAWIO))
> - return -EPERM;
> - }
> -
> - t->iopl = level << 12;
> - regs->flags = (regs->flags & ~X86_EFLAGS_IOPL) | t->iopl;
> - set_iopl_mask(t->iopl);
> -
> - return 0;
> -}

Is it OK that we lost the different final steps of those two functions?
It looks like someone might have missed the differing tail sections of
the function when copying and pasting and updating just the start of the
functions?

Sorry if I missed why this is OK and intended, I didn't read very closely.

- z
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/