LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Zach Brown <zach.brown@oracle.com>
To: Kevin Winchester <kjwinchester@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: hwclock failure in x86.git
Date: Thu, 10 Jan 2008 18:55:49 -0800 [thread overview]
Message-ID: <4786DAB5.6000809@oracle.com> (raw)
In-Reply-To: <20080110222744.05f86b18.kjwinchester@gmail.com>
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 *)®sp;
> + 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 *)®sp;
> - unsigned int level = regs->bx;
> - unsigned int old = (regs->flags >> 12) & 3;
> - struct thread_struct *t = ¤t->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
prev parent reply other threads:[~2008-01-11 2:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 23:28 Kevin Winchester
2008-01-10 23:32 ` H. Peter Anvin
2008-01-10 23:50 ` Kevin Winchester
2008-01-11 1:13 ` H. Peter Anvin
2008-01-11 2:04 ` Kevin Winchester
2008-01-11 14:03 ` Ingo Molnar
2008-01-11 23:58 ` Miguel Botón
2008-01-12 1:04 ` [PATCH] x86: fix ioport unification on 32-bit [was: Re: hwclock failure in x86.git] Chris Wright
2008-01-12 1:06 ` [PATCH] x86: refactor ioport unification Chris Wright
2008-01-14 8:32 ` Ingo Molnar
2008-01-14 8:27 ` [PATCH] x86: fix ioport unification on 32-bit [was: Re: hwclock failure in x86.git] Ingo Molnar
2008-01-11 2:27 ` hwclock failure in x86.git Kevin Winchester
2008-01-11 2:55 ` Zach Brown [this message]
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=4786DAB5.6000809@oracle.com \
--to=zach.brown@oracle.com \
--cc=hpa@zytor.com \
--cc=kjwinchester@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--subject='Re: hwclock failure in x86.git' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).