mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
intel_iommu: Make pasid entry type check accurate
When guest configures Nested Translation(011b) or First-stage Translation only
(001b), type check passed unaccurately.
Fails the type check in those cases as their simulation isn't supported yet.
Fixes: fb43cf739e
("intel_iommu: scalable mode emulation")
Suggested-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Clément Mathieu--Drif<clement.mathieu--drif@eviden.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20241212083757.605022-3-zhenzhong.duan@intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
a84e37af36
commit
b291dae33d
1 changed files with 4 additions and 8 deletions
|
@ -759,20 +759,16 @@ static inline bool vtd_pe_type_check(X86IOMMUState *x86_iommu,
|
|||
VTDPASIDEntry *pe)
|
||||
{
|
||||
switch (VTD_PE_GET_TYPE(pe)) {
|
||||
case VTD_SM_PASID_ENTRY_FLT:
|
||||
case VTD_SM_PASID_ENTRY_SLT:
|
||||
case VTD_SM_PASID_ENTRY_NESTED:
|
||||
break;
|
||||
return true;
|
||||
case VTD_SM_PASID_ENTRY_PT:
|
||||
if (!x86_iommu->pt_supported) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
return x86_iommu->pt_supported;
|
||||
case VTD_SM_PASID_ENTRY_FLT:
|
||||
case VTD_SM_PASID_ENTRY_NESTED:
|
||||
default:
|
||||
/* Unknown type */
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool vtd_pdire_present(VTDPASIDDirEntry *pdire)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue