From: "H. Peter Anvin" <hpa@zytor.com>
To: stefani@seibold.net
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de,
mingo@redhat.com, ak@linux.intel.com, aarcange@redhat.com,
john.stultz@linaro.org, luto@amacapital.net, xemul@parallels.com,
gorcunov@openvz.org, andriy.shevchenko@linux.intel.com
Subject: Re: [PATCH] Add 32 bit VDSO time function support
Date: Mon, 17 Dec 2012 14:25:18 -0800 [thread overview]
Message-ID: <50CF9BCE.90000@zytor.com> (raw)
In-Reply-To: <1355782365-11307-1-git-send-email-stefani@seibold.net>
On 12/17/2012 02:12 PM, stefani@seibold.net wrote:
> arch/x86/Kconfig | 4 +-
> arch/x86/include/asm/clocksource.h | 4 -
> arch/x86/include/asm/fixmap.h | 6 +-
> arch/x86/include/asm/vgtod.h | 10 ++-
> arch/x86/include/asm/vsyscall.h | 1 -
> arch/x86/include/asm/vvar.h | 5 ++
> arch/x86/kernel/Makefile | 1 +
> arch/x86/kernel/hpet.c | 11 ++-
> arch/x86/kernel/setup.c | 2 +
> arch/x86/kernel/tsc.c | 2 -
> arch/x86/kernel/vmlinux.lds.S | 4 -
> arch/x86/kernel/vsyscall_64.c | 49 -----------
> arch/x86/kernel/vsyscall_gtod.c | 93 +++++++++++++++++++++
> arch/x86/mm/init_32.c | 1 +
> arch/x86/vdso/Makefile | 6 ++
> arch/x86/vdso/vclock_gettime.c | 108 ++++++++++++++++++------
> arch/x86/vdso/vdso32-setup.c | 41 ++++++++++
> arch/x86/vdso/vdso32/vclock_gettime.c | 29 +++++++
> arch/x86/vdso/vdso32/vdso32.lds.S | 3 +
> include/linux/clocksource.h | 1 -
> include/linux/mm.h | 3 +
> include/linux/seqcount.h | 150 ++++++++++++++++++++++++++++++++++
> include/linux/seqlock.h | 145 +-------------------------------
> include/linux/time.h | 3 +-
> include/linux/timekeeper_internal.h | 1 +
> include/linux/types.h | 2 +
> mm/mmap.c | 20 ++++-
> 27 files changed, 457 insertions(+), 248 deletions(-)
> create mode 100644 arch/x86/kernel/vsyscall_gtod.c
> create mode 100644 arch/x86/vdso/vdso32/vclock_gettime.c
> create mode 100644 include/linux/seqcount.h
Please break this up in a series with the generic changes separately first.
> diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
> index 46e24d3..74c80d4 100644
> --- a/arch/x86/include/asm/vgtod.h
> +++ b/arch/x86/include/asm/vgtod.h
> @@ -1,8 +1,8 @@
> #ifndef _ASM_X86_VGTOD_H
> #define _ASM_X86_VGTOD_H
>
> -#include <asm/vsyscall.h>
> -#include <linux/clocksource.h>
> +#include <linux/seqcount.h>
> +#include <uapi/linux/time.h>
>
> struct vsyscall_gtod_data {
> seqcount_t seq;
> @@ -13,7 +13,7 @@ struct vsyscall_gtod_data {
> cycle_t mask;
> u32 mult;
> u32 shift;
> - } clock;
> + } __attribute__((aligned(4),packed)) clock;
>
> /* open coded 'struct timespec' */
> time_t wall_time_sec;
> @@ -24,7 +24,9 @@ struct vsyscall_gtod_data {
> struct timezone sys_tz;
> struct timespec wall_time_coarse;
> struct timespec monotonic_time_coarse;
> -};
> +} __attribute__((aligned(4),packed));
> +
> extern struct vsyscall_gtod_data vsyscall_gtod_data;
>
> +extern void map_vgtod(void);
> #endif /* _ASM_X86_VGTOD_H */
Please use the macros from <linux/compiler.h>. Also, aligned(4) raises
a huge red flag for me. Why??
> diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
> index de656ac..1e71e6c 100644
> --- a/arch/x86/include/asm/vvar.h
> +++ b/arch/x86/include/asm/vvar.h
> @@ -17,7 +17,11 @@
> */
>
> /* Base address of vvars. This is not ABI. */
> +#ifdef CONFIG_X86_64
> #define VVAR_ADDRESS (-10*1024*1024 - 4096)
> +#else
> +#define VVAR_ADDRESS 0xffffd000
> +#endif
>
I thought we had agreed this was going to be part of the vdso and not a
fixmap?
> + struct vm_area_struct *vma = _install_special_mapping(mm,
> + __fix_to_virt(VSYSCALL_HPET) & 0xffffffff,
> + PAGE_SIZE, VM_READ|VM_EXEC|VM_IO|VM_LOCKED,
> + NULL);
This style is generally frowned upon; please separate the declaration
and the assignment. The & 0xffffffff there also looks... "special"...
but again, see previous statement about fixed addresses.
-hpa
prev parent reply other threads:[~2012-12-17 22:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 22:12 [PATCH] Add 32 bit VDSO time function support stefani
2012-12-17 22:22 ` Andy Lutomirski
2012-12-17 22:25 ` H. Peter Anvin [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=50CF9BCE.90000@zytor.com \
--to=hpa@zytor.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gorcunov@openvz.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=stefani@seibold.net \
--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