All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.23..2.6.24] Backport r and q constraints fixes
@ 2010-03-05 18:40 Luis R. Rodriguez
  2010-03-18 23:51 ` [stable] " Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Luis R. Rodriguez @ 2010-03-05 18:40 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: hpa, mingo, tglx, stephen.chen, cliff.holden, mcgrof,
	Luis R. Rodriguez

Upstream commit: 811a0fff5d6e80e18e06be88e0fb685f3924bf8f

This patch included on 2.6.25 is required to be backported to compile
both the 2.6.23 and 2.6.24 kernels on x86_64 systems with a modern
toolchain. Otherwise you get this pesky assembly error:

arch/i386/boot/boot.h: Assembler messages:
arch/i386/boot/boot.h:112: Error: bad register name `%dil'

	Author: H. Peter Anvin <hpa@zytor.com>
	Date:   Wed Jan 30 13:33:02 2008 +0100

	    x86 setup: fix constraints in segment accessor functions
	    
	    Fix the operand constraints for the segment accessor functions,
	    {rd,wr}{fs,gs}*.  In particular, the 8-bit functions used "r"
	    constraints instead of "q" constraints.
	    
	    Signed-off-by: H. Peter Anvin <hpa@zytor.com>
	    Signed-off-by: Ingo Molnar <mingo@elte.hu>
	    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---

This patch is not likely to be applied upstream as 2.6.23.y and 2.6.24.y
are both dead now. Use at least the latest 2.6.27.y as that is the latest
supported kernel. I put this out there though in case someone also is looking
for a solution and does not have an option to upgrade. May the google cache
be with you.

--- arch/i386/boot/boot.h.orig	2010-01-05 17:03:12.000000000 -0800
+++ arch/i386/boot/boot.h	2010-01-06 00:14:04.000000000 -0800
@@ -109,7 +109,7 @@
 static inline u8 rdfs8(addr_t addr)
 {
 	u8 v;
-	asm volatile("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr));
+	asm volatile("movb %%fs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
 	return v;
 }
 static inline u16 rdfs16(addr_t addr)
@@ -127,21 +127,21 @@
 
 static inline void wrfs8(u8 v, addr_t addr)
 {
-	asm volatile("movb %1,%%fs:%0" : "+m" (*(u8 *)addr) : "r" (v));
+	asm volatile("movb %1,%%fs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
 }
 static inline void wrfs16(u16 v, addr_t addr)
 {
-	asm volatile("movw %1,%%fs:%0" : "+m" (*(u16 *)addr) : "r" (v));
+	asm volatile("movw %1,%%fs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
 }
 static inline void wrfs32(u32 v, addr_t addr)
 {
-	asm volatile("movl %1,%%fs:%0" : "+m" (*(u32 *)addr) : "r" (v));
+	asm volatile("movl %1,%%fs:%0" : "+m" (*(u32 *)addr) : "ri" (v));
 }
 
 static inline u8 rdgs8(addr_t addr)
 {
 	u8 v;
-	asm volatile("movb %%gs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr));
+	asm volatile("movb %%gs:%1,%0" : "=q" (v) : "m" (*(u8 *)addr));
 	return v;
 }
 static inline u16 rdgs16(addr_t addr)
@@ -159,15 +159,15 @@
 
 static inline void wrgs8(u8 v, addr_t addr)
 {
-	asm volatile("movb %1,%%gs:%0" : "+m" (*(u8 *)addr) : "r" (v));
+	asm volatile("movb %1,%%gs:%0" : "+m" (*(u8 *)addr) : "qi" (v));
 }
 static inline void wrgs16(u16 v, addr_t addr)
 {
-	asm volatile("movw %1,%%gs:%0" : "+m" (*(u16 *)addr) : "r" (v));
+	asm volatile("movw %1,%%gs:%0" : "+m" (*(u16 *)addr) : "ri" (v));
 }
 static inline void wrgs32(u32 v, addr_t addr)
 {
-	asm volatile("movl %1,%%gs:%0" : "+m" (*(u32 *)addr) : "r" (v));
+	asm volatile("movl %1,%%gs:%0" : "+m" (*(u32 *)addr) : "ri" (v));
 }
 
 /* Note: these only return true/false, not a signed return value! */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [stable] [PATCH 2.6.23..2.6.24] Backport r and q constraints fixes
  2010-03-05 18:40 [PATCH 2.6.23..2.6.24] Backport r and q constraints fixes Luis R. Rodriguez
@ 2010-03-18 23:51 ` Greg KH
  2010-03-19  0:34   ` Luis R. Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2010-03-18 23:51 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linux-kernel, stable, mcgrof, stephen.chen, cliff.holden, hpa,
	mingo, tglx

On Fri, Mar 05, 2010 at 01:40:04PM -0500, Luis R. Rodriguez wrote:
> Upstream commit: 811a0fff5d6e80e18e06be88e0fb685f3924bf8f
> 
> This patch included on 2.6.25 is required to be backported to compile
> both the 2.6.23 and 2.6.24 kernels on x86_64 systems with a modern
> toolchain. Otherwise you get this pesky assembly error:

You do realize that the .23 and .24 kernels are no longer supported,
right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [stable] [PATCH 2.6.23..2.6.24] Backport r and q constraints  fixes
  2010-03-18 23:51 ` [stable] " Greg KH
@ 2010-03-19  0:34   ` Luis R. Rodriguez
  0 siblings, 0 replies; 3+ messages in thread
From: Luis R. Rodriguez @ 2010-03-19  0:34 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, stable, stephen.chen, cliff.holden, hpa, mingo,
	tglx

On Thu, Mar 18, 2010 at 4:51 PM, Greg KH <greg@kroah.com> wrote:
> On Fri, Mar 05, 2010 at 01:40:04PM -0500, Luis R. Rodriguez wrote:
>> Upstream commit: 811a0fff5d6e80e18e06be88e0fb685f3924bf8f
>>
>> This patch included on 2.6.25 is required to be backported to compile
>> both the 2.6.23 and 2.6.24 kernels on x86_64 systems with a modern
>> toolchain. Otherwise you get this pesky assembly error:
>
> You do realize that the .23 and .24 kernels are no longer supported,
> right?

Heh yes, but figured the google cache will still support those users.

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-19  0:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-05 18:40 [PATCH 2.6.23..2.6.24] Backport r and q constraints fixes Luis R. Rodriguez
2010-03-18 23:51 ` [stable] " Greg KH
2010-03-19  0:34   ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.