All of lore.kernel.org
 help / color / mirror / Atom feed
From: konrad wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Jan Beulich <JBeulich-IBi9RG/b67k@public.gmane.org>
Cc: Lukas Hejtmanek
	<xhejtman-8qz54MUs51PtwjQa/ONI9g@public.gmane.org>,
	roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [Xen-devel] BUG: bad page map under Xen
Date: Mon, 21 Oct 2013 09:39:33 -0400	[thread overview]
Message-ID: <52652E95.3020305@oracle.com> (raw)
In-Reply-To: <526545E002000078000FC5F1-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>


On 10/21/2013 9:18 AM, Jan Beulich wrote:
>>>> On 21.10.13 at 14:59, konrad wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
>> It is a bug in the drivers I believe. The issue is that the mapping
>> created for the second mmap
>> call is done without VM_IO and on an PFN that is RAM (and not the BAR).
> So while putting together the reply that I had sent to Lukas a
> minute ago I was actually hunting for that VM_IO -> _PAGE_IOMAP
> translation, and wasn't able to find it anywhere. As you say it
> nevertheless exists - what am I overlooking (and why would then
> pci_mmap_page_range() nevertheless have to set _PAGE_IOMAP
> by hand)?

The P2M (arch/x86/xen/p2m.c) is consulted which for the MMIO gaps and
E820_RESV has the MFNs set to the PFN. This is the 1-1 pfn/mfn stuff 
that I implemented
some time ago - as hpa was opposed to having the _PAGE_IOMAP being stuck 
on any macro
call to pgprot_writecombine|noncached|etc. Or perhaps that was on the 
arch_something_prot.

Anyhow, the odd thing is that looking at the code:

  669                 if (io_remap_pfn_range(vma, vma->vm_start,
  670 to_mucontext(context)->uar.pfn +
  671 dev->dev->caps.num_uars,
  672                                        PAGE_SIZE, vma->vm_page_prot))

The PFN in question (uar.pfn) is in mlx4_uar_alloc is set to:

159         uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) 
+ offset;

So is the BAR not in the MMIO region? Or is it the 64-bit type MMIO that 
lays outside the 4GB and
hence when the P2M is consulted it thinks its INVALID_P2M_ENTRY?

Which comes back to the bug you (Jan) discovered when you pointed out 
that PVH needs to setup MMIO entries
for 64-bit MMIO regions which can be outside the 4GB region <sigh>. And 
that is something the pvops kernel
completly ignores as it assumes that any region past the E820 can be 
used for ballooning.

Anyhow, one easy thing to figure out is to get the lspci -v output from 
the InfiniBand card
to see where its BARs are, and also the start of the kernel. You should 
see an E820 map (please also boot with
"debug" on the Linux command line).

> Jan
>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-10-21 13:39 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 11:57 BUG: bad page map under Xen Lukas Hejtmanek
     [not found] ` <20131021115740.GN20913-8qz54MUs51PtwjQa/ONI9g@public.gmane.org>
2013-10-21 12:59   ` [Xen-devel] " konrad wilk
2013-10-21 13:18     ` Jan Beulich
     [not found]     ` <52652534.2040303-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-10-21 13:18       ` [Xen-devel] " Jan Beulich
     [not found]         ` <526545E002000078000FC5F1-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-10-21 13:39           ` konrad wilk [this message]
2013-10-21 13:57             ` konrad wilk
2013-10-21 14:06             ` Lukas Hejtmanek
     [not found]             ` <52652E95.3020305-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-10-21 13:57               ` [Xen-devel] " konrad wilk
2013-10-21 14:06               ` Lukas Hejtmanek
2013-10-21 14:18                 ` Konrad Rzeszutek Wilk
2013-10-21 14:23                   ` Lukas Hejtmanek
     [not found]                   ` <20131021141855.GA4211-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-10-21 14:23                     ` [Xen-devel] " Lukas Hejtmanek
2013-10-21 14:27                     ` Jan Beulich
     [not found]                       ` <5265560602000078000FC73E-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-10-21 14:44                         ` Konrad Rzeszutek Wilk
     [not found]                           ` <20131021144407.GC4560-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-10-21 15:12                             ` Jan Beulich
     [not found]                               ` <5265609802000078000FC7B7-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-10-23 15:36                                 ` Konrad Rzeszutek Wilk
2013-10-23 15:45                                   ` Jan Beulich
     [not found]                                   ` <20131023153645.GA28011-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-10-23 15:45                                     ` [Xen-devel] " Jan Beulich
2013-10-23 16:04                                       ` Konrad Rzeszutek Wilk
     [not found]                                       ` <5267FD3102000078000A56A1-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-10-23 16:04                                         ` [Xen-devel] " Konrad Rzeszutek Wilk
     [not found]                                           ` <20131023160433.GA28260-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-10-23 16:35                                             ` Jan Beulich
2013-10-23 16:35                                           ` Jan Beulich
2013-10-24 23:08                                     ` [Xen-devel] " David Vrabel
     [not found]                                       ` <5269A865.2010100-5LkwijKnu/2sTnJN9+BGXg@public.gmane.org>
2013-10-25 14:21                                         ` Konrad Rzeszutek Wilk
2013-12-26  6:39                                           ` Zhang, Yang Z
     [not found]                                           ` <20131025142147.GB3742-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2013-12-26  6:39                                             ` [Xen-devel] " Zhang, Yang Z
     [not found]                                               ` <A9667DDFB95DB7438FA9D7D576C3D87E0A99CE00-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-01-02 14:18                                                 ` David Vrabel
2014-01-02 14:18                                               ` David Vrabel
2013-10-25 14:21                                       ` Konrad Rzeszutek Wilk
2013-10-24 23:08                                   ` David Vrabel
2013-10-23 15:36                               ` Konrad Rzeszutek Wilk
2013-10-21 15:12                           ` Jan Beulich
2013-10-21 14:44                       ` Konrad Rzeszutek Wilk
2013-10-21 14:27                   ` Jan Beulich
     [not found]                 ` <20131021140607.GQ20913-8qz54MUs51PtwjQa/ONI9g@public.gmane.org>
2013-10-21 14:20                   ` [Xen-devel] " Jan Beulich
2013-10-21 14:20                 ` Jan Beulich
2013-10-21 13:39         ` konrad wilk
2013-10-21 13:14   ` [Xen-devel] " Jan Beulich
2013-10-21 12:59 ` konrad wilk
2013-10-21 13:14 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52652E95.3020305@oracle.com \
    --to=konrad.wilk-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=JBeulich-IBi9RG/b67k@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=xen-devel-GuqFBffKawuEi8DpZVb4nw@public.gmane.org \
    --cc=xhejtman-8qz54MUs51PtwjQa/ONI9g@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.