07.06.24 10:50, Jan Beulich:
On 07.06.2024 09:25, Jan Beulich wrote:
On 03.06.2024 13:09, Sergiy Kibrik wrote:
@@ -38,9 +34,13 @@ static inline bool altp2m_active(const struct domain *d)
}
/* Only declaration is needed. DCE will optimise it out when linking. */
-uint16_t altp2m_vcpu_idx(const struct vcpu *v);
void altp2m_vcpu_disable_ve(struct vcpu *v);
#endif
+static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
+{
+ return altp2m_active(v->domain) ? vcpu_altp2m(v).p2midx : 0;
+}
While perhaps okay this way as a first step,
Hmm, or maybe not. 0 is a valid index, and hence could be misleading
at call sites.
I'm returning 0 index here because implementation of
p2m_get_mem_access() for x86 & ARM expects it to be 0 when altp2m not
active or not implemented.
-Sergiy