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.
signature.asc
Description: PGP signature