All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Barbieri <ldb@ldb.ods.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-Kernel ML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Use %ebp rather than %ebx for thread_info pointer
Date: Thu, 9 Jan 2003 21:38:54 +0100	[thread overview]
Message-ID: <20030109203854.GA2952@ldb> (raw)
In-Reply-To: <Pine.LNX.4.44.0301091216490.1890-100000@penguin.transmeta.com>

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

> Hmm.. Did you check what fork
It only seems to use ret_from_fork, that sets up %ebp on its own.
> execve
Doesn't seem to use any function in entry.S
> vm86 do? I know at least the vm86()  
> stuff sets up %ebx before calling the asm functions in entry.S, I bet 
> those need to be changed to use %ebp too with something like this.

Right. This should fix it (compiles but untested):
--- arch/i386/kernel/vm86.c~    2003-01-02 04:21:07.000000000 +0100
+++ arch/i386/kernel/vm86.c     2003-01-09 21:24:58.000000000 +0100
@@ -298,9 +298,10 @@
        __asm__ __volatile__(
                "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t"
                "movl %0,%%esp\n\t"
+               "movl %1,%%ebp\n\t"
                "jmp resume_userspace"
                : /* no outputs */
-               :"r" (&info->regs), "b" (tsk->thread_info) : "ax");
+               :"r" (&info->regs), "r" (tsk->thread_info) : "ax");
        /* we never return here */
 }
  
@@ -311,8 +312,9 @@
        regs32 = save_v86_state(regs16);
        regs32->eax = retval;
        __asm__ __volatile__("movl %0,%%esp\n\t"
+               "movl %1,%%ebp\n\t"
                "jmp resume_userspace"
-               : : "r" (regs32), "b" (current_thread_info()));
+               : : "r" (regs32), "r" (current_thread_info()));
 }
  
 static inline void set_IF(struct kernel_vm86_regs * regs)


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2003-01-09 20:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-09 19:49 [PATCH] Use %ebp rather than %ebx for thread_info pointer Luca Barbieri
2003-01-09 20:09 ` Richard B. Johnson
2003-01-09 20:20   ` Linus Torvalds
2003-01-09 20:18 ` Linus Torvalds
2003-01-09 20:38   ` Luca Barbieri [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=20030109203854.GA2952@ldb \
    --to=ldb@ldb.ods.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 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.