On 09.07.2024 07:48, Sergiy Kibrik wrote: > The stub just returns 0 due to implementation of p2m_get_mem_access() for > x86 & ARM expects it to be 0 when altp2m not active or not implemented. > > The separate stub is favoured over dynamic check for alt2pm availability > inside regular altp2m_vcpu_idx() because this way we retain the possibility > to later put the whole struct altp2mvcpu under CONFIG_ALTP2M. > > The purpose of the change is later to be able to disable altp2m support and > exclude its code from the build completely, when not supported by target > platform (as of now it's implemented for Intel EPT only). > > Signed-off-by: Sergiy Kibrik <sergiy_kib...@epam.com>
Yet what doesn't become clear is why 0 is a valid value to return. On the surface 0 is a valid index when altp2m is enabled. In which case it couldn't be used (without clarification) when altp2m is disabled. Jan