mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
pdx: introduce command line compression toggle
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é <roger.pau@cloud.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
fd23bc59c2
commit
31d9c88a38
2 files changed
+22
-1
No files matched your search
@@ -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=false`.
|
||||
|
||||
### pdx-compress
|
||||
> `= <boolean>`
|
||||
|
||||
> Default: `true` if CONFIG_PDX_NONE is unset
|
||||
|
||||
Only relevant when the hypervisor is build with PFN PDX compression. Controls
|
||||
whether Xen will engage in PFN compression. The algorithm used for PFN
|
||||
compression is selected at build time from Kconfig.
|
||||
|
||||
### ple_gap
|
||||
> `= <integer>`
|
||||
|
||||
|
||||
+13
-1
@@ -19,6 +19,7 @@
|
||||
#include <xen/mm.h>
|
||||
#include <xen/bitops.h>
|
||||
#include <xen/nospec.h>
|
||||
#include <xen/param.h>
|
||||
#include <xen/pfn.h>
|
||||
#include <xen/sections.h>
|
||||
|
||||
@@ -76,9 +77,13 @@ static struct pfn_range {
|
||||
} ranges[MAX_PFN_RANGES] __initdata;
|
||||
static unsigned int __initdata nr_ranges;
|
||||
|
||||
static bool __initdata pdx_compress = 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;
|
||||
|
||||
if ( nr_ranges >= ARRAY_SIZE(ranges) )
|
||||
@@ -215,6 +220,13 @@ void __init pfn_pdx_compression_setup(paddr_t base)
|
||||
unsigned int i, j, bottom_shift = 0, hole_shift = 0;
|
||||
unsigned long mask = pdx_init_mask(base) >> PAGE_SHIFT;
|
||||
|
||||
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
|
||||
|
||||