From patchwork Wed Mar 27 21:18:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Van Heukelum X-Patchwork-Id: 2353311 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id DE2063FC8C for ; Wed, 27 Mar 2013 21:18:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC570E5CB8 for ; Wed, 27 Mar 2013 14:18:20 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 92608E5C1F for ; Wed, 27 Mar 2013 14:18:06 -0700 (PDT) Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 6ECEF20BF2; Wed, 27 Mar 2013 17:18:05 -0400 (EDT) Received: from web3.nyi.mail.srv.osa ([10.202.2.213]) by compute4.internal (MEProxy); Wed, 27 Mar 2013 17:18:05 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= message-id:from:to:cc:mime-version:content-transfer-encoding :content-type:subject:date:in-reply-to:references; s=mesmtp; bh= fOoViYNXSBxfbKpDF+lHRa1F3zs=; b=ZsMSb3nH2XIitJjGAVZJm0tZbcmZh0JI oN2OSCMe0IMBKxH/W4w8C/qILSXrJ3zK0aCVGpIlrvM/6W8/bRSg8DCKM70UmnD5 FbMkuifYYTbZyEJosmFDHNjkdjZw9YSma06Wl7DGm2/MAZvsdDKCwk7eO0iYlcl7 utMNTaOzf3k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=fOoViYNXSBxfbKpDF+lHRa1F3zs=; b=T8j+p y9hYrCGs6sgzxwo7AD37jtfE4vwDWKjbJ8UNCZVwkZqV/nfvgKNcfUZS9p4PB6M/ KYXZd2HbM5B9N5KEhe04dTiKTTvZ0ySBvZ1d5v06ZePW7cUWmX7c5xJ7Mf8Io/ZB o9uTLds9LMmDSpG/CKkOMKdz/1gL0UQzr22czQ= Received: by web3.nyi.mail.srv.osa (Postfix, from userid 99) id 462CD8C09BF; Wed, 27 Mar 2013 17:18:05 -0400 (EDT) Message-Id: <1364419085.8454.140661210031889.49ED573A@webmail.messagingengine.com> X-Sasl-Enc: 2VRmOinZors4XNx6tgHHc20V4Lavvp4MsZMWmQOPBIky 1364419085 From: Alexander van Heukelum To: Al Viro MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface - html Date: Wed, 27 Mar 2013 22:18:05 +0100 In-Reply-To: <20130327194614.GA21522@ZenIV.linux.org.uk> References: <514F6DF9.1070602@xmsnet.nl> <1364332526.8559.140661209554365.0203B0A4@webmail.messagingengine.com> <5152F321.7020604@xmsnet.nl> <1364412662.12858.140661209988437.506AD50B@webmail.messagingengine.com> <20130327194614.GA21522@ZenIV.linux.org.uk> Cc: intel-gfx , Ingo Molnar , Linux Kernel Mailing List , Hans de Bruin Subject: [Intel-gfx] [PATCH v2] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org On Wed, Mar 27, 2013, at 20:46, Al Viro wrote: > On Wed, Mar 27, 2013 at 08:31:02PM +0100, Alexander van Heukelum wrote: > > Hi Al, > > > > Hans de Bruin found a regression due to one of your changes. I asked him to test a fix and he reported back that it worked. (Thanks!) Can you see if you agree with the fix? Patch is attached due to webmail... > > Use SYSCALL_DEFINE{1,2} for vm86_old and vm86, please. Like this? Greetings, Alexander From 450d86e6ad0a7d387cf706714c1fc030bb4b13a5 Mon Sep 17 00:00:00 2001 From: Alexander van Heukelum Date: Tue, 26 Mar 2013 21:57:43 +0100 Subject: [PATCH] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) Commit 49cb25e9290 x86: 'get rid of pt_regs argument in vm86/vm86old' got rid of the pt_regs stub for sys_vm86old and sys_vm86. The functions were, however, not changed to use the calling convention for syscalls. [v2] Use SYSCALL_DEFINEx(...). Compiles to identical code. The regression was reported and pinpointed by Hans de Bruin: > commit 49cb25e9290 x86: 'get rid of pt_regs argument in vm86/vm86old' > somehow breaks the colors when I play 'civilization I' under xdosemu. > During the intro of the game something the colors get messed up. When > the game begins the grass of the earth is red. Reverting the commit > fixes the problem. And he tested the patch too: > Yep, the grass is green again. Reported-and-tested-by: Hans de Bruin Signed-off-by: Alexander van Heukelum --- arch/x86/include/asm/syscalls.h | 4 ++-- arch/x86/kernel/vm86_32.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 6cf0a9c..5a0be0a 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h @@ -37,8 +37,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *); unsigned long sys_sigreturn(void); /* kernel/vm86_32.c */ -int sys_vm86old(struct vm86_struct __user *); -int sys_vm86(unsigned long, unsigned long); +asmlinkage long sys_vm86old(struct vm86_struct __user *); +asmlinkage long sys_vm86(unsigned long, unsigned long); #else /* CONFIG_X86_32 */ diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index 1cf5766..a67cb2b 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,6 @@ #include #include #include -#include /* * Known problems: @@ -202,7 +202,7 @@ out: static int do_vm86_irq_handling(int subfunction, int irqnumber); static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); -int sys_vm86old(struct vm86_struct __user *v86) +SYSCALL_DEFINE1(vm86old, struct vm86_struct __user *, v86) { struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. @@ -227,11 +227,12 @@ int sys_vm86old(struct vm86_struct __user *v86) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: + asmlinkage_protect(1, ret, v86); return ret; } -int sys_vm86(unsigned long cmd, unsigned long arg) +SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg) { struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. @@ -278,6 +279,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: + asmlinkage_protect(2, ret, cmd, arg); return ret; } -- 1.8.1.2