From: Farhan Ali <alifm@linux.ibm.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, mjrosato@linux.ibm.com,
schnelle@linux.ibm.com, qemu-s390x@nongnu.org,
qemu-block@nongnu.org, fam@euphon.net, philmd@linaro.org,
kwolf@redhat.com, hreitz@redhat.com, thuth@redhat.com
Subject: Re: [PATCH v1 2/2] block/nvme: Enable NVMe userspace driver for s390x
Date: Thu, 27 Mar 2025 12:49:11 -0700 [thread overview]
Message-ID: <9ce01416-b0db-4bde-a608-2fc4f95fc718@linux.ibm.com> (raw)
In-Reply-To: <20250327192659.GD46883@fedora>
On 3/27/2025 12:26 PM, Stefan Hajnoczi wrote:
> On Wed, Mar 26, 2025 at 11:10:07AM -0700, Farhan Ali wrote:
>> +static inline uint32_t nvme_mmio_read_32(const void *addr)
>> +{
>> + uint32_t ret;
>> +
>> +#ifdef __s390x__
>> + ret = s390x_pci_mmio_read_32(addr);
>> +#else
>> + /* Prevent the compiler from optimizing away the load */
>> + ret = *((volatile uint32_t *)addr);
>> +#endif
> The NVMe driver should not need to worry about s390 PCI MMIO specifics.
> It would be nice to add a QEMU PCI MMIO load/store API that hides this.
>
> block/nvme.c would use the API to access MMIO registers instead of
> accessing them directly. The functions could be static inline in the
> header file to minimize overhead on platforms that can directly access
> PCI MMIO registers.
Hi Stefan,
Thanks for reviewing. I do agree, having a generic QEMU PCI MMIO
load/store API for this would be good. And we can hide architecture
specifics there. I didn't add that to begin with was NVMe driver would
be the only place to consume it so thought might be unnecessary. I will
refactor this in v2.
Thanks
Farhan
prev parent reply other threads:[~2025-03-27 19:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 18:10 [PATCH v1 0/2] Enable QEMU NVMe userspace driver on s390x Farhan Ali
2025-03-26 18:10 ` [PATCH v1 1/2] util: Add functions for s390x mmio read/write Farhan Ali
2025-03-27 19:20 ` Stefan Hajnoczi
2025-03-27 19:53 ` Farhan Ali
2025-03-26 18:10 ` [PATCH v1 2/2] block/nvme: Enable NVMe userspace driver for s390x Farhan Ali
2025-03-27 19:26 ` Stefan Hajnoczi
2025-03-27 19:49 ` Farhan Ali [this message]
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=9ce01416-b0db-4bde-a608-2fc4f95fc718@linux.ibm.com \
--to=alifm@linux.ibm.com \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=schnelle@linux.ibm.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.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).