linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kiryl Shutsemau <kas@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: "Pratik R. Sampat" <prsampat@amd.com>,
	linux-mm@kvack.org,  linux-coco@lists.linux.dev, x86@kernel.org,
	linux-kernel@vger.kernel.org, tglx@linutronix.de,
	 mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
	ardb@kernel.org,  akpm@linux-foundation.org, david@kernel.org,
	osalvador@suse.de, thomas.lendacky@amd.com,
	 michael.roth@amd.com
Subject: Re: [PATCH v3 2/2] x86/sev: Add support to unaccept memory after hot-remove
Date: Thu, 29 Jan 2026 10:40:04 +0000	[thread overview]
Message-ID: <aXs4DTXCbI_c0JPO@thinkstation> (raw)
In-Reply-To: <16aa84a9-83ce-4748-bc73-ccf5cb6ce376@intel.com>

On Wed, Jan 28, 2026 at 01:15:06PM -0800, Dave Hansen wrote:
> On 1/28/26 12:41, Pratik R. Sampat wrote:
> > +static inline void arch_unaccept_memory(phys_addr_t start, phys_addr_t end)
> > +{
> > +	if (cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) {
> > +		snp_unaccept_memory(start, end);
> > +	} else {
> > +		panic("Cannot unaccept memory: unknown platform\n");
> > +	}
> > +}
> 
> This panic() is pretty nasty.
> 
> Can't we just disable memory hotplug up front if it's:
> 
> 	!cc_platform_has(CC_ATTR_GUEST_SEV_SNP)
> 
> ?

I don't understand SEV-SNP situation, but I don't think we need to do
anything on unplug for TDX. We should expect the unplugged memory to be
removed from SEPT. If VMM doesn't do this, it is effectively DoS and we
don't protect against DoS in CoCo.

Converting the memory to shared will do no good for us.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov


  reply	other threads:[~2026-01-29 10:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28 20:41 [PATCH v3 0/2] SEV-SNP Unaccepted Memory Hotplug Pratik R. Sampat
2026-01-28 20:41 ` [PATCH v3 1/2] mm/memory_hotplug: Add support to accept memory during hot-add Pratik R. Sampat
2026-01-29 10:35   ` Kiryl Shutsemau
2026-01-29 17:32     ` Pratik R. Sampat
2026-01-28 20:41 ` [PATCH v3 2/2] x86/sev: Add support to unaccept memory after hot-remove Pratik R. Sampat
2026-01-28 21:08   ` Andrew Morton
2026-01-28 22:25     ` Pratik R. Sampat
2026-01-28 21:15   ` Dave Hansen
2026-01-29 10:40     ` Kiryl Shutsemau [this message]
2026-01-29 17:32       ` Pratik R. Sampat
2026-01-29 17:39         ` Dave Hansen
2026-01-29 19:32           ` Pratik R. Sampat

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=aXs4DTXCbI_c0JPO@thinkstation \
    --to=kas@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=osalvador@suse.de \
    --cc=prsampat@amd.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.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