diff mbox series

[V4,1/4] intel-iommu: don't warn guest errors when getting rid2pasid entry

Message ID 20221027075042.16894-2-jasowang@redhat.com (mailing list archive)
State New, archived
Headers show
Series PASID support for Intel IOMMU | expand

Commit Message

Jason Wang Oct. 27, 2022, 7:50 a.m. UTC
We use to warn on wrong rid2pasid entry. But this error could be
triggered by the guest and could happens during initialization. So
let's don't warn in this case.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/i386/intel_iommu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Yi Liu Oct. 27, 2022, 1:20 p.m. UTC | #1
On 2022/10/27 15:50, Jason Wang wrote:
> We use to warn on wrong rid2pasid entry. But this error could be
> triggered by the guest and could happens during initialization. So
> let's don't warn in this case.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>   hw/i386/intel_iommu.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index 6524c2ee32..796f924c06 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -1554,8 +1554,10 @@ static bool vtd_dev_pt_enabled(IntelIOMMUState *s, VTDContextEntry *ce)
>       if (s->root_scalable) {
>           ret = vtd_ce_get_rid2pasid_entry(s, ce, &pe);
>           if (ret) {

ret is no more used in this branch. It may be changed to below. right?

         if (vtd_ce_get_rid2pasid_entry(s, ce, &pe)) {
             ...
         }

> -            error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
> -                              __func__, ret);
> +            /*
> +             * This error is guest triggerable. We should assumt PT

s/triggerable/trigger-able
s/assumt/assume

> +             * not enabled for safety.
> +             */
>               return false;
>           }
>           return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
Jason Wang Oct. 28, 2022, 2:03 a.m. UTC | #2
On Thu, Oct 27, 2022 at 9:20 PM Yi Liu <yi.l.liu@intel.com> wrote:
>
> On 2022/10/27 15:50, Jason Wang wrote:
> > We use to warn on wrong rid2pasid entry. But this error could be
> > triggered by the guest and could happens during initialization. So
> > let's don't warn in this case.
> >
> > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > ---
> >   hw/i386/intel_iommu.c | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> > index 6524c2ee32..796f924c06 100644
> > --- a/hw/i386/intel_iommu.c
> > +++ b/hw/i386/intel_iommu.c
> > @@ -1554,8 +1554,10 @@ static bool vtd_dev_pt_enabled(IntelIOMMUState *s, VTDContextEntry *ce)
> >       if (s->root_scalable) {
> >           ret = vtd_ce_get_rid2pasid_entry(s, ce, &pe);
> >           if (ret) {
>
> ret is no more used in this branch. It may be changed to below. right?

Right.

>
>          if (vtd_ce_get_rid2pasid_entry(s, ce, &pe)) {
>              ...
>          }
>
> > -            error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
> > -                              __func__, ret);
> > +            /*
> > +             * This error is guest triggerable. We should assumt PT
>
> s/triggerable/trigger-able
> s/assumt/assume

Fixed.

Thanks

>
> > +             * not enabled for safety.
> > +             */
> >               return false;
> >           }
> >           return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);
>
> --
> Regards,
> Yi Liu
>
diff mbox series

Patch

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 6524c2ee32..796f924c06 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1554,8 +1554,10 @@  static bool vtd_dev_pt_enabled(IntelIOMMUState *s, VTDContextEntry *ce)
     if (s->root_scalable) {
         ret = vtd_ce_get_rid2pasid_entry(s, ce, &pe);
         if (ret) {
-            error_report_once("%s: vtd_ce_get_rid2pasid_entry error: %"PRId32,
-                              __func__, ret);
+            /*
+             * This error is guest triggerable. We should assumt PT
+             * not enabled for safety.
+             */
             return false;
         }
         return (VTD_PE_GET_TYPE(&pe) == VTD_SM_PASID_ENTRY_PT);