From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
"Bob Eshleman" <bobbyeshleman@gmail.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 04/16] xen/riscv: add ioremap_*() variants using ioremap_attr()
Date: Fri, 16 May 2025 12:30:25 +0200 [thread overview]
Message-ID: <cd0004ac-a475-40e8-98d0-e2af16ef2c5c@gmail.com> (raw)
In-Reply-To: <0fbe380e-2011-4238-9847-a007c754af6f@suse.com>
[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]
On 5/14/25 4:32 PM, Jan Beulich wrote:
> On 06.05.2025 18:51, Oleksii Kurochko wrote:
>> @@ -583,3 +584,36 @@ void *__init arch_vmap_virt_end(void)
>> {
>> return (void *)(VMAP_VIRT_START + VMAP_VIRT_SIZE);
>> }
>> +
>> +static void *ioremap_attr(paddr_t start, size_t len, pte_attr_t attributes)
>> +{
>> + mfn_t mfn = _mfn(PFN_DOWN(start));
>> + unsigned int offs = start & (PAGE_SIZE - 1);
>> + unsigned int nr = PFN_UP(offs + len);
>> + void *ptr = __vmap(&mfn, nr, 1, 1, attributes, VMAP_DEFAULT);
>> +
>> + if ( ptr == NULL )
>> + return NULL;
>> +
>> + return ptr + offs;
>> +}
>> +
>> +void __iomem *ioremap_nocache(paddr_t start, size_t len)
>> +{
>> + return ioremap_attr(start, len, PAGE_HYPERVISOR_NOCACHE);
>> +}
> Why do you need both this and ...
>
>> +void __iomem *ioremap_cache(paddr_t start, size_t len)
>> +{
>> + return ioremap_attr(start, len, PAGE_HYPERVISOR);
>> +}
>> +
>> +void __iomem *ioremap_wc(paddr_t start, size_t len)
>> +{
>> + return ioremap_attr(start, len, PAGE_HYPERVISOR_WC);
>> +}
>> +
>> +void *ioremap(paddr_t pa, size_t len)
>> +{
>> + return ioremap_attr(pa, len, PAGE_HYPERVISOR_NOCACHE);
>> +}
> ... this? And why's the 1st parameter named differently for this last
> one? Can't they all be in sync in this regard?
Originally, I thought|ioremap_nocache()| was needed because it is used in
common code. However, I now realize that the calls to|ioremap_nocache()|
in|xen/drivers/char| are also ARM-specific. I assume all the
UART drivers currently using|ioremap_nocache|() are intended for ARM.
I'll drop|ioremap_nocache()| for RISC-V, and I think it makes sense to
create a separate patch to clean this up for ARM as well.
~ Oleksii
[-- Attachment #2: Type: text/html, Size: 2622 bytes --]
next prev parent reply other threads:[~2025-05-16 10:30 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 16:51 [PATCH v2 00/16] riscv: introduce basic UART support and interrupts for hypervisor mode Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 01/16] xen/riscv: initialize bitmap to zero in riscv_fill_hwcap_from_isa_string() Oleksii Kurochko
2025-05-13 15:44 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 02/16] xen/riscv: introduce smp_prepare_boot_cpu() Oleksii Kurochko
2025-05-13 15:48 ` Jan Beulich
2025-05-16 8:24 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 03/16] xen/riscv: introduce support of Svpbmt extension Oleksii Kurochko
2025-05-13 16:00 ` Jan Beulich
2025-05-16 9:35 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 04/16] xen/riscv: add ioremap_*() variants using ioremap_attr() Oleksii Kurochko
2025-05-14 14:32 ` Jan Beulich
2025-05-16 10:30 ` Oleksii Kurochko [this message]
2025-05-19 16:23 ` Teddy Astie
2025-05-06 16:51 ` [PATCH v2 05/16] xen/asm-generic: introduce asm-generic/irq-dt.h Oleksii Kurochko
2025-05-14 14:36 ` Jan Beulich
2025-05-14 21:17 ` Stefano Stabellini
2025-05-16 10:45 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 06/16] xen/riscv: introduce init_IRQ() Oleksii Kurochko
2025-05-14 14:49 ` Jan Beulich
2025-05-16 11:53 ` Oleksii Kurochko
2025-05-16 11:59 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 07/16] xen/riscv: introduce platform_get_irq() Oleksii Kurochko
2025-05-15 7:33 ` Jan Beulich
2025-05-16 14:04 ` Oleksii Kurochko
2025-05-18 8:23 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 08/16] xen/riscv: dt_processor_cpuid() implementation Oleksii Kurochko
2025-05-15 7:56 ` Jan Beulich
2025-05-16 16:02 ` Oleksii Kurochko
2025-05-18 8:30 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 09/16] xen/riscv: introduce register_intc_ops() and intc_hw_ops Oleksii Kurochko
2025-05-15 8:06 ` Jan Beulich
2025-05-19 9:16 ` Oleksii Kurochko
2025-05-19 13:16 ` Jan Beulich
2025-05-20 14:04 ` Oleksii Kurochko
2025-05-20 14:18 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 10/16] xen/riscv: imsic_init() implementation Oleksii Kurochko
2025-05-15 8:42 ` Jan Beulich
2025-05-19 15:19 ` Oleksii Kurochko
2025-05-19 18:32 ` Jan Beulich
2025-05-20 14:47 ` Oleksii Kurochko
2025-05-19 15:26 ` Oleksii Kurochko
2025-05-19 18:33 ` Jan Beulich
2025-05-20 14:53 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 11/16] xen/riscv: aplic_init() implementation Oleksii Kurochko
2025-05-15 9:06 ` Jan Beulich
2025-05-19 16:09 ` Oleksii Kurochko
2025-05-19 18:40 ` Jan Beulich
2025-05-06 16:51 ` [PATCH v2 12/16] xen/riscv: introduce intc_init() and helpers Oleksii Kurochko
2025-05-15 9:29 ` Jan Beulich
2025-05-20 8:42 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 13/16] xen/riscv: implementation of aplic and imsic operations Oleksii Kurochko
2025-05-15 9:44 ` Jan Beulich
2025-05-20 11:24 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 14/16] xen/riscv: add external interrupt handling for hypervisor mode Oleksii Kurochko
2025-05-15 9:54 ` Jan Beulich
2025-05-20 11:37 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 15/16] xen/riscv: implement setup_irq() Oleksii Kurochko
2025-05-15 9:57 ` Jan Beulich
2025-05-20 11:53 ` Oleksii Kurochko
2025-05-06 16:51 ` [PATCH v2 16/16] xen/riscv: add basic UART support Oleksii Kurochko
2025-05-15 9:59 ` Jan Beulich
2025-05-20 11:57 ` Oleksii Kurochko
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=cd0004ac-a475-40e8-98d0-e2af16ef2c5c@gmail.com \
--to=oleksii.kurochko@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=bobbyeshleman@gmail.com \
--cc=connojdavis@gmail.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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.