All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 2/2] x86/mm: drop unmapping from marking-as-I/O in arch_init_memory()
Date: Tue, 12 Aug 2025 18:30:27 +0200	[thread overview]
Message-ID: <aJtsIxI4y-UspLKg@macbook.local> (raw)
In-Reply-To: <5a862787-40d8-4c9f-bd89-01d866648120@suse.com>

On Mon, Aug 11, 2025 at 12:50:23PM +0200, Jan Beulich wrote:
> The unmapping part would have wanted to cover UNUSABLE regions as well,
> and it would now have been necessary for space outside the low 16Mb
> (wherever Xen is placed). However, with everything up to the next 2Mb
> boundary now properly backed by RAM, we don't need to unmap anything
> anymore: Space up to __2M_rwdata_end[] is properly reserved, whereas
> space past that mark (up to the next 2Mb boundary) is ordinary RAM.

Oh, I see, so this was done to unmap trailing space when the Xen image
region is mapped using 2M pages.

> While there, limit the scopes of involved variables.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

> ---
> v2: Drop unmapping code altogether.
> 
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -275,8 +275,6 @@ static void __init assign_io_page(struct
>  
>  void __init arch_init_memory(void)
>  {
> -    unsigned long i, pfn, rstart_pfn, rend_pfn, iostart_pfn, ioend_pfn;
> -
>      /*
>       * Basic guest-accessible flags:
>       *   PRESENT, R/W, USER, A/D, AVAIL[0,1,2], AVAIL_HIGH, NX (if available).
> @@ -292,12 +290,17 @@ void __init arch_init_memory(void)
>       * case the low 1MB.
>       */
>      BUG_ON(pvh_boot && trampoline_phys != 0x1000);
> -    for ( i = 0; i < 0x100; i++ )
> +    for ( unsigned int i = 0; i < MB(1) >> PAGE_SHIFT; i++ )

I would use PFN_DOWN() rather than the shift, but that's just my
preference.

Thanks, Roger.


  reply	other threads:[~2025-08-12 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 10:48 [PATCH v2 0/2] x86/mm: unmapping and marking-as-I/O in arch_init_memory() Jan Beulich
2025-08-11 10:49 ` [PATCH v2 1/2] x86/mkelf32: pad load segment to 2Mb boundary Jan Beulich
2025-08-12 16:18   ` Roger Pau Monné
2025-08-14  7:02     ` Jan Beulich
2025-08-14 14:04       ` Roger Pau Monné
2025-08-11 10:50 ` [PATCH v2 2/2] x86/mm: drop unmapping from marking-as-I/O in arch_init_memory() Jan Beulich
2025-08-12 16:30   ` Roger Pau Monné [this message]
2025-08-14  7:04     ` Jan Beulich

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=aJtsIxI4y-UspLKg@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --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.