[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/12] x86/shadow: restrict OOS allocation to when it's really needed
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 16 May 2023 09:40:22 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=fk5gtEXHOHX/0G/rLup+XQBTQcNEBbA/Wd3XareT6hc=; b=SOCMbqAis+NeL4/G9oAnkN3D9DEUdQjk3j3lwDdZaLpLWc2CkoulIJxtCtFXDRnGGHohnCNAMWtbFJkRYxSxeajjdWyyd3ujMYOpcjF7XYXAAustGDvOXBWPBsZbqent6TKM4DyQBvw1mP3/4lGFJtP6+VbQIEX71LoqsgEryP8UglTCehYYIjKB4lj3nPnuzrRjnVODZ0h1v9ODobNDGG+kmu7Goi3bCQex2PyjfbbZWLSmNReTbg0hjqkqZm+tfx+j2sgjM/yOPlAdmYng4YqKmfA6vVwByb8g/1StUjClcJTzlLpQUfiY9H+LY6TVc1deftOXXeowPsORHfRusg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lgva9R4Kz9hWh79Su6qQs4tm+oMIrB7+fNZAwXUFkwUc8JO0+Nfhfe7QF+W+/hIeL9iffCAd4QaAcAHQlMtUSw7AYU+Ai3J0KoobWwGVA6Yk0tMTidIhbwOkCws/8syagcpOl6Cj1rVJynZoD8xOszHtaeqropTf6fJJyj4oSzJJnXOJpuqhiO0Rs9nR8dkSbLL6XPhDciysEiI2ZEBj0fhVEmjU70IfKWvWGlRPyftPVhkRBMCybSbo7Iw4jEfma8PMwsl7Hbw3yH/BXhTlH3vpT9expLBRhief6SMW2+oU0n0j1PCysTq4piUKTPRmXJ0iGkWrXlVThUkBlLG0Zg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>
- Delivery-date: Tue, 16 May 2023 07:40:32 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
PV domains won't use it, and even HVM ones won't when OOS is turned off
for them. There's therefore no point in putting extra pressure on the
(limited) pool of memory.
While there also zap the sh_type_to_size[] entry when OOS is disabled
altogether.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v3: New.
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -61,7 +61,9 @@ const uint8_t sh_type_to_size[] = {
[SH_type_l4_64_shadow] = 1,
[SH_type_p2m_table] = 1,
[SH_type_monitor_table] = 1,
+#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
[SH_type_oos_snapshot] = 1,
+#endif
};
#endif /* CONFIG_HVM */
@@ -1771,7 +1773,8 @@ static void sh_update_paging_modes(struc
#endif /* (SHADOW_OPTIMIZATIONS & SHOPT_VIRTUAL_TLB) */
#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
- if ( mfn_eq(v->arch.paging.shadow.oos_snapshot[0], INVALID_MFN) )
+ if ( !(d->options & XEN_DOMCTL_CDF_oos_off) &&
+ mfn_eq(v->arch.paging.shadow.oos_snapshot[0], INVALID_MFN) )
{
int i;
|