From nobody Thu Oct 30 23:31:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1753355125; cv=none; d=zohomail.com; s=zohoarc; b=QAoYsFE7UiXBdPahR+X+UzdxXOZzwn1mONfRswS3n9PTTGzI6+Ejkadg2DgVolJ9UPPYbCsrS0UOXkhfnuGXAPq7xnYiSjMHfLhzkeGB/ZcBUsqOQWEZLFzX/4yvGnvBN79tpE2Qd5pGyCfbWhbBjSHsqzAEV8w0fc5UYTfPjO8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753355125; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3zceg71Pnqj3ImLkxP+2Mg3UE0d3Wnna2dUrKt8QAy0=; b=hWqh4nNnvrFq4/cUqsWZQoQ/tDLDCK6NT858ykSaRmBIsUL09037Z9CtmH9W3v2+1o5n2ra2Gf0w6x0OJuT0zqm3co4cxQtDh/8mm/iihX0v1y0VPUmk7hsAgTQKZp1FHqpC7QM0iJxSzmAAIsL2/rP0R8oz3OTBKFvOy/0haYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 175335512582128.303530497052634; Thu, 24 Jul 2025 04:05:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1055722.1424058 (Exim 4.92) (envelope-from ) id 1uetl4-0001bt-JF; Thu, 24 Jul 2025 11:05:06 +0000 Received: by outflank-mailman (output) from mailman id 1055722.1424058; Thu, 24 Jul 2025 11:05:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uetl4-0001bm-Gf; Thu, 24 Jul 2025 11:05:06 +0000 Received: by outflank-mailman (input) for mailman id 1055722; Thu, 24 Jul 2025 11:05:05 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uetl3-00011w-8j for xen-devel@lists.xenproject.org; Thu, 24 Jul 2025 11:05:05 +0000 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [2a00:1450:4864:20::329]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0cb20f43-687e-11f0-b895-0df219b8e170; Thu, 24 Jul 2025 13:05:03 +0200 (CEST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4561ca74829so9237065e9.0 for ; Thu, 24 Jul 2025 04:05:03 -0700 (PDT) Received: from localhost (112.pool92-178-7.dynamic.orange.es. [92.178.7.112]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4587054c37csm16762615e9.8.2025.07.24.04.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jul 2025 04:05:01 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0cb20f43-687e-11f0-b895-0df219b8e170 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1753355102; x=1753959902; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3zceg71Pnqj3ImLkxP+2Mg3UE0d3Wnna2dUrKt8QAy0=; b=soZ3jotS715QRAUjePJSpGp+3811W2Eb904IYAIxU+nknj4nRf3oiwPZuAQiS5Vb0p pqFoYsuepfEKB4wy24MO7SCX8tT9zHXQaaZPUPN6FlCFm0wssRPRnuDwKXHyqXq5w9Yw HzmSgYjC77gWWgCGNuRU8fO2rufsq6OlvmzXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753355102; x=1753959902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3zceg71Pnqj3ImLkxP+2Mg3UE0d3Wnna2dUrKt8QAy0=; b=AMiQee0fSKvqmd4E/RB6QBS1T/9pZnELwDaiZwKl3zNOiAJjuCdUPfcFwX4cwKVJxd HZyGQIfiQxEz4/Z6ypD1gPc2rZB9qGn8DOXvOlNjyp+rwCM173922vYMVFGsDCmmPyAa boO/ZdUawIr1pjn75tWuNw6KeIGZzjz9DXWqXS69CKIKpDeLB7EV/ZSOJ++I6cjFRbbc sg8ITVAK3nKZWvRZZq0OYU0LTyK5GANJOgPjfIbuGpvkoEznkx+wXeRHg9AcdcDwKsKx uDNl98q9D+XFDGKoRu/QASr92m5JxoVcLrOwi2U6wQbRA/DeKS3/L6eGAeEve+ckkVHO Zsrw== X-Gm-Message-State: AOJu0YwgUMGFqqYaW8SqZTEdGXiLlM+yOYNLFjILj9eCPR3R14EqlSc0 jqJg8HnlNq16vxju0ALBMAL2WSun4KBpj/rDpw0CzjJhv93Evv2xxZQrW1EVVQJ1+O10UkzP/Xv c6hJU X-Gm-Gg: ASbGnctdjpxTyNFOGFKOElgFJlAhdLZjBT+KwrliKHkzHrDHAYT+DzjTxrlKmDVMYTF PKL3lVvIxNi1iIJdykmDlKovQDhm7Iud8HKDLtEd0dhvKbzAhyQpI8cNypx13M5GXtkmyw+X4W5 1l0DUyBL7bJfR6h5d8efVVYNMIPf0HCHzLXqrut68tUZlD6JgnYQNaZjaXs04NrBVugoeCC/iYG brcXCPqK0gJzD2hxpht55L+nqK0Ql4SweFKRcXz4cVL3+7DD02jsfoAoWrzsGhrXbQnAMX8d5TP Gf50g9X/XnV0jYLiJotxvoiW3+Z2/zMFMIIpsr2heHEcWxkh/HLiToiXUtq4GPrPKphDYHPo87M kQjFqB8eWiZe/Wo0IBl8nT8XTl/z+5SJPHrzl5ItRCu8BDpW411TEefAhqiEMdcnicg== X-Google-Smtp-Source: AGHT+IHH6U0ylScaSpGCzT78sQEfFST9V4KLsm2VWM2leCHNtZ7t5h1+5hZK2OCWUYLruC4XPlYy6A== X-Received: by 2002:a05:600c:638f:b0:456:1611:cea5 with SMTP id 5b1f17b1804b1-45868d46f15mr64914895e9.18.1753355102429; Thu, 24 Jul 2025 04:05:02 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , Stefano Stabellini , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v3 3/8] pdx: introduce command line compression toggle Date: Thu, 24 Jul 2025 13:04:11 +0200 Message-ID: <20250724110416.2081-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250724110416.2081-1-roger.pau@citrix.com> References: <20250724110416.2081-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1753355127105116600 Introduce a command line option to allow disabling PDX compression. The disabling is done by turning pfn_pdx_add_region() into a no-op, so when attempting to initialize the selected compression algorithm the array of ranges to compress is empty. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Jan Beulich --- Changes since v1: - New in this version. --- docs/misc/xen-command-line.pandoc | 9 +++++++++ xen/common/pdx.c | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index 6865a61220ca..5dd2ab82b7aa 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -2072,6 +2072,15 @@ for all of them (`true`), only for those subject to = XPTI (`xpti`) or for those not subject to XPTI (`no-xpti`). The feature is used only in case INVPCID is supported and not disabled via `invpcid=3Dfalse`. =20 +###=C2=A0pdx-compress +> `=3D ` + +> Default: `true` if CONFIG_PDX_NONE is unset + +Only relevant when the hypervisor is build with PFN PDX compression. Contr= ols +whether Xen will engage in PFN compression. The algorithm used for PFN +compression is selected at build time from Kconfig. + ### ple_gap > `=3D ` =20 diff --git a/xen/common/pdx.c b/xen/common/pdx.c index 49c9dbf9e5fa..ad7871ad90be 100644 --- a/xen/common/pdx.c +++ b/xen/common/pdx.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include =20 @@ -76,9 +77,13 @@ static struct pfn_range { } ranges[MAX_PFN_RANGES] __initdata; static unsigned int __initdata nr_ranges; =20 +static bool __initdata pdx_compress =3D true; +boolean_param("pdx-compress", pdx_compress); + void __init pfn_pdx_add_region(paddr_t base, paddr_t size) { - if ( !size ) + /* Without ranges there's no PFN compression. */ + if ( !size || !pdx_compress ) return; =20 if ( nr_ranges >=3D ARRAY_SIZE(ranges) ) @@ -215,6 +220,13 @@ void __init pfn_pdx_compression_setup(paddr_t base) unsigned int i, j, bottom_shift =3D 0, hole_shift =3D 0; unsigned long mask =3D pdx_init_mask(base) >> PAGE_SHIFT; =20 + if ( !nr_ranges ) + { + printk(XENLOG_DEBUG "PFN compression disabled%s\n", + pdx_compress ? ": no ranges provided" : ""); + return; + } + if ( nr_ranges > ARRAY_SIZE(ranges) ) { printk(XENLOG_WARNING --=20 2.49.0