From: Si-Wei Liu <si-wei.liu@oracle.com>
To: Jason Wang <jasowang@redhat.com>
Cc: xuanzhuo@linux.alibaba.com, mst@redhat.com,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
Eugenio Perez Martin <eperezma@redhat.com>
Subject: Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release
Date: Wed, 18 Oct 2023 01:49:27 -0700 [thread overview]
Message-ID: <d2b52f01-3d00-46ad-b58e-e23fd8a49e87@oracle.com> (raw)
In-Reply-To: <CACGkMEtZ_oEydqsvJh0-eaDh4q_KHq9fLPg1uy-W1m7K_g+1-w@mail.gmail.com>
On 10/18/2023 12:00 AM, Jason Wang wrote:
>> Unfortunately, it's a must to stick to ABI. I agree it's a mess but we
>> don't have a better choice. Or we can fail the probe if userspace
>> doesn't ack this feature.
> Antoher idea we can just do the following in vhost_vdpa reset?
>
> config->reset()
> if (IOTLB_PERSIST is not set) {
> config->reset_map()
> }
>
> Then we don't have the burden to maintain them in the parent?
>
> Thanks
Please see my earlier response in the other email, thanks.
----------------%<----------------%<----------------
First, the ideal fix would be to leave this reset_vendor_mappings()
emulation code on the individual driver itself, which already has the
broken behavior. But today there's no backend feature negotiation
between vhost-vdpa and the parent driver. Do we want to send down the
acked_backend_features to parent drivers?
Second, IOTLB_PERSIST is needed but not sufficient. Due to lack of
backend feature negotiation in parent driver, if vhost-vdpa has to
provide the old-behaviour emulation for compatibility on driver's
behalf, it needs to be done per-driver basis. There could be good
on-chip or vendor IOMMU implementation which doesn't clear the IOTLB in
.reset, and vendor specific IOMMU doesn't have to provide .reset_map, we
should allow these good driver implementations rather than
unconditionally stick to some specific problematic behavior for every
other good driver. Then we need a set of device flags (backend_features
bit again?) to indicate the specific driver needs upper layer's help on
old-behaviour emulation.
Last but not least, I'm not sure how to properly emulate
reset_vendor_mappings() from vhost-vdpa layer. If a vendor driver has no
.reset_map op implemented, or if .reset_map has a slightly different
implementation than what it used to reset the iotlb in the .reset op,
then this either becomes effectively dead code if no one ends up using,
or the vhost-vdpa emulation is helpless and limited in scope, unable to
cover all the cases.
----------------%<----------------%<----------------
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-10-18 8:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 9:02 [PATCH 0/4] vdpa: decouple reset of iotlb mapping from device reset Si-Wei Liu
2023-10-10 9:02 ` [PATCH 1/4] vdpa: introduce .reset_map operation callback Si-Wei Liu
2023-10-13 2:49 ` Jason Wang
2023-10-13 7:36 ` Si-Wei Liu
2023-10-16 5:30 ` Jason Wang
2023-10-10 9:02 ` [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release Si-Wei Liu
[not found] ` <CAJaqyWe=RwotkcNKFuStvX=HxQh6sdtfsH23jhf994eXi3-2Og@mail.gmail.com>
2023-10-12 6:18 ` Si-Wei Liu
2023-10-13 3:01 ` Jason Wang
2023-10-13 7:35 ` Si-Wei Liu
2023-10-16 6:32 ` Jason Wang
2023-10-16 20:10 ` Si-Wei Liu
[not found] ` <CAJaqyWf0AhsS6kaGUMVCosDjuRoeCAqO3OTVC=veqjV3jCqUjQ@mail.gmail.com>
2023-10-16 20:30 ` Si-Wei Liu
2023-10-17 2:35 ` Jason Wang
2023-10-18 4:35 ` Si-Wei Liu
2023-10-18 5:27 ` Jason Wang
2023-10-18 7:00 ` Jason Wang
2023-10-18 8:49 ` Si-Wei Liu [this message]
2023-10-19 2:53 ` Jason Wang
2023-10-19 6:46 ` Si-Wei Liu
2023-10-19 8:27 ` Jason Wang
[not found] ` <CAJaqyWdMPVUd_zjd0nkQKvDmG2HPe5DBS-w5=mx4qSPCqtDJwg@mail.gmail.com>
2023-10-19 22:28 ` Si-Wei Liu
2023-10-20 4:11 ` Jason Wang
2023-10-20 5:57 ` Si-Wei Liu
2023-10-18 8:44 ` Si-Wei Liu
[not found] ` <CAJaqyWc01_YgkhLRs961a-K1P+Zj4P+6qGN1t=eOFFwGvQ001A@mail.gmail.com>
2023-10-18 23:21 ` Si-Wei Liu
2023-10-19 2:48 ` Jason Wang
2023-10-19 22:57 ` Si-Wei Liu
2023-10-10 9:02 ` [PATCH 3/4] vhost-vdpa: introduce IOTLB_PERSIST backend feature bit Si-Wei Liu
2023-10-10 9:03 ` [PATCH 4/4] vdpa/mlx5: implement .reset_map driver op Si-Wei Liu
2023-10-13 3:04 ` Jason Wang
2023-10-13 7:55 ` Si-Wei Liu
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=d2b52f01-3d00-46ad-b58e-e23fd8a49e87@oracle.com \
--to=si-wei.liu@oracle.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xuanzhuo@linux.alibaba.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).