[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v3 02/16] x86/altp2m: check if altp2m active when giving away p2midx


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Sergiy Kibrik <sergiy_kibrik@xxxxxxxx>
  • Date: Fri, 7 Jun 2024 12:40:55 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fQSWMvFthlOnIXd7KFncBqnKIJ2wikQTFBXuPSArA1Q=; b=gyO9AFr1KwLsCvqghWsmc0eIbPmLoiotR9w9pUOk7wsaGgCzC8sRZLnp1EG52nRMElrd0hGZRGPuDOx5Cit6hr5VMVLRUq/CAGF4LxyRPwY4UljbMVO00jlPtUy+GXGPT4of7J3J3xck0y0414fd954PQP2kGvhXWhjP0LMSE/ypCsU5Jb+c/1d/TEw0Utg7QiCzngI7dexkrVNiTrPKXXWwnmm+LroqcTAR2fLMmPv6pcF+BnuwaEiSKEURzWtHT37Gv3wYId4icN1mkMMeSROagutRunfQ2ljAtnBmt5g2boL2cqdjJV7rNqrCJ0YtFz1UuuvrKtyKwTjbRa9Xzg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GljUWAsv1HfUzkBS50fkBCH/b3CL2GWuR7Hv9bJHDveXLV/4qwOr7Doai2WRjfMav3pyHNet0udNCjwA2zpN5RjuKV7mH0cXSKlFjPIAXTo+jAo1HfxcD0MIi3lXP6GBPcVQ5as9hzPO6jXLm+NbFhI1TH8+svVDR9BICvANbOn8vTl80EX4YRE8+EWKkXo7e5HLFLZUaw8/tHgM89HqWmNInlQ1kpYsBu8BxE0Yu0ye2C4GX9bgc1VCtSc4i1GfmpVvIKcWfknMKM19a91f4/WJ5prBbRQF2DemiCZyiW0o34jybsedTT/4XNqeXhwbhPXWcxelv31CYzpuaEVSbQ==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 07 Jun 2024 09:41:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.