NetBSD Problem Report #47129

From apb@apb.cequrux.com  Fri Oct 26 09:34:23 2012
Return-Path: <apb@apb.cequrux.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id B491B63CA81
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 26 Oct 2012 09:34:22 +0000 (UTC)
Message-Id: <20121026093412.ACA223B339C@apb-laptoy.apb.alt.za>
Date: Fri, 26 Oct 2012 09:34:12 +0000 (UTC)
From: apb@cequrux.com
Reply-To: apb@cequrux.com
To: gnats-bugs@gnats.NetBSD.org
Subject: mouse won't move diagonally in i386 X11 on amd64 kernel
X-Send-Pr-Version: 3.95

>Number:         47129
>Category:       bin
>Synopsis:       mouse won't move diagonally in i386 X11 on amd64 kernel
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 26 09:35:00 +0000 2012
>Closed-Date:    Fri Sep 30 08:12:09 +0000 2016
>Last-Modified:  Fri Sep 30 08:12:09 +0000 2016
>Originator:     Alan Barrett
>Release:        NetBSD 6.99.14
>Organization:
Not much
>Environment:
userland, including X11, form NetBSD-6.99.14/i386
kernel from NetBSD-6.99.14/amd64
>Description:
	When running an i386 userland, including X11, on an amd64 kernel,
	the mouse pointer moves only horizontally and vertically,
	it won't move in any other direction.

	Attempts to move in other directions usually result in horizontal
	movement.  Moving vertically is possible only if you aim carefully.

>How-To-Repeat:
	See Description.

	Some possibly relevant lines from the i386 dmesg are:

	pckbc1 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
	pckbc2 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
	pckbd0 at pckbc1 (kbd slot)
	pckbc1: using irq 1 for kbd slot
	wskbd0 at pckbd0: console keyboard
	pms0 at pckbc1 (aux slot)
	pms0: Synaptics touchpad version 7.2
	pms0: Palm detect
	pckbc1: using irq 12 for aux slot
	wsmouse0 at pms0 mux 0
>Fix:

>Release-Note:

>Audit-Trail:
From: Alan Barrett <apb@cequrux.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/47129: mouse won't move diagonally in i386 X11 on amd64
 kernel
Date: Fri, 26 Oct 2012 12:02:09 +0200

 On Fri, 26 Oct 2012, apb@apb.cequrux.com wrote:
 >	When running an i386 userland, including X11, on an amd64 kernel,
 >	the mouse pointer moves only horizontally and vertically,
 >	it won't move in any other direction.

 /var/log/Xorg.log contains messages like this:

 [   168.141] (II) Using input driver 'mouse' for '<default pointer>'
 [   168.141] (II) Loading /usr/X11R7/lib/modules/drivers/mouse_drv.so
 [   168.141] (**) Option "CorePointer"
 [   168.141] (**) <default pointer>: always reports core events
 [   168.141] (WW) <default pointer>: No Device specified, looking for one...
 [   168.177] (II) <default pointer>: found Device "/dev/wsmouse"
 [   168.180] (--) <default pointer>: Device: "/dev/wsmouse"
 [   168.180] (==) <default pointer>: Protocol: "WSMouse"
 [   168.180] (**) <default pointer>: always reports core events
 [   168.180] (**) Option "Device" "/dev/wsmouse"
 [   168.218] (==) <default pointer>: Emulate3Buttons, Emulate3Timeout: 50
 [   168.218] (**) <default pointer>: ZAxisMapping: buttons 4 and 5
 [   168.218] (**) <default pointer>: Buttons: 9
 [   168.218] (II) XINPUT: Adding extended input device "<default pointer>" (type: MOUSE)
 [   168.218] (**) <default pointer>: (accel) keeping acceleration scheme
 1
 [   168.218] (**) <default pointer>: (accel) acceleration profile 0
 [   168.218] (**) <default pointer>: (accel) acceleration factor: 2.000
 [   168.218] (**) <default pointer>: (accel) acceleration threshold: 4


 [   174.765] (WW) <default pointer>: bad wsmouse event type=0
 [   174.777] (WW) <default pointer>: bad wsmouse event type=0
 [   174.789] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=304285762
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=334296789
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=374314848
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=394323294
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=0
 [   174.963] (WW) <default pointer>: bad wsmouse event type=414331860



From: Alan Barrett <apb@cequrux.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/47129: mouse won't move diagonally in i386 X11 on amd64
 kernel
Date: Sat, 27 Oct 2012 19:44:30 +0200

 >	When running an i386 userland, including X11, on an amd64 kernel,
 >	the mouse pointer moves only horizontally and vertically,
 >	it won't move in any other direction.

 This problem is traceable to the change in struct timespec between i386
 and amd64.  struct timespec is embedded in struct wscons_event, which
 is used for data read from the mouse.  struct timespec contains "long
 tv_nsec", which is 32 bits on i386, and 64 bits on amd64.  (Defining
 tv_nsec as long doesn't really make sense, because there is no need to
 represent values larger than 1000000000, so 32 bits would have been
 plenty, but POSIX specifies long and NetBSD apparently chose not to
 deviate from POSIX here.)

 To fix this 32-bit userland/64-bit kernel compatibility issue,
 wsevent_setversion() (which is called for ioctl WSMOUSEIO_SETVERSION)
 could be changed to record whether or not the calling process is
 running under netbsd32 emulation, and wsevent_copyout_events() could be
 changed to perform the appropriate data format conversions for netbsd32
 emulation.

 I have working code for this, but it is not yet integrated into the
 compat infrastructure.  With my patches, the mouse works correctly in an
 i386 version of X11 running on an amd64 kernel.

 I also suggest changing the WSMOUSEIO_SETVERSION, WSKBDIO_SETVERSION,
 and WSDISPLAYIO_SETVERSION ioctl requests to take an unsigned int
 instead of a signed int, to make it easier for the kernel implementation
 to steal some of the bits to represent flags (such as whether or not
 netbsd32 emulation is needed).  This can be done without affecting
 binary compatibility.

 --apb (Alan Barrett)

From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, apb@cequrux.com
Subject: Re: bin/47129: mouse won't move diagonally in i386 X11 on amd64 kernel
Date: Sun, 28 Oct 2012 15:10:28 +0000

 On Sat, Oct 27, 2012 at 05:45:03PM +0000, Alan Barrett wrote:
 >  
 >  This problem is traceable to the change in struct timespec between i386
 >  and amd64.  struct timespec is embedded in struct wscons_event, which
 >  is used for data read from the mouse.  struct timespec contains "long
 >  tv_nsec", which is 32 bits on i386, and 64 bits on amd64.  (Defining
 >  tv_nsec as long doesn't really make sense, because there is no need to
 >  represent values larger than 1000000000, so 32 bits would have been
 >  plenty, but POSIX specifies long and NetBSD apparently chose not to
 >  deviate from POSIX here.)

 That wouldn't have helped, the 'seconds' part is 64bit, so the amd64
 timespec would contain 4 bytes of padding - total 16 bytes.
 The i386 one is 12 bytes.

 	David

 -- 
 David Laight: david@l8s.co.uk

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 13 Jul 2014 03:55:22 +0000
State-Changed-Why:
Didn't we eventually fix this?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Fri, 30 Sep 2016 08:12:09 +0000
State-Changed-Why:
yes, this was fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.