mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	Alan Robinson <Alan.Robinson@fujitsu.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v2 2/2] x86/xen: allow larger contiguous memory regions in PV guests
Date: Thu, 13 Feb 2025 10:16:38 +0100	[thread overview]
Message-ID: <b6eac47f-648f-4197-8f6d-96bc71cf15b8@suse.com> (raw)
In-Reply-To: <20250213085538.17060-3-jgross@suse.com>

On 13.02.2025 09:55, Juergen Gross wrote:
> Today a PV guest (including dom0) can create 2MB contiguous memory
> regions for DMA buffers at max. This has led to problems at least
> with the megaraid_sas driver, which wants to allocate a 2.3MB DMA
> buffer.
> 
> The limiting factor is the frame array used to do the hypercall for
> making the memory contiguous, which has 512 entries and is just a
> static array in mmu_pv.c.
> 
> In order to not waste memory for non-PV guests, put the initial
> frame array into .init.data section and dynamically allocate an array
> from the .init_after_bootmem hook of PV guests.
> 
> In case a contiguous memory area larger than the initially supported
> 2MB is requested, allocate a larger buffer for the frame list. Note
> that such an allocation is tried only after memory management has been
> initialized properly, which is tested via a flag being set in the
> .init_after_bootmem hook.
> 
> Fixes: 9f40ec84a797 ("xen/swiotlb: add alignment check for dma buffers")
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Tested-by: Alan Robinson <Alan.Robinson@fujitsu.com>

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



      reply	other threads:[~2025-02-13  9:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13  8:55 [PATCH v2 0/2] xen/swiotlb: two fixes Juergen Gross
2025-02-13  8:55 ` [PATCH v2 1/2] xen/swiotlb: relax alignment requirements Juergen Gross
2025-02-13  8:55 ` [PATCH v2 2/2] x86/xen: allow larger contiguous memory regions in PV guests Juergen Gross
2025-02-13  9:16   ` Jan Beulich [this message]

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=b6eac47f-648f-4197-8f6d-96bc71cf15b8@suse.com \
    --to=jbeulich@suse.com \
    --cc=Alan.Robinson@fujitsu.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®