Skip to contentSkip to conversation

IOMMU/x86: make page type checks consistent when mapping pages

PATCH Juergen Gross 1 participant 1 message Mar 5, 2019

lore
Share & tools
lore
#0 lore raw
Quoted 29 lines · Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 05.03.19 at 14:50, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich

There are currently three more or less different checks:
- _get_page_type() adjusts the IOMMU mappings according to the new type alone,
- arch_iommu_populate_page_table() wants just the type to be PGT_writable_page,
- iommu_hwdom_init() additionally permits all other types with a type refcount of zero.
The canonical one is in _get_page_type(), and as of XSA-288 arch_iommu_populate_page_table() also has no need anymore to deal with PGT_none pages. In the PV Dom0 case, however, PGT_none pages are still necessary to consider, since in that case pages don't get handed to guest_physmap_add_entry(). Furthermore, the function so far also established r/o mappings, which is not in line with the rules set forth by the XSA-288 change.

For arch_iommu_populate_page_table() to not encounter PGT_none pages anymore even in cases where the IOMMU gets enabled for a domain only when it is already running, replace the IOMMU dependency in guest_physmap_add_entry()'s handling of PV guests to check just the system wide state instead of the domain property.

Quoted 5 lines
Quoted 1 line

I'm unable to decide whether this patch should make it into 4.12 or not with the given information. What happens without this patch (worst case)?

Quoted 5 lines

I don't think anything really bad can happen, or else this would have been part of one of the XSAs. The patch is bringing things in line with what XSA-288 did, without it being obvious what bad could result from not doing so. The larger part of change here is for hwdom only anyway.

Okay, thanks. I think this patch should be deferred then.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel