From: Zhao Liu <zhao1.liu@intel.com>
To: Kirill Martynov <stdcalllevi@yandex-team.ru>
Cc: Xiaoyao Li <xiaoyao.li@intel.com>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] x86/cpu: Handle SMM mode in x86_cpu_dump_state for softmmu
Date: Tue, 29 Jul 2025 00:19:10 +0800 [thread overview]
Message-ID: <aIei/i7+MHM2s3EZ@intel.com> (raw)
In-Reply-To: <6C44AD09-0675-4277-93C2-DB3647EC54C2@yandex-team.ru>
Hi Kirill,
On Mon, Jul 28, 2025 at 05:44:25PM +0300, Kirill Martynov wrote:
> Date: Mon, 28 Jul 2025 17:44:25 +0300
> From: Kirill Martynov <stdcalllevi@yandex-team.ru>
> Subject: Re: [PATCH] x86/cpu: Handle SMM mode in x86_cpu_dump_state for
> softmmu
> X-Mailer: Apple Mail (2.3826.600.51.1.1)
>
> Hi Xiaoyao!
> Hi Zhao!
>
> Xiaoyao,
> I tested the patch you provided, it works smoothly, easy to apply. Nothing to complain about.
>
> Zhao,
> I also tried your approach (extend cpu_address_space_init with AddressSpace parameter)
> First, it crashed in malloc with error:
> malloc(): unaligned tcache chunk detected
> After a little investigation I resized cpu->cpu_ases array, so it can fit second element and
> it started working. However, it looks like that function cpu_address_space_destroy needs
> some adjustment, because now it treats cpu->cpu_ases elements as dynamically allocated and
> destroys them with g_free() and passing &smram_address_space to cpu_address_space_init()
> in register_smram_listener() could lead to a problem since it is statically allocated in binary.
Thanks for testing. Yes, resize related details are needed, which were
I missed. These 2 patches essentially are all about adding SMM CPU
address space for KVM, like TCG did.
> So, my question now, what should I do?
I still believe we should update cpu_address_space_init() and remove its
outdated assumptions about KVM first.
Moreover, users should have control over the added address spaces (I
think this is why num_ases should be set before
cpu_address_space_init()), and quietly updating num_ases is not a good
idea.
The question of whether to reuse smram_address_space for the CPU is
flexible. At least TCG doesn't reuse the same SMM space, and there's
already cpu_as_root (and cpu_as_mem!) in X86CPU. There are also some
cleanup things worth considering, such as how to better handle the TCG
memory listener in cpu_address_space_init() - KVM also has the similar
logic. If possible, I can help you further refine this fix and clean up
other related stuff in one goes as well.
Thanks,
Zhao
next prev parent reply other threads:[~2025-07-28 15:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 15:44 [PATCH] x86/cpu: Handle SMM mode in x86_cpu_dump_state for softmmu Kirill Martynov
2025-06-17 6:50 ` Kirill Martynov
2025-07-02 3:17 ` Zhao Liu
2025-07-02 14:16 ` Xiaoyao Li
2025-07-02 15:10 ` Xiaoyao Li
2025-07-02 16:24 ` Xiaoyao Li
2025-07-03 9:25 ` Kirill Martynov
2025-07-03 12:53 ` Xiaoyao Li
2025-07-04 8:20 ` Zhao Liu
2025-07-04 13:50 ` Xiaoyao Li
2025-07-28 14:44 ` Kirill Martynov
2025-07-28 16:19 ` Zhao Liu [this message]
2025-07-29 6:01 ` Xiaoyao Li
2025-07-29 8:36 ` Kirill Martynov
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=aIei/i7+MHM2s3EZ@intel.com \
--to=zhao1.liu@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stdcalllevi@yandex-team.ru \
--cc=xiaoyao.li@intel.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 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.