public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <seanjc@google.com>, <kvm@vger.kernel.org>,
	<rick.p.edgecombe@intel.com>, <kirill.shutemov@linux.intel.com>,
	<kai.huang@intel.com>, <reinette.chatre@intel.com>,
	<xiaoyao.li@intel.com>, <tony.lindgren@linux.intel.com>,
	<binbin.wu@linux.intel.com>, <isaku.yamahata@intel.com>,
	<linux-kernel@vger.kernel.org>, <yan.y.zhao@intel.com>,
	<chao.gao@intel.com>
Subject: Re: [PATCH RFC] KVM: TDX: Defer guest memory removal to decrease shutdown time
Date: Thu, 13 Mar 2025 21:07:15 +0200	[thread overview]
Message-ID: <2a25d2c8-6b2e-443b-98aa-723dea2c9e78@intel.com> (raw)
In-Reply-To: <CABgObfZYjdW_Mp3JB0z38-RoAdhr4rwjzb_AOYfrmwZZ0ERBsw@mail.gmail.com>

On 13/03/25 20:39, Paolo Bonzini wrote:
> On Thu, Mar 13, 2025 at 7:16 PM Adrian Hunter <adrian.hunter@intel.com> wrote:
>> Improve TDX shutdown performance by adding a more efficient shutdown
>> operation at the cost of adding separate branches for the TDX MMU
>> operations for normal runtime and shutdown.  This more efficient method was
>> previously used in earlier versions of the TDX patches, but was removed to
>> simplify the initial upstreaming.  This is an RFC, and still needs a proper
>> upstream commit log. It is intended to be an eventual follow up to base
>> support.
> 
> In the latest code the HKID is released in kvm_arch_pre_destroy_vm().

I am looking at kvm-coco-queue

> That is before kvm_free_memslot() calls kvm_gmem_unbind(), which
> results in fput() and hence kvm_gmem_release().
> 
> So, as long as userspace doesn't remove the memslots and close the
> guestmemfds, shouldn't the TD_TEARDOWN method be usable?

kvm_arch_pre_destroy_vm() is called from kvm_destroy_vm()
which won't happen before kvm_gmem_release() calls
kvm_put_kvm().


  reply	other threads:[~2025-03-13 19:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13 18:16 [PATCH RFC] KVM: TDX: Defer guest memory removal to decrease shutdown time Adrian Hunter
2025-03-13 18:39 ` Paolo Bonzini
2025-03-13 19:07   ` Adrian Hunter [this message]
2025-03-17  8:13 ` Kirill A. Shutemov
2025-03-18 15:41   ` Adrian Hunter
2025-03-18 21:11     ` Vishal Annapurve
2025-03-20  0:42 ` Vishal Annapurve
2025-03-24 10:40   ` Adrian Hunter
2025-03-27  8:14 ` Vishal Annapurve
2025-03-27 10:10   ` Adrian Hunter
2025-03-27 15:54 ` Sean Christopherson
2025-03-28 10:26   ` Adrian Hunter

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=2a25d2c8-6b2e-443b-98aa-723dea2c9e78@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=chao.gao@intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=tony.lindgren@linux.intel.com \
    --cc=xiaoyao.li@intel.com \
    --cc=yan.y.zhao@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