Bug 14332

Summary: hw/xfree86/int10/helper_exec.c does ugly things to the BIOS
Product: xorg Reporter: Martin-Éric Racine <martin-eric.racine>
Component: Server/DDX/XorgAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: bart
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
URL: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-amd/+bug/140051
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
x86emu blacklist patch
none
x86emu PCI bus polling patch
none
X86EMU: handle CPUID instruction (passthrough)
none
14106: X86EMU: handle CPUID instruction (Gutsy, x-platform)
none
X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch
none
X86EMU-when-emulating-PCI-access-use-the-correct-d.patch none

Description Martin-Éric Racine 2008-02-01 17:04:02 UTC
As discovered while investigating the above Ubuntu bug (see URL), x86emu does ugly things to the BIOS, when polling for DDC. This downright crashes the hardware, on platforms with picky BIOS.

Two patches have been made against X server 1.3 and X server 1.4, also found at the above bug report. They need to be merged into GIT before X server 1.5 is released.
Comment 2 Daniel Stone 2008-02-01 17:25:34 UTC
Not sure how XFree86 int10 support counts as 'core protocol' ...
Comment 3 Martin-Éric Racine 2008-02-02 03:12:57 UTC
Created attachment 14088 [details] [review]
x86emu blacklist patch

This is the first of two patches required to fix x86emu.
Comment 4 Martin-Éric Racine 2008-02-02 03:14:11 UTC
Created attachment 14089 [details] [review]
x86emu PCI bus polling patch

This second patch to x86emu fixes PCI bus polling.
Comment 5 Bart Trojanowski 2008-02-02 16:59:00 UTC
Created attachment 14106 [details] [review]
X86EMU: handle CPUID instruction (passthrough)

I have another related patch to add CPUID instruction emulation to x86emu.
Comment 6 Martin-Éric Racine 2008-02-03 05:15:28 UTC
The CPUID patch solves an issue that appeared with several video drivers starting with X server 1.3, where CTRL+ALT+F* would not successfully bring the user to the vcons anymore, even though this works fine when compiling the same video driver against an older X server.
Comment 7 Bart Trojanowski 2008-02-03 09:58:19 UTC
Created attachment 14122 [details] [review]
14106: X86EMU: handle CPUID instruction (Gutsy, x-platform)

This is an updated patch for CPUID instruction emulation, after absorbing sugestsions from xorg mailing list and IRC channel.
Comment 8 Eric Anholt 2008-02-19 12:04:01 UTC
14089 needs a fixed commit message at least
Comment 9 Adam Jackson 2008-02-29 14:23:31 UTC
The CPUID fix is already in master.

It's not clear from the description in attachment #14089 [details] [review], so: the bug there is that we should access the register on the device specified by the write to 0xcf8, which is not necessarily the video device.  It could easily be, say, the host bridge.

pciaccess makes this patch not apply directly, but basically we need to use the value written to 0xcf8 to construct a struct pci_device.  Whee.
Comment 10 Bart Trojanowski 2008-03-01 06:43:44 UTC
Created attachment 14731 [details] [review]
X86EMU-added-blacklist-for-I-O-port-in-0-0xFF-range.patch

This is a port of the "black list" patch to the master branch of xorg.
Comment 11 Bart Trojanowski 2008-03-01 06:45:02 UTC
Created attachment 14732 [details] [review]
X86EMU-when-emulating-PCI-access-use-the-correct-d.patch

This is a port of the patch, that fixes incorrect PCI device access bug, to the master branch.
Comment 12 Bart Trojanowski 2008-03-01 06:46:03 UTC
Please note that I have had issues building X from git so I was unable to test these patches.
Comment 13 Adam Jackson 2008-04-07 13:51:41 UTC
With the change to not treat the high bit of 0xcf8 as part of the domain number, this pretty much works now, as far as I can tell.

I'd like to see the blacklist done some other way, but the "right" way is probably a far more generic overhaul of ioport services than I really want to get into atm.  Taking this off the 7.4 blocker on the basis that it works again, but leaving open for further blacklist work.
Comment 14 Adam Jackson 2010-08-09 13:05:54 UTC
Good enough.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.