All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH 7/8] pdx: Reorder pdx.[ch]
Date: Mon, 17 Jul 2023 17:24:04 +0100	[thread overview]
Message-ID: <64b56b25.170a0220.6a4ba.993c@mx.google.com> (raw)
In-Reply-To: <20230717160318.2113-8-alejandro.vallejo@cloud.com>

On Mon, Jul 17, 2023 at 05:03:17PM +0100, Alejandro Vallejo wrote:
> The next patch compiles out compression-related chunks, and it's helpful to
> have them grouped together beforehand.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
>  xen/common/pdx.c      | 58 +++++++++++++++++++++----------------------
>  xen/include/xen/pdx.h | 37 +++++++++++++++++++++------
>  2 files changed, 59 insertions(+), 36 deletions(-)
> 
> [snip]
>
> diff --git a/xen/include/xen/pdx.h b/xen/include/xen/pdx.h
> index 5378e664c2..ce27177b56 100644
> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -68,15 +68,41 @@
>   */
>  
>  extern unsigned long max_pdx;
> -extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
> -extern unsigned int pfn_pdx_hole_shift;
> -extern unsigned long pfn_hole_mask;
> -extern unsigned long pfn_top_mask, ma_top_mask;
>  
>  #define PDX_GROUP_COUNT ((1 << PDX_GROUP_SHIFT) / \
>                           (sizeof(*frame_table) & -sizeof(*frame_table)))
>  extern unsigned long pdx_group_valid[];
>  
> +/**
> + * Mark [smfn, emfn) as allocatable in the frame table
> + *
> + * @param smfn Start mfn
> + * @param emfn End mfn
> + */
> +void set_pdx_range(unsigned long smfn, unsigned long emfn);
> +
> +/**
> + * Invoked to determine if an mfn has an associated valid frame table entry
> + *
> + * In order for it to be legal it must pass bounds, grouping and
> + * compression sanity checks.
> + *
> + * @param mfn To-be-checked mfn
> + * @return True iff all checks pass
> + */
> +bool __mfn_valid(unsigned long mfn);
> +
> +#define page_to_pdx(pg)  ((pg) - frame_table)
> +#define pdx_to_page(pdx) gcc11_wrap(frame_table + (pdx))
> +
> +#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
> +#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
> +
> +extern unsigned long pfn_pdx_bottom_mask, ma_va_bottom_mask;
> +extern unsigned int pfn_pdx_hole_shift;
> +extern unsigned long pfn_hole_mask;
> +extern unsigned long pfn_top_mask, ma_top_mask;
> +
>  /**
>   * Validate a region's compatibility with the current compression runtime
>   *
> @@ -164,9 +190,6 @@ static inline unsigned long pdx_to_pfn(unsigned long pdx)
>             ((pdx << pfn_pdx_hole_shift) & pfn_top_mask);
>  }
>  
> -#define mfn_to_pdx(mfn) pfn_to_pdx(mfn_x(mfn))
> -#define pdx_to_mfn(pdx) _mfn(pdx_to_pfn(pdx))
> -
>  /**
>   * Computes the offset into the direct map of an maddr
>   *
> -- 
> 2.34.1
The latest rebase messed up this patch. set_pdx_range(), __mfn_valid() and
the page_to_pdx()/pdx_to_page() macros should be removed in order for the
additions to make sense. Re-running GitLab with that now...

Alejandro




  reply	other threads:[~2023-07-17 16:24 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 16:03 [PATCH 0/8] Make PDX compression optional Alejandro Vallejo
2023-07-17 16:03 ` [PATCH 1/8] mm/pdx: Add comments throughout the codebase for pdx Alejandro Vallejo
2023-07-18  9:14   ` Jan Beulich
2023-07-17 16:03 ` [PATCH 2/8] arm/mm: Document the differences between arm32 and arm64 directmaps Alejandro Vallejo
2023-07-20 20:05   ` Julien Grall
2023-07-21 15:09     ` Alejandro Vallejo
2023-07-21 17:51       ` Julien Grall
2023-07-17 16:03 ` [PATCH 3/8] pdx: Mark pdx hole description globals readonly after boot Alejandro Vallejo
2023-07-18  9:14   ` Jan Beulich
2023-07-17 16:03 ` [PATCH 4/8] build: Remove CONFIG_HAS_PDX Alejandro Vallejo
2023-07-18  9:19   ` Jan Beulich
2023-07-18  9:35     ` Andrew Cooper
2023-07-18  9:38       ` Jan Beulich
2023-07-18 13:35         ` Alejandro Vallejo
2023-07-17 16:03 ` [PATCH 5/8] mm: Factor out the pdx compression logic in ma/va converters Alejandro Vallejo
2023-07-21 16:11   ` Julien Grall
2023-07-17 16:03 ` [PATCH 6/8] mm/pdx: Standardize region validation wrt pdx compression Alejandro Vallejo
2023-07-21 17:05   ` Julien Grall
2023-07-24 12:18     ` Alejandro Vallejo
2023-07-24 18:20       ` Julien Grall
2023-07-25  6:51         ` Jan Beulich
2023-07-25 14:27           ` Julien Grall
2023-07-25 14:34             ` Jan Beulich
2023-07-27 10:14               ` Alejandro Vallejo
2023-07-27 10:19                 ` Jan Beulich
2023-07-17 16:03 ` [PATCH 7/8] pdx: Reorder pdx.[ch] Alejandro Vallejo
2023-07-17 16:24   ` Alejandro Vallejo [this message]
2023-07-17 16:03 ` [PATCH 8/8] pdx: Add CONFIG_HAS_PDX_COMPRESSION as a Kconfig option Alejandro Vallejo
2023-07-18  9:33 ` [PATCH 0/8] Make PDX compression optional Jan Beulich
2023-07-18 12:58   ` Alejandro Vallejo
2023-07-18 13:06     ` Jan Beulich
2023-07-18 13:40       ` Alejandro Vallejo
2023-07-20 22:00 ` Julien Grall
2023-07-20 22:13   ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64b56b25.170a0220.6a4ba.993c@mx.google.com \
    --to=alejandro.vallejo@cloud.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.