Re: None of the virtual/physical/bus address matches the (base) BAR-0 register

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

 



Hi Bjorn.

I tried enabling and dumping the kernel-page-tables (via
/sys/kernel/debug/kernel_page_tables), but there we only have the
kernel-virtual-addresses :-\

So, I tried navigating the code (beginning from
arch/x86/mm/debug_pagetables.c), and stumbled upon
slow_virt_to_phys(), and hit the jackpot !
Even the code there looks as simple as the procedure - we fetch the
pte for the vpn, get the mapped pfn, and return the physical-address
after adding offset.

#####################################################################
So, now, the following :

    {
        phys_addr_t mmu_mapped_address;

        printk("original (kernel-virtual) address \t= [%lx]\n",
bar0_ptr);

        mmu_mapped_address = slow_virt_to_phys(bar0_ptr);
        printk("mapped address (via MMU) \t\t= [%lx]\n", mmu_mapped_address);
    }
#####################################################################



gives :

#####################################################################
original (kernel-virtual) address     = [ffffa11040217000]
mapped address (via MMU)         = [e2c20000]
#####################################################################



Thanks a ton Bjorn, this could not have been possible without you !


Thanks and Regards,
Ajay



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux