Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7460ed28 authored by John Stultz's avatar John Stultz Committed by Linus Torvalds
Browse files

[PATCH] time: x86_64: re-enable vsyscall support for x86_64



Cleanup and re-enable vsyscall gettimeofday using the generic clocksource
infrastructure.

[akpm@osdl.org: cleanup]
Signed-off-by: default avatarJohn Stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <ak@muc.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1489939f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@ config GENERIC_TIME
	bool
	default y

config GENERIC_TIME_VSYSCALL
	bool
	default y

config ZONE_DMA32
	bool
	default y
+6 −0
Original line number Diff line number Diff line
@@ -458,6 +458,11 @@ static cycle_t read_hpet(void)
	return (cycle_t)readl(hpet_ptr);
}

static cycle_t __vsyscall_fn vread_hpet(void)
{
	return readl((void __iomem *)fix_to_virt(VSYSCALL_HPET) + 0xf0);
}

struct clocksource clocksource_hpet = {
	.name		= "hpet",
	.rating		= 250,
@@ -466,6 +471,7 @@ struct clocksource clocksource_hpet = {
	.mult		= 0, /* set below */
	.shift		= HPET_SHIFT,
	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
	.vread		= vread_hpet,
};

static int __init init_hpet_clocksource(void)
+0 −6
Original line number Diff line number Diff line
@@ -53,13 +53,7 @@ DEFINE_SPINLOCK(rtc_lock);
EXPORT_SYMBOL(rtc_lock);
DEFINE_SPINLOCK(i8253_lock);

unsigned long vxtime_hz = PIT_TICK_RATE;

struct vxtime_data __vxtime __section_vxtime;	/* for vsyscalls */

volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
struct timespec __xtime __section_xtime;
struct timezone __sys_tz __section_sys_tz;

unsigned long profile_pc(struct pt_regs *regs)
{
+7 −0
Original line number Diff line number Diff line
@@ -180,6 +180,12 @@ static cycle_t read_tsc(void)
	return ret;
}

static cycle_t __vsyscall_fn vread_tsc(void)
{
	cycle_t ret = (cycle_t)get_cycles_sync();
	return ret;
}

static struct clocksource clocksource_tsc = {
	.name			= "tsc",
	.rating			= 300,
@@ -188,6 +194,7 @@ static struct clocksource clocksource_tsc = {
	.shift			= 22,
	.flags			= CLOCK_SOURCE_IS_CONTINUOUS |
				  CLOCK_SOURCE_MUST_VERIFY,
	.vread			= vread_tsc,
};

void mark_tsc_unstable(void)
+11 −17
Original line number Diff line number Diff line
@@ -88,31 +88,25 @@ SECTIONS
  __vsyscall_0 = VSYSCALL_VIRT_ADDR;

  . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  .xtime_lock : AT(VLOAD(.xtime_lock)) { *(.xtime_lock) }
  xtime_lock = VVIRT(.xtime_lock);

  .vxtime : AT(VLOAD(.vxtime)) { *(.vxtime) }
  vxtime = VVIRT(.vxtime);
  .vsyscall_fn : AT(VLOAD(.vsyscall_fn)) { *(.vsyscall_fn) }
  . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data))
		{ *(.vsyscall_gtod_data) }
  vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data);

  .vgetcpu_mode : AT(VLOAD(.vgetcpu_mode)) { *(.vgetcpu_mode) }
  vgetcpu_mode = VVIRT(.vgetcpu_mode);

  .sys_tz : AT(VLOAD(.sys_tz)) { *(.sys_tz) }
  sys_tz = VVIRT(.sys_tz);

  .sysctl_vsyscall : AT(VLOAD(.sysctl_vsyscall)) { *(.sysctl_vsyscall) }
  sysctl_vsyscall = VVIRT(.sysctl_vsyscall);

  .xtime : AT(VLOAD(.xtime)) { *(.xtime) }
  xtime = VVIRT(.xtime);

  . = ALIGN(CONFIG_X86_L1_CACHE_BYTES);
  .jiffies : AT(VLOAD(.jiffies)) { *(.jiffies) }
  jiffies = VVIRT(.jiffies);

  .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1)) { *(.vsyscall_1) }
  .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2)) { *(.vsyscall_2) }
  .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) { *(.vsyscall_3) }
  .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1))
		{ *(.vsyscall_1) }
  .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2))
		{ *(.vsyscall_2) }
  .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3))
		{ *(.vsyscall_3) }

  . = VSYSCALL_VIRT_ADDR + 4096;

Loading