From: Igor Druzhinin Date: Thu, 6 Jun 2019 12:07:06 +0000 (+0200) Subject: x86/mtrr: recalculate P2M type for domains with iocaps X-Git-Tag: archive/raspbian/4.11.3+24-g14b62ab3e5-1+rpi1~1^2~55^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ec821f1242d2e6eef25e81fc49ebd8fbe9118a92;p=xen.git x86/mtrr: recalculate P2M type for domains with iocaps This change reflects the logic in epte_get_entry_emt() and allows changes in guest MTTRs to be reflected in EPT for domains having direct access to certain hardware memory regions but without IOMMU context assigned (e.g. XenGT). Signed-off-by: Igor Druzhinin Reviewed-by: Jan Beulich master commit: f3d880bf2be92534c5bacf11de2f561cbad550fb master date: 2019-05-13 09:54:45 +0200 --- diff --git a/xen/arch/x86/hvm/mtrr.c b/xen/arch/x86/hvm/mtrr.c index a61cc1e6dc..fa9e27b3b7 100644 --- a/xen/arch/x86/hvm/mtrr.c +++ b/xen/arch/x86/hvm/mtrr.c @@ -755,7 +755,7 @@ HVM_REGISTER_SAVE_RESTORE(MTRR, hvm_save_mtrr_msr, hvm_load_mtrr_msr, void memory_type_changed(struct domain *d) { - if ( need_iommu(d) && d->vcpu && d->vcpu[0] ) + if ( (need_iommu(d) || cache_flush_permitted(d)) && d->vcpu && d->vcpu[0] ) { p2m_memory_type_changed(d); flush_all(FLUSH_CACHE);