mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Miles Lane" <miles.lane@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Joerg Roedel" <joerg.roedel@amd.com>, "Andi Kleen" <ak@suse.de>
Subject: Re: 2.6.21-rc2-mm2 -- hot-fix "revert-optimize-and-simplify-get_cycles_sync.patch" broke my build
Date: Wed, 7 Mar 2007 11:37:16 -0800	[thread overview]
Message-ID: <20070307113716.97558767.akpm@linux-foundation.org> (raw)
In-Reply-To: <a44ae5cd0703071101q16188b9pc5e8dbc226a7283d@mail.gmail.com>

On Wed, 7 Mar 2007 11:01:55 -0800 "Miles Lane" <miles.lane@gmail.com> wrote:

> In file included from include/asm/timex.h:10,
>                  from include/linux/timex.h:187,
>                  from include/linux/sched.h:50,
>                  from include/linux/utsname.h:35,
>                  from include/asm/elf.h:12,
>                  from include/linux/elf.h:7,
>                  from include/linux/module.h:15,
>                  from include/linux/crypto.h:21,
>                  from arch/i386/kernel/asm-offsets.c:7:
> include/asm/tsc.h: In function 'get_cycles_sync':
> include/asm/tsc.h:45: warning: implicit declaration of function 'alternative_io'
> include/asm/tsc.h:46: error: called object '"=a"' is not a function
> include/asm/tsc.h:46: error: called object '"0"' is not a function
> include/asm/tsc.h:46: error: expected ')' before ':' token
> make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1

Yes, I ended up dropping another patch to fix that up and things got in a
mess.

Andy's patch should fix it up again


From: Andy Whitcroft <apw@shadowen.org>

Add an i386 implementation of alternative_io modelled on
the x86_64 version.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/asm-i386/alternative.h |   17 +++++++++++++++++
 include/asm-i386/tsc.h         |    1 +
 2 files changed, 18 insertions(+)

diff -puN include/asm-i386/alternative.h~i386-alternative_io-implementation include/asm-i386/alternative.h
--- a/include/asm-i386/alternative.h~i386-alternative_io-implementation
+++ a/include/asm-i386/alternative.h
@@ -100,6 +100,23 @@ static inline void alternatives_smp_swit
 		      "663:\n\t" newinstr "\n664:\n"   /* replacement */\
 		      ".previous" :: "i" (feature), ##input)
 
+#define alternative_io(oldinstr, newinstr, feature, output, input...)	\
+	asm volatile ("661:\n\t" oldinstr "\n662:\n"			\
+		      ".section .altinstructions,\"a\"\n"		\
+		      "  .align 4\n"					\
+		      "  .long 661b\n"            /* label */		\
+		      "  .long 663f\n"		  /* new instruction */ \
+		      "  .long 0x00\n"					\
+		      "  .byte %c[feat]\n"        /* feature bit */	\
+		      "  .byte 0x00\n"					\
+		      "  .byte 662b-661b\n"       /* sourcelen */	\
+		      "  .byte 664f-663f\n"       /* replacementlen */ 	\
+		      "  .byte 0x00\n"					\
+		      ".previous\n"					\
+		      ".section .altinstr_replacement,\"ax\"\n"		\
+		      "663:\n\t" newinstr "\n664:\n"   /* replacement */\
+		      ".previous" : output : [feat] "i" (feature), ##input)
+
 /* Like alternative_io, but supports 2 possible alternatives */
 #define alternative_io_two(oldinstr, newinstr, feat, newinstr2, feat2,\
 		output, input...) \
diff -puN include/asm-i386/tsc.h~i386-alternative_io-implementation include/asm-i386/tsc.h
--- a/include/asm-i386/tsc.h~i386-alternative_io-implementation
+++ a/include/asm-i386/tsc.h
@@ -6,6 +6,7 @@
 #ifndef _ASM_i386_TSC_H
 #define _ASM_i386_TSC_H
 
+#include <asm/alternative.h>
 #include <asm/processor.h>
 
 /*
_


      reply	other threads:[~2007-03-07 19:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 19:01 Miles Lane
2007-03-07 19:37 ` Andrew Morton [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=20070307113716.97558767.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ak@suse.de \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@gmail.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