The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] x86-32: Fix alignment of alternative instruction entries
@ 2011-09-21  4:45 Ben Hutchings
  2011-09-21 10:06 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2011-09-21  4:45 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: LKML, Andres Salomon, Andy Lutomirski, Arnaud Lacombe

The altinstruction_entry macro was originally used only on x86-64,
and assumed 64-bit pointers and alignment.

Commit b4ca46e4e82a0a5976fe5eab85be585d75f8202f ("x86-32: Fix boot
with CONFIG_X86_INVD_BUG") introduced a use of the macro on x86-32.
Before this, the 64-bit pointers had been replaced by 32-bit offsets,
so it worked - in at least one case.  However, the alignment is still
wrong for x86-32, which can result in zero-padding between entries and
a BUG in apply_alternatives.

Reported-by: Andres Salomon <dilinger@queued.net>
References: http://bugs.debian.org/640964
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/x86/include/asm/alternative-asm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h
index 4554cc6..d00dc2a 100644
--- a/arch/x86/include/asm/alternative-asm.h
+++ b/arch/x86/include/asm/alternative-asm.h
@@ -16,7 +16,7 @@
 #endif
 
 .macro altinstruction_entry orig alt feature orig_len alt_len
-	.align 8
+	_ASM_ALIGN
 	.long \orig - .
 	.long \alt - .
 	.word \feature
-- 
1.7.5.4



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

end of thread, other threads:[~2011-09-21 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21  4:45 [PATCH] x86-32: Fix alignment of alternative instruction entries Ben Hutchings
2011-09-21 10:06 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox