On 02.01.2025 18:13, Petr Beneš wrote: > --- a/xen/arch/x86/mm/p2m-ept.c > +++ b/xen/arch/x86/mm/p2m-ept.c > @@ -154,27 +154,39 @@ static void ept_p2m_type_to_flags(const struct > p2m_domain *p2m, > case p2m_access_n: > case p2m_access_n2rwx: > entry->r = entry->w = entry->x = 0; > + entry->pw = 0; > break; > case p2m_access_r: > entry->w = entry->x = 0; > + entry->pw = 0; > break; > case p2m_access_w: > entry->r = entry->x = 0; > + entry->pw = 0; > break; > case p2m_access_x: > entry->r = entry->w = 0; > + entry->pw = 0; > break; > case p2m_access_rx: > case p2m_access_rx2rw: > entry->w = 0; > + entry->pw = 0; > break; > case p2m_access_wx: > entry->r = 0; > + entry->pw = 0; > break; > case p2m_access_rw: > entry->x = 0; > + entry->pw = 0; > break; > case p2m_access_rwx: > + entry->pw = 0; > + break; > + case p2m_access_r_pw: > + entry->w = entry->x = 0; > + entry->pw = !!cpu_has_vmx_ept_paging_write; > break; > }
Hmm ... Instead of you touching the bit in every one of the case blocks, I was expecting you to clear the bit ahead of the switch(), accepting a double update in the p2m_access_r_pw case. Jan