From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
X86 ML <x86@kernel.org>, Ingo Molnar <mingo@kernel.org>,
Denys Vlasenko <vda.linux@googlemail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Denys Vlasenko <dvlasenk@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@alien8.de>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86, paravirt, xen: Remove the 64-bit irq_enable_sysexit pvop
Date: Mon, 6 Apr 2015 10:10:51 -0400 [thread overview]
Message-ID: <20150406141051.GF12596@l.oracle.com> (raw)
In-Reply-To: <CALCETrUExZ9jfn+KuXa4UzKk6Px7McC1aD32oEXi-P0o5tCYSQ@mail.gmail.com>
On Fri, Apr 03, 2015 at 03:52:30PM -0700, Andy Lutomirski wrote:
> [cc: Boris and Konrad. Whoops]
>
> On Fri, Apr 3, 2015 at 3:51 PM, Andy Lutomirski <luto@kernel.org> wrote:
> > We don't use irq_enable_sysexit on 64-bit kernels any more. Remove
Is there an commit (or name of patch) that explains why 32-bit-user-space-on-64-bit
kernels is unsavory?
Thank you!
> > all the paravirt and Xen machinery to support it on 64-bit kernels.
> >
> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> > ---
> >
> > I haven't actually tested this on Xen, but it builds for me.
> >
> > arch/x86/ia32/ia32entry.S | 6 ------
> > arch/x86/include/asm/paravirt_types.h | 7 ++++---
> > arch/x86/kernel/asm-offsets.c | 2 ++
> > arch/x86/kernel/paravirt.c | 4 +++-
> > arch/x86/kernel/paravirt_patch_64.c | 1 -
> > arch/x86/xen/enlighten.c | 3 ++-
> > arch/x86/xen/xen-asm_64.S | 16 ----------------
> > arch/x86/xen/xen-ops.h | 2 ++
> > 8 files changed, 13 insertions(+), 28 deletions(-)
> >
> > diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
> > index 5d8f987a340d..eb1eb7b70f4b 100644
> > --- a/arch/x86/ia32/ia32entry.S
> > +++ b/arch/x86/ia32/ia32entry.S
> > @@ -77,12 +77,6 @@ ENTRY(native_usergs_sysret32)
> > swapgs
> > sysretl
> > ENDPROC(native_usergs_sysret32)
> > -
> > -ENTRY(native_irq_enable_sysexit)
> > - swapgs
> > - sti
> > - sysexit
> > -ENDPROC(native_irq_enable_sysexit)
> > #endif
> >
> > /*
> > diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
> > index 7549b8b369e4..38a0ff9ef06e 100644
> > --- a/arch/x86/include/asm/paravirt_types.h
> > +++ b/arch/x86/include/asm/paravirt_types.h
> > @@ -160,13 +160,14 @@ struct pv_cpu_ops {
> > u64 (*read_pmc)(int counter);
> > unsigned long long (*read_tscp)(unsigned int *aux);
> >
> > +#ifdef CONFIG_X86_32
> > /*
> > * Atomically enable interrupts and return to userspace. This
> > - * is only ever used to return to 32-bit processes; in a
> > - * 64-bit kernel, it's used for 32-on-64 compat processes, but
> > - * never native 64-bit processes. (Jump, not call.)
> > + * is only used in 32-bit kernels. 64-bit kernels use
> > + * usergs_sysret32 instead.
> > */
> > void (*irq_enable_sysexit)(void);
> > +#endif
> >
> > /*
> > * Switch to usermode gs and return to 64-bit usermode using
> > diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
> > index 9f6b9341950f..2d27ebf0aed8 100644
> > --- a/arch/x86/kernel/asm-offsets.c
> > +++ b/arch/x86/kernel/asm-offsets.c
> > @@ -49,7 +49,9 @@ void common(void) {
> > OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
> > OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
> > OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
> > +#ifdef CONFIG_X86_32
> > OFFSET(PV_CPU_irq_enable_sysexit, pv_cpu_ops, irq_enable_sysexit);
> > +#endif
> > OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
> > OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
> > #endif
> > diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
> > index 548d25f00c90..7563114d9c3a 100644
> > --- a/arch/x86/kernel/paravirt.c
> > +++ b/arch/x86/kernel/paravirt.c
> > @@ -154,7 +154,9 @@ unsigned paravirt_patch_default(u8 type, u16 clobbers, void *insnbuf,
> > ret = paravirt_patch_ident_64(insnbuf, len);
> >
> > else if (type == PARAVIRT_PATCH(pv_cpu_ops.iret) ||
> > +#ifdef CONFIG_X86_32
> > type == PARAVIRT_PATCH(pv_cpu_ops.irq_enable_sysexit) ||
> > +#endif
> > type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret32) ||
> > type == PARAVIRT_PATCH(pv_cpu_ops.usergs_sysret64))
> > /* If operation requires a jmp, then jmp */
> > @@ -371,7 +373,7 @@ __visible struct pv_cpu_ops pv_cpu_ops = {
> >
> > .load_sp0 = native_load_sp0,
> >
> > -#if defined(CONFIG_X86_32) || defined(CONFIG_IA32_EMULATION)
> > +#if defined(CONFIG_X86_32)
> > .irq_enable_sysexit = native_irq_enable_sysexit,
> > #endif
> > #ifdef CONFIG_X86_64
> > diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
> > index a1da6737ba5b..0de21c62c348 100644
> > --- a/arch/x86/kernel/paravirt_patch_64.c
> > +++ b/arch/x86/kernel/paravirt_patch_64.c
> > @@ -49,7 +49,6 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
> > PATCH_SITE(pv_irq_ops, save_fl);
> > PATCH_SITE(pv_irq_ops, irq_enable);
> > PATCH_SITE(pv_irq_ops, irq_disable);
> > - PATCH_SITE(pv_cpu_ops, irq_enable_sysexit);
> > PATCH_SITE(pv_cpu_ops, usergs_sysret32);
> > PATCH_SITE(pv_cpu_ops, usergs_sysret64);
> > PATCH_SITE(pv_cpu_ops, swapgs);
> > diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> > index 81665c9f2132..3797b6b31f95 100644
> > --- a/arch/x86/xen/enlighten.c
> > +++ b/arch/x86/xen/enlighten.c
> > @@ -1267,10 +1267,11 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = {
> > .read_tscp = native_read_tscp,
> >
> > .iret = xen_iret,
> > - .irq_enable_sysexit = xen_sysexit,
> > #ifdef CONFIG_X86_64
> > .usergs_sysret32 = xen_sysret32,
> > .usergs_sysret64 = xen_sysret64,
> > +#else
> > + .irq_enable_sysexit = xen_sysexit,
> > #endif
> >
> > .load_tr_desc = paravirt_nop,
> > diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S
> > index 985fc3ee0973..a2cabb8bd6bf 100644
> > --- a/arch/x86/xen/xen-asm_64.S
> > +++ b/arch/x86/xen/xen-asm_64.S
> > @@ -47,22 +47,6 @@ ENTRY(xen_iret)
> > ENDPATCH(xen_iret)
> > RELOC(xen_iret, 1b+1)
> >
> > -/*
> > - * sysexit is not used for 64-bit processes, so it's only ever used to
> > - * return to 32-bit compat userspace.
> > - */
> > -ENTRY(xen_sysexit)
> > - pushq $__USER32_DS
> > - pushq %rcx
> > - pushq $X86_EFLAGS_IF
> > - pushq $__USER32_CS
> > - pushq %rdx
> > -
> > - pushq $0
> > -1: jmp hypercall_iret
> > -ENDPATCH(xen_sysexit)
> > -RELOC(xen_sysexit, 1b+1)
> > -
> > ENTRY(xen_sysret64)
> > /*
> > * We're already on the usermode stack at this point, but
> > diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
> > index 9e195c683549..c20fe29e65f4 100644
> > --- a/arch/x86/xen/xen-ops.h
> > +++ b/arch/x86/xen/xen-ops.h
> > @@ -134,7 +134,9 @@ DECL_ASM(void, xen_restore_fl_direct, unsigned long);
> >
> > /* These are not functions, and cannot be called normally */
> > __visible void xen_iret(void);
> > +#ifdef CONFIG_X86_32
> > __visible void xen_sysexit(void);
> > +#endif
> > __visible void xen_sysret32(void);
> > __visible void xen_sysret64(void);
> > __visible void xen_adjust_exception_frame(void);
> > --
> > 2.3.0
> >
>
>
>
> --
> Andy Lutomirski
> AMA Capital Management, LLC
next prev parent reply other threads:[~2015-04-06 14:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 22:51 [PATCH] x86, paravirt, xen: Remove the 64-bit irq_enable_sysexit pvop Andy Lutomirski
2015-04-03 22:52 ` Andy Lutomirski
2015-04-06 14:10 ` Konrad Rzeszutek Wilk [this message]
2015-04-06 15:29 ` Andy Lutomirski
2015-04-06 17:44 ` [Xen-devel] " Andrew Cooper
2015-04-06 18:30 ` Boris Ostrovsky
2015-04-06 20:03 ` Andy Lutomirski
2015-04-06 20:27 ` Boris Ostrovsky
2015-04-21 18:56 ` Andy Lutomirski
2015-04-22 13:35 ` Borislav Petkov
2015-04-22 14:09 ` [tip:x86/asm] x86, paravirt, xen: Remove the 64-bit -> irq_enable_sysexit() pvop tip-bot for 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=20150406141051.GF12596@l.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=vda.linux@googlemail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox