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