From: "Luis R. Rodriguez" Subject: [PATCH 1/9] Revert "Use the extra stack for 16bit USB and PS2 keyboard/mouse commands." Date: Fri, 20 Nov 2015 09:47:44 -0800 Message-ID: <1448041672-3986-2-git-send-email-mcgrof@do-not-panic.com> References: <1448041672-3986-1-git-send-email-mcgrof@do-not-panic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1448041672-3986-1-git-send-email-mcgrof@do-not-panic.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com, ian.campbell@citrix.com, JBeulich@suse.com Cc: samuel.thibault@ens-lyon.org, "Luis R. Rodriguez" , Kevin O'Connor , pryorm09@gmail.com, cfergeau@redhat.com List-Id: xen-devel@lists.xenproject.org From: "Luis R. Rodriguez" Upstream commit 12085439561f44107c7d3bea5a333a90ea987643 Kevin made this change upstream to seabios, this is needed for gcc5. Mark Pryor reported the issue with gcc5 a while ago [0], he however failed to follow up with an explanation as to what this does and why this is needed. Revert "Use the extra stack for 16bit USB and PS2 keyboard/mouse commands." It's not valid to pass a pointer to a stack variable through the stack_hop() call (because the call changes the stack segment). This bug was probably not noticed before because by default (CONFIG_ENTRY_EXTRASTACK) SeaBIOS uses the extra stack on all 16bit entry points, and the internal stack_hop() with that config option is effectively a no-op. This reverts commit d488a7683d90bf8fae7ceb8c3ad9e95fbbd92079. Signed-off-by: Kevin O'Connor [0] http://lkml.kernel.org/r/1444332991-1706-1-git-send-email-pryorm09@gmail.com Reported-by: Mark Pryor Cc: Kevin O'Connor Cc: ian.campbell@citrix.com Cc: Jan Beulich Cc: Mark Pryor Signed-off-by: Luis R. Rodriguez --- src/kbd.c | 6 +++--- src/mouse.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kbd.c b/src/kbd.c index 33a95a398feb..fbcecc382eff 100644 --- a/src/kbd.c +++ b/src/kbd.c @@ -11,7 +11,7 @@ #include "hw/ps2port.h" // ps2_kbd_command #include "hw/usb-hid.h" // usb_kbd_command #include "output.h" // debug_enter -#include "stacks.h" // stack_hop +#include "stacks.h" // yield #include "string.h" // memset #include "util.h" // kbd_init @@ -117,8 +117,8 @@ static int kbd_command(int command, u8 *param) { if (usb_kbd_active()) - return stack_hop(command, (u32)param, usb_kbd_command); - return stack_hop(command, (u32)param, ps2_kbd_command); + return usb_kbd_command(command, param); + return ps2_kbd_command(command, param); } // read keyboard input diff --git a/src/mouse.c b/src/mouse.c index 92ae9212c849..100255d60cfb 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -10,7 +10,7 @@ #include "hw/ps2port.h" // ps2_mouse_command #include "hw/usb-hid.h" // usb_mouse_command #include "output.h" // dprintf -#include "stacks.h" // stack_hop +#include "stacks.h" // stack_hop_back #include "util.h" // mouse_init void @@ -27,8 +27,8 @@ static int mouse_command(int command, u8 *param) { if (usb_mouse_active()) - return stack_hop(command, (u32)param, usb_mouse_command); - return stack_hop(command, (u32)param, ps2_mouse_command); + return usb_mouse_command(command, param); + return ps2_mouse_command(command, param); } #define RET_SUCCESS 0x00 -- 2.6.2