All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Huang, FangSheng (Jerry)" <FangSheng.Huang@amd.com>
Cc: <qemu-devel@nongnu.org>, David Hildenbrand <david@redhat.com>,
	"Gregory Price" <gourry@gourry.net>,
	Zhigang Luo <Zhigang.Luo@amd.com>,
	Lianjie Shi <Lianjie.Shi@amd.com>
Subject: Re: [PATCH v7 1/1] numa: add memmap-type option for memory type configuration
Date: Thu, 21 May 2026 16:07:16 +0200	[thread overview]
Message-ID: <20260521160716.169137ae@imammedo> (raw)
In-Reply-To: <666a7ba1-5d3a-4732-b872-0d9fb2fe8461@amd.com>

On Thu, 21 May 2026 18:41:35 +0800
"Huang, FangSheng (Jerry)" <FangSheng.Huang@amd.com> wrote:

> Hi Igor,
> 
> Thanks for the candor in this round, and for laying out the
> architectural reasoning rather than just the position. The framing is
> clear: an RFC with a rough prototype demonstrating the device-based
> approach, and the interface decision after that exploration
> converges. That's a reasonable bar and I'm glad to converge on it.
> 
> Two of your clarifications particularly helped me converge:
> 
> - SPM belongs to the memory-device family by design, not as an
>    extension of built-in RAM.


> - The v4 -object/backend-property rejection is scoped to that form,
>    not to any device-based shape -- so `-device spm-memory` doesn't
>    carry the v4 risk forward.

Not sure what you a taking about, with device approach you will use
backend property ('memdev' if i recall correctly) to connect backend
(whatever it might be) to front-end (device model).

> 
> One thing I should mention while we're aligning: in parallel with
> this thread, I've actually been prototyping the spm-memory device
> direction you outlined. I held off bringing it into the v7
> discussion because I didn't want to muddy the interface debate with
> implementation specifics before the direction was settled. Now that
> you've made the path explicit, I can share what I've found and move
> the discussion to the v8 / RFC thread properly.
> 
> A short prototype status and a couple of architectural findings
> below. Some you've likely thought through already; raising them so
> the v8 thread has a starting point.
> 
> (1) Prototype status
> 
> A working `spm-memory` prototype inheriting from TYPE_MEMORY_DEVICE
> -- end-to-end verified on both SeaBIOS and OVMF across single,
> multi-instance, and mixed-with-pc-dimm scenarios.
> 
> (2) Umbrella overlap finding + proposed mitigation for your read
> 
> The umbrella SRAT entry at acpi-build.c:1510-1515 (PXM =
> nb_numa_nodes - 1, covering the full device_memory length per
> pc.c:615) overlaps every per-device entry by construction. Any
> driver that first-match-by-PXM via SRAT walk lands on the
> umbrella's range rather than the device's actual range.
> 
> Mitigation in the prototype: in acpi-build.c, skip the umbrella
> when every plugged memory device is TYPE_SPM_MEMORY. Empty
> device_memory and mixed configs (SPM + pc-dimm / nvdimm /
> virtio-mem) keep the umbrella, preserving Windows hotplug /
> Linux <4G SWIOTLB. Verified in both directions. Honest scoping:
> mixed mode still has the overlap, so this is a partial
> mitigation.

I'd suggest to:
  1: make smp-memory not hotpluggable
  2: when SRAT is built, partition 'umbrella region' region on chunks
    (current hotplug kind and spm kind). that will fragment the region
    and limit what can be (hot)plugged later on (especially if spm in the middle),
    but that will be the edge case, and user can reconfigure QEMU to
    put spm 1st and DIMMs on top.

If we do it like this, then mixed scenarios should work just fine.
 
> 
> (3) Process
> 
> I'll prepare a v8 PATCH series along the lines you sketched:
> 
>    - spm-memory device class (TYPE_MEMORY_DEVICE base for first cut)
>    - drop the `reserved` enum value
>    - commit message with the bigger-picture rationale

ps:
it would be nice to put references to previous versions in cover letter,
so it wouldn't be pain to find them (especially when threads are renamed)

> 
> I'll post the RFC on qemu-devel under a fresh subject so the 
> device-based discussion can start clean.
> 
> Setting the v7 memmap-type discussion aside accordingly. Thanks
> again for the patience.
> 
> Best regards,
> FangSheng Huang (Jerry)
> 



  reply	other threads:[~2026-05-21 14:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 10:41 [PATCH v7 1/1] numa: add memmap-type option for memory type configuration Huang, FangSheng (Jerry)
2026-05-21 14:07 ` Igor Mammedov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-03-06  8:27 [PATCH v7 0/1] numa: add 'memmap-type' " fanhuang
2026-03-06  8:27 ` [PATCH v7 1/1] " fanhuang
2026-05-14 13:05   ` Igor Mammedov
2026-05-14 13:38     ` Gregory Price
2026-05-18  8:15       ` David Hildenbrand (Arm)
2026-05-15  7:53     ` Huang, FangSheng (Jerry)
2026-05-15 13:04       ` Igor Mammedov
2026-05-18 10:43         ` Huang, FangSheng (Jerry)
2026-05-18 14:32           ` Igor Mammedov
2026-05-19  4:18             ` Huang, FangSheng (Jerry)
2026-05-20 12:41               ` Igor Mammedov

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=20260521160716.169137ae@imammedo \
    --to=imammedo@redhat.com \
    --cc=FangSheng.Huang@amd.com \
    --cc=Lianjie.Shi@amd.com \
    --cc=Zhigang.Luo@amd.com \
    --cc=david@redhat.com \
    --cc=gourry@gourry.net \
    --cc=qemu-devel@nongnu.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.