From 6eacb48d33e03efe28fc665bfb5cea9d3b248b14 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 3 Aug 2009 16:33:40 -0700 Subject: [PATCH] --- yaml --- r: 156229 b: refs/heads/master c: f1f029c7bfbf4ee1918b90a431ab823bed812504 h: refs/heads/master i: 156227: 22f7177640d256a120c6e52d71875ea3d3f537ca v: v3 --- [refs] | 2 +- trunk/arch/x86/include/asm/irqflags.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 69982fd67950..120d17412b92 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bab9a3da93bfe09c609407dedae5708b07a7ac56 +refs/heads/master: f1f029c7bfbf4ee1918b90a431ab823bed812504 diff --git a/trunk/arch/x86/include/asm/irqflags.h b/trunk/arch/x86/include/asm/irqflags.h index 2bdab21f0898..c6ccbe7e81ad 100644 --- a/trunk/arch/x86/include/asm/irqflags.h +++ b/trunk/arch/x86/include/asm/irqflags.h @@ -12,9 +12,15 @@ static inline unsigned long native_save_fl(void) { unsigned long flags; + /* + * Note: this needs to be "=r" not "=rm", because we have the + * stack offset from what gcc expects at the time the "pop" is + * executed, and so a memory reference with respect to the stack + * would end up using the wrong address. + */ asm volatile("# __raw_save_flags\n\t" "pushf ; pop %0" - : "=g" (flags) + : "=r" (flags) : /* no input */ : "memory");