[Bug 422081] New: Xen - unichrome: xf86MapVidMem: Could not mmap framebuffer (Bad address)
https://bugzilla.novell.com/show_bug.cgi?id=422081 Summary: Xen - unichrome: xf86MapVidMem: Could not mmap framebuffer (Bad address) Product: openSUSE 11.0 Version: Final Platform: i586 OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: X.Org AssignedTo: sndirsch@novell.com ReportedBy: novell.com-pnt@ladisch.de QAContact: xorg-maintainer-bugs@forge.provo.novell.com Found By: Community User Created an attachment (id=236679) --> (https://bugzilla.novell.com/attachment.cgi?id=236679) /var/log/Xorg.0.log (running correctly) X.Org with unichrome runs correctly with regular kernel, see attached Xorg.0.log. It crashes with Xen, see attached Xorg.0.log.old: Fatal server error: xf86MapVidMem: Could not mmap framebuffer (0x00000000,0x4000000) (Bad address)
rpm -qa|grep "xen\|driver-video\|x11-server"|sort kernel-xen-2.6.25.11-0.1 xen-3.2.1_16881_04-4.2 xen-libs-3.2.1_16881_04-4.2 xen-tools-3.2.1_16881_04-4.2 xorg-x11-driver-video-7.3-138.5 xorg-x11-driver-video-radeonhd-1.2.1_080522_566ba69-6.1 xorg-x11-driver-video-unichrome-20080411-16.1 xorg-x11-server-7.3-110.9
/usr/sbin/hwinfo --gfx 09: PCI 100.0: 0300 VGA compatible controller (VGA) [Created at pci.310] UDI: /org/freedesktop/Hal/devices/pci_1106_3108 Unique ID: VCu0.40G_e7uDiNF Parent ID: vSkL.CP+qXDDqow8 SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0 SysFS BusID: 0000:01:00.0 Hardware Class: graphics card Model: "VIA VT3108: K8M800, K8N800, K8N800A" Vendor: pci 0x1106 "VIA Technologies, Inc." Device: pci 0x3108 "VT3108: K8M800, K8N800, K8N800A" SubVendor: pci 0x1458 "Giga-byte Technology" SubDevice: pci 0xd000 Revision: 0x01 Memory Range: 0xe4000000-0xe7ffffff (rw,prefetchable) Memory Range: 0xe8000000-0xe8ffffff (rw,non-prefetchable) Memory Range: 0xe9000000-0xe900ffff (ro,prefetchable,disabled) IRQ: 16 (100001 events) I/O Ports: 0x3c0-0x3df (rw) Module Alias: "pci:v00001106d00003108sv00001458sd0000D000bc03sc00i00" Driver Info #0: XFree86 v4 Server Module: unichrome Config Status: cfg=no, avail=yes, need=no, active=unknown Attached to: #27 (PCI bridge)
Primary display adapter: #9 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c1
--- Comment #1 from Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c2
--- Comment #2 from Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
Stefan Dirsch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c3
Luc Verhaegen
https://bugzilla.novell.com/show_bug.cgi?id=422081
User sndirsch@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c4
Stefan Dirsch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User jbeulich@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c6
Jan Beulich
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c7
--- Comment #7 from Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c8
Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c9
--- Comment #9 from Luc Verhaegen
Unfortunately I have a hard time understanding #3: How can the frame buffer validly live at (physcial) address 0?
All of the physical RAM sitting off the CPU starts at address 0, the CPUs memory controller sees all of it, including the bit reserved for the framebuffer. The BIOS, yes, through E820, just doesn't mention that reserved part (which always sits at the top of this physical ram).
/dev/mem under Xen is somewhat different from native for obvious reasons: It doesn't allow you to access RAM, only MMIO regions (as reported by BIOS INT 15 Fn E820) can be accessed (and the region mmap()-ed must be consisting of only MMIO, there may not be any RAM portions, but that's probably not the problem here).
X maps memory, any memory, through /dev/mem. I understand that Xen changes things and makes it impossible to use direct RAM access for FB. But this still leaves me wondering: how does X map a memory BAR on our graphics device if only MMIO BARs are accessible? Why are you not running into issues with other drivers? Anyway, for my driver, i am looking into two things: * Is there an easy way for me, an X driver, to tell that Xen is active, so that i can go and map the PCI BAR instead. * Is there a way for me to still map a part of physical memory? Direct RAM access really is a night and day difference on this hardware. Any read or write to the FB then becomes a simple copy from one bit of RAM to the other. Without direct access, any read/write would uselessly loop the same data over the HT busses to the northbridge. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=422081
Stefan Dirsch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User jbeulich@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c10
Jan Beulich
All of the physical RAM sitting off the CPU starts at address 0, the CPUs memory controller sees all of it, including the bit reserved for the framebuffer. The BIOS, yes, through E820, just doesn't mention that reserved part (which always sits at the top of this physical ram).
As long as the E820 map reports the range in question as RAM, Xen won't allow you to map it (and Dom0 generally can't even assume it owns it). But I can't see how that scenario would work in a native kernel either. At the example of the E820 map provided (or one you would provide) - could you illustrate where the memory range in question would be located? Note that in my previous reply, I considered MMIO any memory that is not RAM from an E820 perspective - meaning that any such memory (be it, as you name them, from an MMIO BAR or a memory BAR) can be mapped through /dev/mem under Xen.
* Is there an easy way for me, an X driver, to tell that Xen is active, so that i can go and map the PCI BAR instead.
You'd see /proc/xen/ as well as various entries under /sys/hypervisor/.
* Is there a way for me to still map a part of physical memory?
As said above - as long as the memory is not marked as RAM in the E820 map, there should be no problem. But clearly, address 00000000 will always be marked as such on any PC-compatible system (and I continue to not believe that the frame buffer would be sitting there). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c11
Luc Verhaegen
From the very laptop i am using...
dmesg: [17179569.184000] BIOS-provided physical RAM map: [17179569.184000] BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) [17179569.184000] BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) [17179569.184000] BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved) [17179569.184000] BIOS-e820: 0000000000100000 - 000000001bff0000 (usable) [17179569.184000] BIOS-e820: 000000001bff0000 - 000000001bffffc0 (ACPI data) [17179569.184000] BIOS-e820: 000000001bffffc0 - 000000001c000000 (ACPI NVS) [17179569.184000] BIOS-e820: 00000000fff80000 - 0000000100000000 (reserved) [17179569.184000] 0MB HIGHMEM available. [17179569.184000] 447MB LOWMEM available. Xorg.0.log: (--) VIA(0): mapping framebuffer @ 0x1c000000 with size 0x4000000 So a 512MB machine with 64MB reserved for FB. The cpu memory controller sees all of it, E820 just doesn't mention it. Ok, so there is a way for me to find whether it is a xen kernel or not. Now... I see a rather big problem with the posted log... Problem one is that i am missing some messages before calling the function that eventually calls xf86MapVidMem, we should've seen some messages sent to the log before the server bails out. One of these messages should tell us the following: (--) VIA(0): mapping framebuffer @ 0x00000000 with size 0x4000000 The other is: i am talking to the VIA northbridge's ghost memory controller to retrieve the total memory size, and then substract the known FB size, which is also read from the same pci devices' config space. So... Julian, please provide the output of the following commands under the Xen kernel: setpci -s 0:0.3 44.L setpci -s 0:0.3 A0.L The first will get us the pci config address that tells us the known RAM size, the second tells us the known FB size, amongst others. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=422081
User jbeulich@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c12
--- Comment #12 from Jan Beulich
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c13
Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c14
Luc Verhaegen
https://bugzilla.novell.com/show_bug.cgi?id=422081
User novell.com-pnt@ladisch.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c15
Julian Ladisch
https://bugzilla.novell.com/show_bug.cgi?id=422081
Stefan Dirsch
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c19
Luc Verhaegen
https://bugzilla.novell.com/show_bug.cgi?id=422081
User lverhaegen@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=422081#c20
Luc Verhaegen
participants (1)
-
bugzilla_noreply@novell.com