lkml.org 
[lkml]   [2008]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: hwclock failure in x86.git
    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


    \
     
     \ /
      Last update: 2008-01-11 03:59    [W:0.022 / U:63.484 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site