linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org
Subject: Re: vm_area at addr ffffffffc0800000 is not marked as VM_IOREMAP
Date: Fri, 8 Mar 2024 09:02:11 -0800	[thread overview]
Message-ID: <ZetEkyW1QgIKwfFz@infradead.org> (raw)
In-Reply-To: <CAADnVQKQumV-0AxGLKX0jQEfa8Z2Bxx2yW8k_1OqGBnD-RqrbA@mail.gmail.com>

On Fri, Mar 08, 2024 at 08:33:18AM -0800, Alexei Starovoitov wrote:
> vmap_range_noflush() is static in mm/vmalloc.c
> There is vmap_pages_range_noflush() that is in mm/internal.h,
> but it needs pages instead of phys_addr_t.
> Newly introduced vm_area_map_pages() needs struct vm_struct *area
> and struct page **pages.
> In this PCI case there is no vm_struct and no pages.
> ioremap_page_range() is the only api that fits. afaict.

Except that we want to enforce a vm_area with the ioremap flag for
ioremap_page_range, and just adding a NULL check defeats that.

The right long term thing would be to actually create a vm_area
for the PCI_IOBASE region, but until then we just need a lower level
API.  That's why I suggest to add a vmap_range() that is basically
the ioremap_page_range before you added the checks, and make
ioremap_page_range a wrapper around that that checks the area.

If/when we get PCI_IOBASE handling converted to the proper
vmalloc/ioremap areas we can remove that again as well as
vunmap_range which is just used for PCI_IOBASE and other equivalent
ISA_IO_BASE in powerpc and somewhat unusual case in arm64 that I
need to look into a bit more.


  reply	other threads:[~2024-03-08 17:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANiq72ka4rir+RTN2FQoT=Vvprp_Ao-CvoYEkSNqtSY+RZj+AA@mail.gmail.com>
2024-03-07 17:54 ` Alexei Starovoitov
2024-03-08  3:49   ` Alexei Starovoitov
2024-03-08 10:48     ` Manivannan Sadhasivam
2024-03-08 11:23     ` Miguel Ojeda
2024-03-08 15:04     ` Christoph Hellwig
2024-03-08 16:33       ` Alexei Starovoitov
2024-03-08 17:02         ` Christoph Hellwig [this message]
2024-03-08 17:20           ` Alexei Starovoitov
2024-03-08 17:24             ` Christoph Hellwig
2024-03-08 17:53               ` Alexei Starovoitov
2024-03-08 22:44                 ` Alexei Starovoitov
2024-03-09  1:37                   ` Alexei Starovoitov
2024-03-09 15:29                     ` Christoph Hellwig
2024-03-09 16:33                       ` Alexei Starovoitov
2024-03-09 16:36                         ` Christoph Hellwig
2024-03-09 16:38                           ` Alexei Starovoitov
2024-03-11 11:46                             ` Miguel Ojeda
2024-03-08 16:13     ` Bjorn Helgaas
2024-03-08 16:37       ` Alexei Starovoitov

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=ZetEkyW1QgIKwfFz@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bpf@vger.kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=daniel@iogearbox.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox