On 06.05.2025 10:31, Roger Pau Monne wrote: > --- a/xen/arch/x86/hvm/mtrr.c > +++ b/xen/arch/x86/hvm/mtrr.c > @@ -605,22 +605,8 @@ int hvm_set_mem_pinned_cacheattr(struct domain *d, > uint64_t gfn_start, > > type = range->type; > call_rcu(&range->rcu, free_pinned_cacheattr_entry); > - p2m_memory_type_changed(d); > - switch ( type ) > - { > - case X86_MT_UCM: > - /* > - * For EPT we can also avoid the flush in this case; > - * see epte_get_entry_emt(). > - */ > - if ( hap_enabled(d) && cpu_has_vmx ) > - case X86_MT_UC: > - break; > - /* fall through */ > - default: > - flush_all(FLUSH_CACHE); > - break; > - } > + memory_type_changed(d); > + > return 0; > }
Hmm, so your consideration to avoid the "goto" in my patch was perhaps this part of your change, where you expect the "return 0" could then stay here. Maybe. However, you removing the switch() means we'd then also flush in cases where currently (or with my change) we avoid doing so. Jan