diff mbox series

[3/8] pdx: Mark pdx hole description globals readonly after boot

Message ID 20230717160318.2113-4-alejandro.vallejo@cloud.com (mailing list archive)
State Superseded
Headers show
Series Make PDX compression optional | expand

Commit Message

Alejandro Vallejo July 17, 2023, 4:03 p.m. UTC
They define where the compressible area of valid mfns is, and all of them
are populated on boot (with the exception of max_pdx, that's updated on
memory hotplug).

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
 xen/common/pdx.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Comments

Jan Beulich July 18, 2023, 9:14 a.m. UTC | #1
On 17.07.2023 18:03, Alejandro Vallejo wrote:
> They define where the compressible area of valid mfns is, and all of them
> are populated on boot (with the exception of max_pdx, that's updated on
> memory hotplug).
> 
> No functional change.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/common/pdx.c b/xen/common/pdx.c
index ec64d3d2ef..99d4a90a50 100644
--- a/xen/common/pdx.c
+++ b/xen/common/pdx.c
@@ -47,30 +47,33 @@ 
  * ones.
  */
 
-/** Maximum (non-inclusive) usable pdx */
+/**
+ * Maximum (non-inclusive) usable pdx. Must be
+ * modifiable after init due to memory hotplug
+ */
 unsigned long __read_mostly max_pdx;
 
 /** Mask for the lower non-compressible bits of an mfn */
-unsigned long __read_mostly pfn_pdx_bottom_mask = ~0UL;
+unsigned long __ro_after_init pfn_pdx_bottom_mask = ~0UL;
 
 /** Mask for the lower non-compressible bits of an maddr or vaddr */
-unsigned long __read_mostly ma_va_bottom_mask = ~0UL;
+unsigned long __ro_after_init ma_va_bottom_mask = ~0UL;
 
 /** Mask for the higher non-compressible bits of an mfn */
-unsigned long __read_mostly pfn_top_mask = 0;
+unsigned long __ro_after_init pfn_top_mask = 0;
 
 /** Mask for the higher non-compressible bits of an maddr or vaddr */
-unsigned long __read_mostly ma_top_mask = 0;
+unsigned long __ro_after_init ma_top_mask = 0;
 
 /**
  * Mask for a pdx compression bit slice.
  *
  *  Invariant: valid(mfn) implies (mfn & pfn_hole_mask) == 0
  */
-unsigned long __read_mostly pfn_hole_mask = 0;
+unsigned long __ro_after_init pfn_hole_mask = 0;
 
 /** Number of bits of the "compressible" bit slice of an mfn */
-unsigned int __read_mostly pfn_pdx_hole_shift = 0;
+unsigned int __ro_after_init pfn_pdx_hole_shift = 0;
 
 unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS(
     (FRAMETABLE_NR + PDX_GROUP_COUNT - 1) / PDX_GROUP_COUNT)] = { [0] = 1 };