From: Nikolay Borisov <nik.borisov@suse.com>
To: Rick Edgecombe <rick.p.edgecombe@intel.com>,
bp@alien8.de, dave.hansen@intel.com, hpa@zytor.com,
kas@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com,
tglx@kernel.org, x86@kernel.org, chao.gao@intel.com,
yan.y.zhao@intel.com, yilun.xu@intel.com
Subject: Re: [PATCH] x86/virt/tdx: Add command line param for DPAMT
Date: Thu, 26 Nov 2026 12:48:35 +0200 [thread overview]
Message-ID: <5e0136bc-43c9-4f7d-8689-b58515a55992@suse.com> (raw)
In-Reply-To: <20261126005417.976523-1-rick.p.edgecombe@intel.com>
On 26.11.26 г. 2:54 ч., Rick Edgecombe wrote:
> The Physical Address Metadata Table (PAMT) holds TDX metadata for
> physical memory and must be allocated by the kernel during TDX module
> initialization. Dynamic PAMT (DPAMT) is a TDX module feature that can
> reduce this memory use by allocating part of the PAMT dynamically.
>
> In order to work with DPAMT, the kernel needs to perform upkeep on the
> DPAMT for each page that it gives to the TDX module. Late during the
> upstreaming of DPAMT, an optimization patch that avoided taking a global
> lock for each maintenance operation was dropped. The plan was to follow up
> the initial upstreaming with optimization work, however priority for this
> work has yet to materialize.
>
> Separately from the wrinkle of the global lock, TDX continues to struggle
> with large patchsets to enable new features. Doing DPAMT maintenance for
> the new types of memory these features require, further grows the initial
> patchsets.
>
> Adding a kernel parameter for DPAMT can help these two separate problems.
> Having DPAMT be default off can make the offensive global lock the rare
> case, while still giving some big memory conscious users the option to use
> DPAMT. Having DPAMT capable of being off means that the upcoming TDX
> features can be merged in smaller pieces by ignoring DPAMT to start.
>
> So add a parameter and make DPAMT default off.
>
> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> ---
> Dave, feel free to ignore.
>
> TDX developers, this is small, but can I get a round of review on the
> patch? One consideration I had was if tdx_supports_dynamic_pamt() should
> be renamed, but I thought it wasn't worth the churn.
>
> Another idea is to ignore the impact of the global lock until someone
> complains. And for the new features, to make them mutually exclusive with
> Dynamic PAMT support by simply keying off module support, rather than
> allowing Dynamic PAMT to be disabled. But since Dynamic PAMT is available
> on all newer modules, this would only appear to make the new features
> enabled. In practice they would be dead code. And default off is arguably
> the best default option in DPAMT's current state. So prefer the kernel
> param.
>
> Also, I cherry-picked this from the last DPAMT patchset and didn't retest
> it on upstream yet. Will do, but I'm not expecting problems.
To me all this seems like "DPAMT upstream was rushed because it is
helpful for some few big players", and because 99% of the other people
aren't going to use it let's make it optional. And we end up with
conditionals sprinkled in the code, 99% of the time those conditionals
evaluating to false.
Wouldn't it be better if Intel gets it act together, upstreams the
optimisation work, making DPAMT a first-class citizen and just get rid
of the optional and ensure that DPAMT is used in 99% of the cases?
Otherwise it just feels that upstream work starts with one statement and
commitments, later those are revised and/or never materialize.
prev parent reply other threads:[~2026-11-26 10:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 0:54 Rick Edgecombe
2026-11-26 8:13 ` Yan Zhao
2026-11-26 10:48 ` Nikolay Borisov [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=5e0136bc-43c9-4f7d-8689-b58515a55992@suse.com \
--to=nik.borisov@suse.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=hpa@zytor.com \
--cc=kas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
--cc=yan.y.zhao@intel.com \
--cc=yilun.xu@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 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®