Re: [PATCH 1/4] Make vsyscall_gtod_data handling x86 generic

From: Stefani Seibold
Date: Thu Jan 30 2014 - 14:26:53 EST


Am Donnerstag, den 30.01.2014, 10:05 -0800 schrieb Andy Lutomirski:
> On Thu, Jan 30, 2014 at 2:49 AM, <stefani@xxxxxxxxxxx> wrote:
> > diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
> > index 59c6c40..45ba688 100644
> > --- a/arch/x86/include/asm/compat.h
> > +++ b/arch/x86/include/asm/compat.h
> > @@ -295,6 +295,10 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
> >
> > static inline void __user *arch_compat_alloc_user_space(long len)
> > {
> > +#ifdef CONFIG_X86_32
> > + struct pt_regs *regs = task_pt_regs(current);
> > + return (void __user *)regs->sp - len;
>
> Is there some reason this doesn't need to be aligned?
>

The reason is that this function will not used for 32 bit kernels, but
will the header will be included... This prevents an error!

> > +#else
> > compat_uptr_t sp;
> >
> > if (test_thread_flag(TIF_IA32)) {
> > @@ -305,6 +309,7 @@ static inline void __user *arch_compat_alloc_user_space(long len)
> > }
> >
> > return (void __user *)round_down(sp - len, 16);
> > +#endif
> > }
> >
> > +#define CREATE_TRACE_POINTS
> > +#include "vsyscall_trace.h"
> > +
> > +void __init map_vsyscall(void)
> > +{
> > + extern char __vvar_page;
> > + unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page);
> > +
> > + __set_fixmap(VVAR_PAGE, physaddr_vvar_page, PAGE_KERNEL_VVAR);
>
> Given that the compat version of this can't (I assume) use a fixmap,
> is there any good reason to not just use the same vma-based code for
> compat and real 32-bit kernels?
>

The reason is compability! And it saves two Pages of logical address
space wenn using not the VMA compat mode.

BTW: It would be a great thing if you would not send back the hole
patch. If is very hard to find your replies in tons of line!


--
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/