From: Stefan Hajnoczi <stefanha@redhat.com>
To: Farhan Ali <alifm@linux.ibm.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 15:26:59 -0400 [thread overview]
Message-ID: <20250327192659.GD46883@fedora> (raw)
In-Reply-To: <20250326181007.1099-3-alifm@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
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.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-03-27 19:28 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 [this message]
2025-03-27 19:49 ` Farhan Ali
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=20250327192659.GD46883@fedora \
--to=stefanha@redhat.com \
--cc=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=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).