linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	brgerst@gmail.com, castet.matthieu@free.fr, tglx@linutronix.de,
	sfr@canb.auug.org.au, hpa@linux.intel.com, rjw@sisk.pl
Subject: [tip:x86/trampoline] x86, reboot: Fix the use of passed arguments in 32-bit BIOS reboot
Date: Sat, 19 Feb 2011 01:25:13 GMT	[thread overview]
Message-ID: <tip-ee1b06ea6aed979da3b4e6b6ffea98ad55a3c5c1@git.kernel.org> (raw)
In-Reply-To: <AANLkTikxqk=HEw9R-Du=v-1ti1HDGAY9vaNUep2XARaz@mail.gmail.com>

Commit-ID:  ee1b06ea6aed979da3b4e6b6ffea98ad55a3c5c1
Gitweb:     http://git.kernel.org/tip/ee1b06ea6aed979da3b4e6b6ffea98ad55a3c5c1
Author:     H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri, 18 Feb 2011 15:47:42 -0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 18 Feb 2011 15:47:42 -0800

x86, reboot: Fix the use of passed arguments in 32-bit BIOS reboot

The initial version of this patch had %eax being a segment and %ecx
being the mode.  I had changed the interfaces, but not the actual
implementation!

Reported-by: Brian Gerst <brgerst@gmail.com>
LKML-Reference: <AANLkTikxqk=HEw9R-Du=v-1ti1HDGAY9vaNUep2XARaz@mail.gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthieu Castet <castet.matthieu@free.fr>
---
 arch/x86/kernel/reboot_32.S |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/reboot_32.S b/arch/x86/kernel/reboot_32.S
index f242356..29092b3 100644
--- a/arch/x86/kernel/reboot_32.S
+++ b/arch/x86/kernel/reboot_32.S
@@ -23,10 +23,14 @@ r_base = .
 1:	popl	%ebx
 	subl	$1b, %ebx
 
+	/* Compute the equivalent real-mode segment */
+	movl	%ebx, %ecx
+	shrl	$4, %ecx
+	
 	/* Patch post-real-mode segment jump */
-	movw	dispatch_table(%ebx,%ecx,2),%cx
-	movw	%cx, 101f(%ebx)
-	movw	%ax, 102f(%ebx)
+	movw	dispatch_table(%ebx,%eax,2),%ax
+	movw	%ax, 101f(%ebx)
+	movw	%cx, 102f(%ebx)
 
 	/* Set up the IDT for real mode. */
 	lidtl	machine_real_restart_idt(%ebx)

  parent reply	other threads:[~2011-02-19  1:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18  4:56 [RFC] x86: Unify allocation of low memory trampolines H. Peter Anvin
2011-02-18  5:19 ` [tip:x86/trampoline] x86, trampoline: Common infrastructure for " tip-bot for H. Peter Anvin
2011-02-18 12:16   ` Brian Gerst
2011-02-19  1:25     ` [tip:x86/trampoline] x86-64, trampoline: Remove unused variable tip-bot for H. Peter Anvin
2011-08-23 19:05   ` [tip:x86/trampoline] x86, trampoline: Common infrastructure for low memory trampolines Tony Luck
2011-08-23 19:12     ` H. Peter Anvin
2011-08-23 20:26       ` [PATCH] x86: remove some noise from boot log when starting cpus Luck, Tony
2012-02-20 16:08         ` Borislav Petkov
2012-02-22 10:33           ` Ingo Molnar
2012-02-22 10:57             ` Borislav Petkov
2012-02-22 11:29               ` Ingo Molnar
2012-02-22 18:06                 ` [PATCH/resubmit] x86: Remove " Luck, Tony
2012-02-22 18:25                   ` [tip:x86/cpu] " tip-bot for Luck, Tony
2012-02-22 20:34                   ` [tip:x86/debug] x86/debug: Remove ancient debugging " tip-bot for Luck, Tony
2011-02-18  5:19 ` [tip:x86/trampoline] x86, trampoline: Use the unified trampoline setup for ACPI wakeup tip-bot for H. Peter Anvin
2011-03-09 22:41   ` matthieu castet
2011-03-10  0:07     ` Rafael J. Wysocki
2011-02-18  5:19 ` [tip:x86/trampoline] x86: Make the GDT_ENTRY() macro in <asm/segment.h> safe for assembly tip-bot for H. Peter Anvin
2011-02-18  5:20 ` [tip:x86/trampoline] x86, reboot: Move the real-mode reboot code to an assembly file tip-bot for H. Peter Anvin
2011-02-18 12:31   ` Brian Gerst
2011-02-18 17:42     ` H. Peter Anvin
2011-02-19  1:25     ` tip-bot for H. Peter Anvin [this message]
2011-04-29 15:16   ` Alexey Zaytsev
2011-04-29 16:09     ` H. Peter Anvin

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=tip-ee1b06ea6aed979da3b4e6b6ffea98ad55a3c5c1@git.kernel.org \
    --to=hpa@linux.intel.com \
    --cc=brgerst@gmail.com \
    --cc=castet.matthieu@free.fr \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).