From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: "Duan, Zhenzhong" <zhenzhong.duan@intel.com>,
Jason Wang <jasowang@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"Peng, Chao P" <chao.p.peng@intel.com>,
Yu Zhang <yu.c.zhang@linux.intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Eduardo Habkost <eduardo@habkost.net>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by spec
Date: Mon, 27 May 2024 02:49:49 -0400 [thread overview]
Message-ID: <20240527024327-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <10696888-9d9c-4a09-854d-a923246035a2@intel.com>
On Mon, May 27, 2024 at 02:32:46PM +0800, Yi Liu wrote:
> Folks, looks like it's not necessary to be aligned with spec version.
> e.g. I can see something like below. This is an old machine which is
> not possible to be built according to vt-d spec 4.0. Let me check more
> machines as well to confirm this.
Aligning to a spec version is preferable. We don't *have* to force
users to do it if we don't want to, but you never know what
assumptions will guests make.
>Perhaps virtual VT-d implementation
> can have its own version policy? @Jason, how about your idea?
>
> cat /sys/class/iommu/dmar0/intel-iommu/version
> 4:0
This is PV, really best avoided if we can.
> > > > > > > Probably, this might be something that could be noticed by the
> > > > > > > management to migration compatibility.
> > > > > >
> > > > > > Could you elaborate what we need to do for migration compatibility?
> > > > > > I see version is already exported so libvirt can query it, see:
> > > > > >
> > > > > > DEFINE_PROP_UINT32("version", IntelIOMMUState, version, 0),
> > > > >
> > > > > It is the Qemu command line parameters not the version of the vmstate.
> > > > >
> > > > > For example -device intel-iommu,version=3.0
> > > > >
> > > > > Qemu then knows it should behave as 3.0.
> > > >
> > > > So you want to bump vtd_vmstate.version?
> > >
> > > Well, as I said, it's not a direct bumping.
> > >
> > > >
> > > > In fact, this series change intel_iommu property from x-scalable-
> > > mode=["on"|"off"]"
> > > > to x-scalable-mode=["legacy"|"modern"|"off"]".
> > > >
> > > > My understanding management app should use same qemu cmdline
> > > > in source and destination, so compatibility is already guaranteed even if
> > > > we don't bump vtd_vmstate.version.
> > >
> > > Exactly, so the point is to
> > >
> > > vtd=3.0, the device works exactly as vtd spec 3.0.
> > > vtd=3.3, the device works exactly as vtd spec 3.3.
> >
> > Get your point. But I have some concerns about this:
> > 1.Exact version matching will bring vast of version check in the code,
> > especially when we support more versions.
> > 2. There are some missed features before we can update version number to 3.0,
> > i.e., nested translation, Accessed/Dirty (A/D) bits, 5 level page table, etc.
> > 3. Some features are removed in future versions, but we still need to
> > implement them for intermediate version,
> > i.e., ExecuteRequested (ER), Advanced Fault Logging, etc.
>
> Even the hw follows vtd spec 3.0, it is not required to implement all of
> them. So it should be fine to implement part of the capabilities. :)
Yes, that's better.
Specifying version # explicitly is really annoying for both
qemu and management.
I think normally we should just start with capabilities and make
the best decision we can wrt guest support etc.
Being concervative is usually a good idea, if a new version gives no
useful functionality adding that is just churn.
So i.e. we have a set of capabilities we want and select the earliest version
that supports them.
We can let user override that and I am not sure we need to bother
actually checking it's consistent with capabilities if we do
not want to.
> > >
> > > When migration to the old qemu, mgmt can specify e.g vtd=3.0 for
> > > backward migration compatibility.
> >
> > Yes, that makes sense for such migration.
> > But I'm not sure if there is a real scenario migrating to old qemu,
> > why not just update qemu on destination?
> >
> > Thanks
> > Zhenzhong
> >
>
> --
> Regards,
> Yi Liu
next prev parent reply other threads:[~2024-05-27 6:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 10:23 [PATCH] intel_iommu: Use the latest fault reasons defined by spec Zhenzhong Duan
2024-05-17 13:13 ` CLEMENT MATHIEU--DRIF
2024-05-19 5:08 ` Liu, Yi L
2024-05-19 8:21 ` CLEMENT MATHIEU--DRIF
2024-05-20 3:11 ` Duan, Zhenzhong
2024-05-20 0:43 ` Jason Wang
2024-05-20 3:41 ` Duan, Zhenzhong
2024-05-20 4:15 ` Liu, Yi L
2024-05-20 7:55 ` Duan, Zhenzhong
2024-05-21 2:48 ` Jason Wang
2024-05-21 10:25 ` Duan, Zhenzhong
2024-05-22 8:12 ` Jason Wang
2024-05-24 8:40 ` Duan, Zhenzhong
2024-05-27 3:21 ` Jason Wang
2024-05-27 6:04 ` Duan, Zhenzhong
2024-05-27 6:32 ` Yi Liu
2024-05-27 6:49 ` Michael S. Tsirkin [this message]
2024-05-27 6:42 ` Michael S. Tsirkin
2024-05-27 6:44 ` Duan, Zhenzhong
2024-05-27 6:50 ` Michael S. Tsirkin
2024-05-28 3:03 ` Jason Wang
2024-07-02 8:42 ` Yi Liu
2024-07-17 3:30 ` Duan, Zhenzhong
2024-07-17 3:53 ` Jason Wang
2024-07-17 6:04 ` Michael S. Tsirkin
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=20240527024327-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=chao.p.peng@intel.com \
--cc=eduardo@habkost.net \
--cc=jasowang@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=yi.l.liu@intel.com \
--cc=yu.c.zhang@linux.intel.com \
--cc=zhenzhong.duan@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.