qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v1 09/18] intel_iommu: process pasid cache invalid


From: Peter Xu
Subject: Re: [Qemu-devel] [RFC v1 09/18] intel_iommu: process pasid cache invalidation
Date: Tue, 9 Jul 2019 12:47:37 +0800
User-agent: Mutt/1.11.4 (2019-03-13)

On Fri, Jul 05, 2019 at 07:01:42PM +0800, Liu Yi L wrote:
> +static bool vtd_process_pasid_desc(IntelIOMMUState *s,
> +                                   VTDInvDesc *inv_desc)
> +{
> +    if ((inv_desc->val[0] & VTD_INV_DESC_PASIDC_RSVD_VAL0) ||
> +        (inv_desc->val[1] & VTD_INV_DESC_PASIDC_RSVD_VAL1) ||
> +        (inv_desc->val[2] & VTD_INV_DESC_PASIDC_RSVD_VAL2) ||
> +        (inv_desc->val[3] & VTD_INV_DESC_PASIDC_RSVD_VAL3)) {
> +        trace_vtd_inv_desc("non-zero-field-in-pc_inv_desc",
> +                            inv_desc->val[1], inv_desc->val[0]);

The first parameter of trace_vtd_inv_desc() should be the type.

Can use error_report_once() here.

> +        return false;
> +    }
> +
> +    switch (inv_desc->val[0] & VTD_INV_DESC_PASIDC_G) {
> +    case VTD_INV_DESC_PASIDC_DSI:
> +        break;
> +
> +    case VTD_INV_DESC_PASIDC_PASID_SI:
> +        break;
> +
> +    case VTD_INV_DESC_PASIDC_GLOBAL:
> +        break;
> +
> +    default:
> +        trace_vtd_inv_desc("invalid-inv-granu-in-pc_inv_desc",
> +                            inv_desc->val[1], inv_desc->val[0]);

Here too.

> +        return false;
> +    }
> +
> +    return true;
> +}

Regards,

-- 
Peter Xu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]