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

Re: [PATCH] x86: idle domains don't have a domain-page mapcache


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 5 Jan 2023 12:04:21 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=3ykmsFdGGmg1YLJtWbMR4ZNI61TRCFhCcyqvlK2ivpU=; b=HcvZ0mdCL5isDDdSPtIZj4DBTMZyPV7/HiOoDr6J8EQR6DPnUjXYwAXJGM6BUDHo+6ovLCFliV+wB4+NeViXq0ebbMr2eNd7uSCHFtQnl/4Wq9oNw7eBcTPvA/esuBYCbQuKAE9Bdw2Iz5M2pAFlStNXZPBhqBlKG1NgxR7jjyLpuCpHPegMou4KaWbY7QMpnHBSw5Kmre4BO6WWk2s7AgvxoWaNcXdbx6QvyAa5ytkUhHqS4mTEgP2SaYOyXIQOJETorkHzl1d/gGsIm6qPoG5xkKdBOOogIR9AtmG2OdlgcfKKnttilMBVFvip5Mlf86KQecSz1mAZ1Npn+NoMVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jbTn9W3gGCGXeF2CksLIfEvd1pRokFjoUfqXABsKPJ9P/AY/757YKX9M6iP80NEmyByWoGSnAin0iDCANe7IA4EkzLBWRlPrXzKqIfNrih+eq/iDIIC7q6Noma/i6YbcUBpj9EfRUy58zfzNfAFEsgab3ifXozluOMbWqWn5sqjn78xKMr9CgDuusFAPs9l1qN1Wtf2qAa6Z5uckRbQhVSOALu8gF1rMcVDJJKcHB0TVr2gdq7yfpZRBHluAXwJw9ihGT5jr/NsrDgyf2zMaN69+U8IRcawDeockCtInRKGMAyPoS+y7UOwMYfpEFMVIMJO9FtKl016ppqwZNF/F2A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Thu, 05 Jan 2023 12:04:34 +0000
  • Ironport-data: A9a23:9zD4u6PZFhHXXs3vrR2XlsFynXyQoLVcMsEvi/4bfWQNrUp20TEOm jAdWTiBO62NZWunKY12O4m//B9V7ZTUmt9kGgto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9SuvzrRC9H5qyo42tB5gFmP5ingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0t1dBltTp fBEEmxOQTatosaYg7a/W8A506zPLOGzVG8ekldJ6GiASNwAEdXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PpxujaDpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8eexHmqCNtLTdVU8NZQsniX7EI2OCE6VFCCvfCHqFPnZ45Af hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmdx6yR7wuHC2wsSj9adMdgpMIwXSYt1 FKCg5XuHzMHmKKRYWKQ8PGTtzzaESoIKW4PYwcUQA1D5MPsyLzflTrKR9dnVaSz3tv8HGipx yjQ9XZuwbIOkcQMyqO3u0jdhC6hrYTISQhz4RjLWmWi7UVyY4vNi5GU1GU3JM1odO6xJmRtd lBd8yRCxIji1a2wqRE=
  • Ironport-hdrordr: A9a23:vXrQQqxj75MPpseGR4QcKrPwIr1zdoMgy1knxilNoH1uHvBw8v rEoB1173DJYVoqNk3I++rhBEDwexLhHPdOiOF6UItKNzOW21dAQrsSiLfK8nnNHDD/6/4Y9Y oISdkbNDQoNykZsfrH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZIPY76jcWuuXMREKwR1wL4WEG2q6PucOA
  • Thread-topic: [PATCH] x86: idle domains don't have a domain-page mapcache

On 05/01/2023 11:09 am, Jan Beulich wrote:
> First and foremost correct a comment implying the opposite. Then, to
> make things more clear PV-vs-HVM-wise, move the PV check earlier in the
> function, making it unnecessary for both callers to perform the check
> individually. Finally return NULL from the function when using the idle
> domain's page tables, allowing a dcache->inuse check to also become an
> assertion.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

By and large, I think these changes ok, but I want to make an argument
for going further right away.


Most of mapcache_current_vcpu() is a giant bodge to support the weird
context in dom0_construct_pv(), but we pay the price unilaterally.

By updating current too in that weird context, I think we can drop
mapcache_override_current().  It's also worth noting that the only
callers are __init so having this_cpu(override) as per-cpu is a waste.

But I also think we can drop the pagetable_is_null(v->arch.guest_table)
part too.  If we happen to be half-idle, it doesn't matter if we use the
current mapcache by following cpu_info()->current instead.  That said, I
can't think of any case where we could legally access transient mappings
from an idle context, so I'd be tempted to see if we can simply drop
that clause.


Overall, I think the logic would benefit from being expressed in terms
of short_directmap, just like init_xen_l4_slots().  That is ultimately
the property that we care about, and it's also the property that is
changing in the effort to remove the directmap entirely.

If not short_directmap, then at least having the property expressed
consistently between the two piece of code, seeing as it is the same
property.

~Andrew

 


Rackspace

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