qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>,
	QEMU <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	qiaonuohan@cn.fujitsu.com
Subject: Re: Page alignment & memory regions expectations
Date: Wed, 24 Aug 2022 18:42:01 +0200	[thread overview]
Message-ID: <e7b3468a-cdfb-4592-8a7a-48da2fa77647@redhat.com> (raw)
In-Reply-To: <CAJ+F1CL27O8dmGSws=-QgutRRpM2NHcued28gnvt5jWo2WeUvw@mail.gmail.com>

On 24.08.22 14:43, Marc-André Lureau wrote:
> Hi,

Hi!

> 
> tpm-crb creates a "tpm-crb-cmd" RAM memory region that is not page
> aligned. Apparently, this is not a problem for QEMU in general. However,
> it crashes kdump'ing in dump.c:get_next_page, as it expects

I assume you mean "dumping in kdump format".

> GuestPhysBlock to be page-aligned. (see also bug
> https://bugzilla.redhat.com/show_bug.cgi?id=2120480
> <https://bugzilla.redhat.com/show_bug.cgi?id=2120480>)
> 
> Here is some relevant DEBUG_GUEST_PHYS_REGION_ADD log:
> guest_phys_block_add_section: target_start=00000000fd000000
> target_end=00000000fe000000: added (count: 3)
> guest_phys_block_add_section: target_start=00000000fed40080
> target_end=00000000fed41000: added (count: 4)
> guest_phys_block_add_section: target_start=00000000fffc0000
> target_end=0000000100000000: added (count: 5)
> 
> I am looking for ideas on how to solve this crash.

Do we care if we don't include everything in the dump? I recall that
e.g., vfio will simply align and not care about such partial RAM blocks.


One idea is doing another pass over the list at the end (after possible
merging of sections) and making sure everything is page-aligned.

Another idea is specifying somehow that that memory region should simply
not be dumped ...


But I do wonder why the ram memory region that's mapped into the guest
physical address space has such a weird alignment/size ...

> 
> Should qemu enforce that memory regions are target page-aligned? In

... can we simply fixup tpm-crb-cmd?

> which case, TPM CRB MMIO region would overlap with the RAM region, and I
> wonder how that turns out to be, and if other devices would be impacted etc
> 
> Or should kdump learn to handle non-aligned blocks somehow? I think that
> option should make a reasonable solution, as long as we only have
> empty/zero-memory "gaps". Handling other cases of joint or overlapping
> regions seems more difficult.

Right, you'd actually have to pad the remainder with zeroes.


-- 
Thanks,

David / dhildenb



  reply	other threads:[~2022-08-24 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24 12:43 Page alignment & memory regions expectations Marc-André Lureau
2022-08-24 16:42 ` David Hildenbrand [this message]
2022-08-24 19:55   ` Peter Maydell
2022-08-25  7:26     ` David Hildenbrand
2022-08-25 11:47       ` Peter Maydell
2022-08-25 11:57         ` David Hildenbrand
2022-08-25 12:18           ` Peter Maydell

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=e7b3468a-cdfb-4592-8a7a-48da2fa77647@redhat.com \
    --to=david@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=stefanb@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).