[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200430103446.GH5097@quicinc.com>
Date: Thu, 30 Apr 2020 16:04:46 +0530
From: Srivatsa Vaddagiri <vatsa@...eaurora.org>
To: Will Deacon <will@...nel.org>
Cc: konrad.wilk@...cle.com, mst@...hat.com, jasowang@...hat.com,
jan.kiszka@...mens.com, stefano.stabellini@...inx.com,
iommu@...ts.linux-foundation.org,
virtualization@...ts.linux-foundation.org,
virtio-dev@...ts.oasis-open.org, tsoni@...eaurora.org,
pratikp@...eaurora.org, christoffer.dall@....com,
alex.bennee@...aro.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC/PATCH 1/1] virtio: Introduce MMIO ops
* Will Deacon <will@...nel.org> [2020-04-30 11:14:32]:
> > +#ifdef CONFIG_VIRTIO_MMIO_OPS
> >
> > +static struct virtio_mmio_ops *mmio_ops;
> > +
> > +#define virtio_readb(a) mmio_ops->mmio_readl((a))
> > +#define virtio_readw(a) mmio_ops->mmio_readl((a))
> > +#define virtio_readl(a) mmio_ops->mmio_readl((a))
> > +#define virtio_writeb(val, a) mmio_ops->mmio_writeb((val), (a))
> > +#define virtio_writew(val, a) mmio_ops->mmio_writew((val), (a))
> > +#define virtio_writel(val, a) mmio_ops->mmio_writel((val), (a))
>
> How exactly are these ops hooked up? I'm envisaging something like:
>
> ops = spec_compliant_ops;
> [...]
> if (firmware_says_hypervisor_is_buggy())
> ops = magic_qcom_ops;
>
> am I wrong?
If CONFIG_VIRTIO_MMIO_OPS is defined, then I expect this to be unconditionally
set to 'magic_qcom_ops' that uses hypervisor-supported interface for IO (for
example: message_queue_send() and message_queue_recevie() hypercalls).
> > +int register_virtio_mmio_ops(struct virtio_mmio_ops *ops)
> > +{
> > + pr_info("Registered %s as mmio ops\n", ops->name);
> > + mmio_ops = ops;
>
> Not looking good, and really defeats the point of standardising this stuff
> imo.
Ok. I guess the other option is to standardize on a new virtio transport (like
ivshmem2-virtio)?
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Powered by blists - more mailing lists