From: Stefani Seibold <stefani@seibold.net>
To: Andi Kleen <ak@linux.intel.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
x86@kernel.org, tglx@linutronix.de, mingo@redhat.com,
hpa@zytor.com, aarcange@redhat.com, john.stultz@linaro.org,
luto@amacapital.net, xemul@parallels.com, gorcunov@openvz.org,
andriy.shevchenko@linux.intel.com,
Martin.Runge@rohde-schwarz.com, Andreas.Brief@rohde-schwarz.com
Subject: Re: [PATCH v13 8/9] Add 32 bit VDSO time support for 32 bit kernel
Date: Sun, 09 Feb 2014 09:10:53 +0100 [thread overview]
Message-ID: <1391933453.1014.20.camel@wall-e.seibold.net> (raw)
In-Reply-To: <20140209052230.GL12219@tassilo.jf.intel.com>
Am Samstag, den 08.02.2014, 21:22 -0800 schrieb Andi Kleen:
> > +notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
> > +{
> > + long ret;
> > +
> > + asm(
> > + "push %%ebx \n"
> > + "mov %2,%%ebx \n"
> > + "call VDSO32_vsyscall \n"
> > + "pop %%ebx \n"
> > + : "=a" (ret)
> > + : "0" (__NR_clock_gettime), "d" (clock), "c" (ts)
> > + : "memory");
>
> The push/mov/pop could be just replaced with "b"?
EBX is a reserved as the base register when compiling with -fPIC.
Otherwise it get a "error: can't find a register in class 'BREG' while
reloading 'asm'".
> Also I if this calls syscall.S:__kernel_vsyscall it clobbers more registers
> (ecx at least?) and you need to describe that to gcc with a +
Sine ECX is in use as the second parameter it is still marked as
clobbered.
> Same in the other sys calls.
>
I think it should word... As i know a system call will preserve all
register expect the EAX, which is marked as in and out for this asm()
directive.
> > @@ -310,6 +311,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
> > unsigned long addr;
> > int ret = 0;
> > bool compat;
> > + struct vm_area_struct *vma;
> > + extern char __vvar_page;
> > +#ifdef CONFIG_HPET_TIMER
> > + extern unsigned long hpet_address;
> > +#endif
>
> Put this into a header.
>
Okay...
> > +++ b/arch/x86/vdso/vdso32/vclock_gettime.c
> > @@ -0,0 +1,16 @@
> > +#define BUILD_VDSO32
> > +
> > +#ifdef CONFIG_X86_64
> > +
> > +#define _ASM_X86_PAGE_H
> > +
> > +#define __pa(x) 0
> > +#define __va(x) 0
> > +
> > +#undef CONFIG_ILLEGAL_POINTER_VALUE
> > +#define CONFIG_ILLEGAL_POINTER_VALUE 0
>
> This needs some comments.
>
> Why are the __pa/__va defines safe?
>
> The rest of the patchkit looks reasonable to me from a quick read.
> Much better than the first version.
>
This is due the -m32 compilation, i will get a log of
"warning: integer constant is too large for 'unsigned long' type",
because a unsigned long is only 32 bit.
Since the vclocktime.c use a lot of kernel header a little bit hacking
is necessary, because the CONFIG_X86_64 will attract a lot of x86-64
headers, which are not compatible with 32 bit compilation.
The _ASM_X86_PAGE_H prevents the include of arch/x86/include/asm/page.h.
But the inline function phys_to_virt() in arch/x86/include/asm/io.h
depends on the __pa() and __va() functions, which comes from
arch/x86/include/asm/page.h. So i need two dummys for this.
Since non of this is functions is used in arch/x86/vdso/vclock_gettime.c
it is save.
I have no idea how to fix this weaved include file web without change a
lot in many include files.
The define of CONFIG_ILLEGAL_POINTER_VALUE is also to prevent the
""warning: integer constant is too large...".
- Stefani
next prev parent reply other threads:[~2014-02-09 8:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-08 21:29 [PATCH v13 0/9] Add 32 bit VDSO time function support stefani
2014-02-08 21:29 ` [PATCH v13 1/9] Make vsyscall_gtod_data handling x86 generic stefani
2014-02-08 21:29 ` [PATCH v13 2/9] Add new func _install_special_mapping() to mmap.c stefani
2014-02-08 21:29 ` [PATCH v13 3/9] revamp vclock_gettime.c stefani
2014-02-08 21:29 ` [PATCH v13 4/9] vclock_gettime.c __vdso_clock_gettime cleanup stefani
2014-02-08 21:29 ` [PATCH v13 5/9] replace VVAR(vsyscall_gtod_data) by gtod macro stefani
2014-02-08 21:29 ` [PATCH v13 6/9] cleanup __vdso_gettimeofday stefani
2014-02-08 21:29 ` [PATCH v13 7/9] introduce VVAR marco for vdso32 stefani
2014-02-08 21:29 ` [PATCH v13 8/9] Add 32 bit VDSO time support for 32 bit kernel stefani
2014-02-09 5:22 ` Andi Kleen
2014-02-09 7:21 ` Andi Kleen
2014-02-09 8:15 ` Stefani Seibold
2014-02-09 8:10 ` Stefani Seibold [this message]
2014-02-09 10:05 ` Andi Kleen
2014-02-09 10:43 ` Stefani Seibold
2014-02-09 11:45 ` Stefani Seibold
2014-02-09 20:11 ` H. Peter Anvin
2014-02-08 21:29 ` [PATCH v13 9/9] Add 32 bit VDSO time support for 64 " stefani
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=1391933453.1014.20.camel@wall-e.seibold.net \
--to=stefani@seibold.net \
--cc=Andreas.Brief@rohde-schwarz.com \
--cc=Martin.Runge@rohde-schwarz.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gorcunov@openvz.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xemul@parallels.com \
/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
Powered by JetHome