LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: Greg KH <greg@kroah.com>,
	linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Olaf Hering <olh@suse.de>,
	linuxppc64-dev <linuxppc64-dev@ozlabs.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH] powerpc: vdso 64bits gettimeofday bug
Date: Sun, 26 Feb 2006 08:09:00 +1100	[thread overview]
Message-ID: <1140901740.24957.29.camel@localhost.localdomain> (raw)

A bug in the assembly code of the vdso can cause gettimeofday() to hang
or to return incorrect results. The wrong register was used to test for
pending updates of the calibration variables and to create a dependency
for subsequent loads. This fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Might be worth applying to the stable series too and/or distro kernels
2.6.15 and later

--- linux-work.orig/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-02-26 08:02:57.000000000 +1100
+++ linux-work/arch/powerpc/kernel/vdso64/gettimeofday.S	2006-02-26 08:04:23.000000000 +1100
@@ -225,9 +225,9 @@
   .cfi_startproc
 	/* check for update count & load values */
 1:	ld	r8,CFG_TB_UPDATE_COUNT(r3)
-	andi.	r0,r4,1			/* pending update ? loop */
+	andi.	r0,r8,1			/* pending update ? loop */
 	bne-	1b
-	xor	r0,r4,r4		/* create dependency */
+	xor	r0,r8,r8		/* create dependency */
 	add	r3,r3,r0
 
 	/* Get TB & offset it */

                 reply	other threads:[~2006-02-25 21:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1140901740.24957.29.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=olh@suse.de \
    --cc=torvalds@osdl.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