From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Baoquan He <bhe@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, christophe.leroy@csgroup.eu,
hch@infradead.org, agordeev@linux.ibm.com,
wangkefeng.wang@huawei.com, David.Laight@aculab.com,
shorne@gmail.com, arnd@arndb.de,
Gerald Schaefer <gerald.schaefer@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH v4 09/16] s390: mm: Convert to GENERIC_IOREMAP
Date: Tue, 21 Feb 2023 13:26:11 +0100 [thread overview]
Message-ID: <a0502208452b40b17572d18891ffee94e42484fa.camel@linux.ibm.com> (raw)
In-Reply-To: <Y/SvqcWQ+5sgozX/@MiWiFi-R3L-srv>
On Tue, 2023-02-21 at 19:48 +0800, Baoquan He wrote:
> On 02/16/23 at 05:21pm, Niklas Schnelle wrote:
> > On Thu, 2023-02-16 at 20:34 +0800, Baoquan He wrote:
> > > By taking GENERIC_IOREMAP method, the generic generic_ioremap_prot(),
> > > generic_iounmap(), and their generic wrapper ioremap_prot(), ioremap()
> > > and iounmap() are all visible and available to arch. Arch needs to
> > > provide wrapper functions to override the generic versions if there's
> > > arch specific handling in its ioremap_prot(), ioremap() or iounmap().
> > > This change will simplify implementation by removing duplicated codes
> > > with generic_ioremap_prot() and generic_iounmap(), and has the equivalent
> > > functioality as before.
> > >
> > > Here, add wrapper functions ioremap_prot() and iounmap() for s390's
> > > special operation when ioremap() and iounmap().
> > >
> > > Signed-off-by: Baoquan He <bhe@redhat.com>
> > > Cc: Niklas Schnelle <schnelle@linux.ibm.com>
> > > Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
> > > Cc: Heiko Carstens <hca@linux.ibm.com>
> > > Cc: Vasily Gorbik <gor@linux.ibm.com>
> > > Cc: Alexander Gordeev <agordeev@linux.ibm.com>
> > > Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
> > > Cc: Sven Schnelle <svens@linux.ibm.com>
> > > Cc: linux-s390@vger.kernel.org
> > > ---
> > > arch/s390/Kconfig | 1 +
> > > arch/s390/include/asm/io.h | 21 ++++++++------
> > > arch/s390/pci/pci.c | 57 +++++++-------------------------------
> > > 3 files changed, 23 insertions(+), 56 deletions(-)
> >
> > Thanks for the patch. This is a very clear improvement for us! I tested
> > this series with s390 systems with and without the PCI memory-I/O (MIO)
> > support and everything works as expected.
> >
> > One thing I did stumble upon but which is independent from this patch
> > is that I think memremap(…, MEMREMAP_WB) on system RAM outside the
> > direct map is broken for us. At least on systems without PCI memory-I/O
> > support. I think with this series it would be much easier to fix
> > though. Basically I think we would have to define arch_memremap_wb() to
> > generic_ioremap_prot(…, PAGE_KERNEL) and then have iounmap() check
> > is_ioremap_addr() to see if it is an actual mapping or an address
> > cookie. But again this is independent of this patch which doesn't
> > change the behavior in this area.
>
> OK, I can check this after this patchset done.
Oh this wasn't meant as adding a task for you just a FYI. I'm already
experimenting with this and plan to possibly send a patch that fixes
the case of remapping system RAM once your series has landed. The thing
is that memremap() is quite tricky for us whichever way you look at
it.
We don't have real MMIO on s390x and thus using memremap() for PCI MMIO
spaces doesn't really work as the void* returned can still only be
accessed using ioread()/iowrite() because only our special PCI access
instructions work on the pseudo-MMIO addresses (with PCI MIO)
respectively the address cookies. Obviously void* and memremap() really
isn't the right tool if you need to use ioread()/iowrite() to access it
and can't treat it as memory though.
Thanks,
Niklas
next prev parent reply other threads:[~2023-02-21 12:26 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 12:34 [PATCH v4 00/16] mm: ioremap: Convert architectures to take GENERIC_IOREMAP way Baoquan He
2023-02-16 12:34 ` [PATCH v4 01/16] hexagon: mm: Convert to GENERIC_IOREMAP Baoquan He
2023-02-16 12:53 ` Arnd Bergmann
2023-02-16 14:47 ` Baoquan He
2023-02-16 14:51 ` Arnd Bergmann
2023-02-17 12:11 ` Baoquan He
2023-02-16 12:34 ` [PATCH v4 02/16] openrisc: mm: remove unneeded early ioremap code Baoquan He
2023-02-16 12:34 ` [PATCH v4 03/16] mm/ioremap: Define generic_ioremap_prot() and generic_iounmap() Baoquan He
2023-02-16 12:34 ` [PATCH v4 04/16] mm: ioremap: allow ARCH to have its own ioremap method definition Baoquan He
2023-02-16 12:41 ` Arnd Bergmann
2023-02-16 12:34 ` [PATCH v4 05/16] mm/ioremap: add slab availability checking in ioremap_prot Baoquan He
2023-02-16 12:34 ` [PATCH v4 06/16] arc: mm: Convert to GENERIC_IOREMAP Baoquan He
2023-02-16 12:34 ` [PATCH v4 07/16] ia64: " Baoquan He
2023-02-16 12:34 ` [PATCH v4 08/16] openrisc: " Baoquan He
2023-02-16 12:34 ` [PATCH v4 09/16] s390: " Baoquan He
2023-02-16 16:21 ` Niklas Schnelle
2023-02-21 11:48 ` Baoquan He
2023-02-21 12:26 ` Niklas Schnelle [this message]
2023-02-21 12:52 ` Baoquan He
2023-02-16 12:34 ` [PATCH v4 10/16] sh: " Baoquan He
2023-02-16 12:34 ` [PATCH v4 11/16] xtensa: " Baoquan He
2023-02-16 12:34 ` [PATCH v4 12/16] parisc: " Baoquan He
2023-02-16 13:50 ` Matthew Wilcox
2023-02-16 15:02 ` Baoquan He
2023-02-16 15:18 ` Arnd Bergmann
2023-02-17 13:31 ` Baoquan He
2023-02-17 13:46 ` Christophe Leroy
2023-02-17 14:21 ` Baoquan He
2023-02-17 14:33 ` Christophe Leroy
2023-02-17 14:35 ` Christophe Leroy
2023-02-21 11:43 ` Baoquan He
2023-02-22 8:35 ` Baoquan He
2023-02-16 12:34 ` [PATCH v4 13/16] mm/ioremap: Consider IOREMAP space in generic ioremap Baoquan He
2023-02-16 12:34 ` [PATCH v4 14/16] powerpc: mm: Convert to GENERIC_IOREMAP Baoquan He
2023-02-16 12:34 ` [PATCH v4 15/16] arm64 : mm: add wrapper function ioremap_prot() Baoquan He
2023-02-16 12:34 ` [PATCH v4 16/16] mm: ioremap: remove unneeded ioremap_allowed and iounmap_allowed Baoquan He
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=a0502208452b40b17572d18891ffee94e42484fa.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=David.Laight@aculab.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=bhe@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=gerald.schaefer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=shorne@gmail.com \
--cc=svens@linux.ibm.com \
--cc=wangkefeng.wang@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).