[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Frame buffer mmap not working in pvops dom0



On 07/21/2010 03:00 PM, Konrad Rzeszutek Wilk wrote:
>> I have been dumping the page tables (using the attached pt-dump script,
>> as qemu's "info tlb" only works on i386) from a paused qemu instance
>> that is running a simple mmap-and-spin program (also attached). All 100
>> pages map to physical memory address 39a4c000.
> 
> The qemu output then isn't going to a VNC window but something else. I
> presume the something else is the SDL piece? Were there any special flags
> to enable this on QEMU?

The exact command line I'm using is:

qemu-kvm -daemonize -usbdevice tablet -m 1024 \
        -monitor unix:fc13-mon,server,nowait \
        -net nic -net tap /dev/lvm0/FC13-64

This uses SDL graphics, which is qemu's default. Within qemu, I use
vga=ask on the xen command line in grub.

>> >From a bit more debugging, I've been able to trace the correct address
>> (0xf0000000) being lost when it is passed by xen_make_pte to
>> pte_pfn_to_mfn and eventually to get_phys_to_machine(0xf0000) which
>> returns -1. Still not sure where the final physical address is coming
>> from, but I'm guessing this is part of the problem.
> 
> That looks like the VM_IO flag (_PAGE_IOMAP on the PTE) is not set somewhere.
> Do you have an idea what piece of kernel code gets triggered when QEMU does
> 'mmap' on the /dev/fb0?
> 
> On my machine where I use KMS/DRM it ends up calling 'ttm_fb_mmap'. But
> for your system, where it looks that you are using the "old" framebuffer
> code it might be something entirely different.
> 

The code path is fb_mmap with a NULL fbops->fb_mmap, so it just
delegates to the default code. Specifically, io_remap_pfn_range is where
the bad mapping is requested.

I have a patch that fixes the issue, but I'm not sure under what
conditions the _PAGE_IOMAP bit needs to be set.

--- a/arch/x86/include/asm/fb.h
+++ b/arch/x86/include/asm/fb.h
@@ -10,6 +10,7 @@ static inline void fb_pgprotect
 {
        if (boot_cpu_data.x86 > 3)
                pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
+       pgprot_val(vma->vm_page_prot) |= _PAGE_IOMAP;
 }

 #ifdef CONFIG_X86_32

-- 

Daniel De Graaf
National Security Agency

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.