From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Josh Triplett <josh@joshtriplett.org>, X86 ML <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH 3/3] x86_64,vsyscall: Make vsyscall emulation configurable
Date: Wed, 29 Oct 2014 16:00:16 -0400 [thread overview]
Message-ID: <20141029200016.GK3424@laptop.dumpdata.com> (raw)
In-Reply-To: <CALCETrUihPeKODJqi3tMYwyWYhML1Z=gr4wrVK5VnaFo=KGVJA@mail.gmail.com>
On Tue, Oct 28, 2014 at 11:09:53AM -0700, Andy Lutomirski wrote:
> On Tue, Oct 28, 2014 at 10:57 AM, Josh Triplett <josh@joshtriplett.org> wrote:
> > On Tue, Oct 28, 2014 at 10:22:28AM -0700, Andy Lutomirski wrote:
> >> This adds CONFIG_X86_VSYSCALL_EMULATION, guarded by CONFIG_EXPERT.
> >> Turning it off completely disables vsyscall emulation, saving ~3.5k
> >> for vsyscall_64.c, 4k for vsyscall_emu_64.S (the fake vsyscall
> >> page), some tiny amount of core mm code that supports a gate area,
> >> and possibly 4k for a wasted pagetable. The latter is because the
> >> vsyscall addresses are misaligned and fit poorly in the fixmap.
> >>
> >> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> >
> > One minor nit below, but with or without that change,
> > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> >
> >> --- a/arch/x86/xen/mmu.c
> >> +++ b/arch/x86/xen/mmu.c
> >> @@ -1456,11 +1456,13 @@ static int xen_pgd_alloc(struct mm_struct *mm)
> >> user_pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
> >> page->private = (unsigned long)user_pgd;
> >>
> >> +#ifdef CONFIG_X86_VSYSCALL_EMULATION
> >> if (user_pgd != NULL) {
> >> user_pgd[pgd_index(VSYSCALL_ADDR)] =
> >> __pgd(__pa(level3_user_vsyscall) | _PAGE_TABLE);
> >> ret = 0;
> >> }
> >> +#endif
> >
> > Could you instead make the if use IS_ENABLED?
> >
> > if (IS_ENABLED(CONFIG_X86_VSYSCALL_EMULATION) && user_pgd != NULL)
> >
> > That has the advantage of ensuring that the code continues to compile.
> > (Given that you haven't removed level3_user_vsyscall, that should work.)
>
> I need the ret = 0, I think, so I'll resend.
>
> I think I'd rather use #ifdef here, since I think it would be great if
> the Xen people could clean this up further. With this change, under
> some configurations, there should be no user-accessible kernel
> addresses at all. (Also, is there some PV mechanism
> that I'm not thinking of that will break with this change? I know
> I've tripped over Xen pagetable and fixmap oddities before.)
Not that I know of. The vsyscall is the only one that I know of that
does this.
Do you have a full patchset somewhere for testing?
>
> --Andy
next prev parent reply other threads:[~2014-10-29 20:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 17:22 [PATCH 0/3] x86_64: Tidy up vsyscall emulation and make it optional Andy Lutomirski
2014-10-28 17:22 ` [PATCH 1/3] x86_64,vsyscall: Turn vsyscalls all the way off when vsyscall=none Andy Lutomirski
2014-10-28 17:22 ` [PATCH 2/3] x86_64,vsyscall: Rewrite comment and clean up headers in vsyscall code Andy Lutomirski
2014-10-28 17:22 ` [PATCH 3/3] x86_64,vsyscall: Make vsyscall emulation configurable Andy Lutomirski
2014-10-28 17:57 ` Josh Triplett
2014-10-28 18:09 ` [PATCH 3/3] x86_64, vsyscall: " Andy Lutomirski
2014-10-28 18:09 ` [PATCH 3/3] x86_64,vsyscall: " Andy Lutomirski
2014-10-29 20:00 ` Konrad Rzeszutek Wilk [this message]
2014-10-29 21:30 ` Andy Lutomirski
2014-12-01 15:33 ` [PATCH 3/3] x86_64, vsyscall: " Konrad Rzeszutek Wilk
2014-12-01 15:33 ` [PATCH 3/3] x86_64,vsyscall: " Konrad Rzeszutek Wilk
2014-12-01 23:18 ` Andy Lutomirski
2014-12-01 23:18 ` [PATCH 3/3] x86_64, vsyscall: " Andy Lutomirski
2014-10-29 21:30 ` Andy Lutomirski
2014-10-29 20:00 ` Konrad Rzeszutek Wilk
2014-10-28 17:46 ` [PATCH 0/3] x86_64: Tidy up vsyscall emulation and make it optional josh
2014-10-28 18:04 ` Andy Lutomirski
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=20141029200016.GK3424@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.