On 23.02.2022 19:11, Tamas K Lengyel wrote:
>> @@ -607,6 +607,7 @@ struct page_info *p2m_get_page_from_gfn(
>>
>>          /* Error path: not a suitable GFN at all */
>>          if ( !p2m_is_ram(*t) && !p2m_is_paging(*t) && !p2m_is_pod(*t) &&
>> +             (!p2m_is_shared(*t) || !(q & P2M_UNSHARE)) &&
>>               !mem_sharing_is_fork(p2m->domain) )
>>              return NULL;
>>      }
> 
> I don't follow what this is fixing. A shared entry would return true
> to p2m_is_ram() - p2m_ram_shared is listed under P2M_RAM_TYPES - so
> the rest of the if statement would never be checked. So if we get past
> that check we know we definitely don't have a shared entry, ie
> p2m_is_shared must be false ie the check for P2M_UNSHARE is dead code.
> Am I missing something?

No, I am. I mistakenly took p2m_is_any_ram() to include the shared case,
but p2m_is_ram() to not do so. Thanks for pointing out, and I'm actually
happy to be able to droop this hunk.

Jan


Reply via email to