From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Duan, Zhenzhong" <zhenzhong.duan@intel.com>
Cc: Jason Wang <jasowang@redhat.com>,
"Liu, Yi L" <yi.l.liu@intel.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:50:35 -0400 [thread overview]
Message-ID: <20240527025023-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <SJ0PR11MB67448F0D3CE487F125D274AF92F02@SJ0PR11MB6744.namprd11.prod.outlook.com>
On Mon, May 27, 2024 at 06:44:58AM +0000, Duan, Zhenzhong wrote:
> Hi Jason,
>
> >-----Original Message-----
> >From: Duan, Zhenzhong
> >Subject: RE: [PATCH] intel_iommu: Use the latest fault reasons defined by
> >spec
> >
> >
> >
> >>-----Original Message-----
> >>From: Jason Wang <jasowang@redhat.com>
> >>Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined by
> >>spec
> >>
> >>On Fri, May 24, 2024 at 4:41 PM Duan, Zhenzhong
> >><zhenzhong.duan@intel.com> wrote:
> >>>
> >>>
> >>>
> >>> >-----Original Message-----
> >>> >From: Jason Wang <jasowang@redhat.com>
> >>> >Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons defined
> >by
> >>> >spec
> >>> >
> >>> >On Tue, May 21, 2024 at 6:25 PM Duan, Zhenzhong
> >>> ><zhenzhong.duan@intel.com> wrote:
> >>> >>
> >>> >>
> >>> >>
> >>> >> >-----Original Message-----
> >>> >> >From: Jason Wang <jasowang@redhat.com>
> >>> >> >Subject: Re: [PATCH] intel_iommu: Use the latest fault reasons
> >defined
> >>by
> >>> >> >spec
> >>> >> >
> >>> >> >On Mon, May 20, 2024 at 12:15 PM Liu, Yi L <yi.l.liu@intel.com>
> >>wrote:
> >>> >> >>
> >>> >> >> > From: Duan, Zhenzhong <zhenzhong.duan@intel.com>
> >>> >> >> > Sent: Monday, May 20, 2024 11:41 AM
> >>> >> >> >
> >>> >> >> >
> >>> >> >> >
> >>> >> >> > >-----Original Message-----
> >>> >> >> > >From: Jason Wang <jasowang@redhat.com>
> >>> >> >> > >Sent: Monday, May 20, 2024 8:44 AM
> >>> >> >> > >To: Duan, Zhenzhong <zhenzhong.duan@intel.com>
> >>> >> >> > >Cc: qemu-devel@nongnu.org; Liu, Yi L <yi.l.liu@intel.com>; Peng,
> >>> >Chao
> >>> >> >P
> >>> >> >> > ><chao.p.peng@intel.com>; Yu Zhang
> >><yu.c.zhang@linux.intel.com>;
> >>> >> >Michael
> >>> >> >> > >S. Tsirkin <mst@redhat.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
> >>> >> >> > >
> >>> >> >> > >On Fri, May 17, 2024 at 6:26 PM Zhenzhong Duan
> >>> >> >> > ><zhenzhong.duan@intel.com> wrote:
> >>> >> >> > >>
> >>> >> >> > >> From: Yu Zhang <yu.c.zhang@linux.intel.com>
> >>> >> >> > >>
> >>> >> >> > >> Currently we use only VTD_FR_PASID_TABLE_INV as fault
> >>reason.
> >>> >> >> > >> Update with more detailed fault reasons listed in VT-d spec
> >>7.2.3.
> >>> >> >> > >>
> >>> >> >> > >> Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
> >>> >> >> > >> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> >>> >> >> > >> ---
> >>> >> >> > >
> >>> >> >> > >I wonder if this could be noticed by the guest or not. If yes
> >should
> >>> >> >> > >we consider starting to add thing like version to vtd emulation
> >>code?
> >>> >> >> >
> >>> >> >> > Kernel only dumps the reason like below:
> >>> >> >> >
> >>> >> >> > DMAR: [DMA Write NO_PASID] Request device [20:00.0] fault
> >addr
> >>> >> >0x1234600000
> >>> >> >> > [fault reason 0x71] SM: Present bit in first-level paging entry is
> >>clear
> >>> >> >>
> >>> >> >> Yes, guest kernel would notice it as the fault would be injected to
> >vm.
> >>> >> >>
> >>> >> >> > Maybe bump 1.0 -> 1.1?
> >>> >> >> > My understanding version number is only informational and is
> >far
> >>> >from
> >>> >> >> > accurate to mark if a feature supported. Driver should check
> >>cap/ecap
> >>> >> >> > bits instead.
> >>> >> >>
> >>> >> >> Should the version ID here be aligned with VT-d spec?
> >>> >> >
> >>> >> >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.
>
> Yi just found version ID stored in VT-d VER_REG is not aligned with the VT-d spec version.
> For example, we see a local hw with vtd version 6.0 which is beyond VT-d spec version.
> We are asking VTD arch, will get back soon.
>
> Or will you plan qemu vVT-d having its own version policy?
>
> Thanks
> Zhenzhong
Not unless there's a good reason to do this.
> >
> >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.
> >
> >>
> >>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
>
next prev parent reply other threads:[~2024-05-27 6:51 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
2024-05-27 6:42 ` Michael S. Tsirkin
2024-05-27 6:44 ` Duan, Zhenzhong
2024-05-27 6:50 ` Michael S. Tsirkin [this message]
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=20240527025023-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 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).