From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02C0A1E531 for ; Thu, 16 Apr 2026 00:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776299493; cv=none; b=ndWugRdo0XxjAQWM8iPuw5oqxcuiWRWbcGJ9N9FXqGGy05pdoV0nNIMLDCX8C5vEatmx3EADoEF+lcL7EIPKUTE/76PpVVGuG19jf01vLwIKXfcR8fjlRTHcLPE2ONRVkN+lssLL++675Fz23QVNcdgHUKX5Fg7yR6CeeeJqmO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776299493; c=relaxed/simple; bh=IvOg9GYktEF/5/EJg4wjsPAg6BQSmYGdlvgvZ16chJ4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ITE8MKFzLvzgxqUmR1OdteqPXXzW/xnilmz9gZg8ji7RV7Kj6O/fzb2VtiGalOij6OCHuifgnCknvLIF4+GwgrT9vNaux0AJeg01vdmSeGtauaWiZKXFNpZpZnfFBc7J7x0Kdqe1kHgeqRCwJcj9Ax5zoaikgwS4vxC1FioTCxQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BccHER85; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BccHER85" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-354490889b6so10795016a91.3 for ; Wed, 15 Apr 2026 17:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1776299491; x=1776904291; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=HYei+ZT/wKyXqut2Nf35hAKF2yfzxuNDbm1r8pWJmmI=; b=BccHER85eperPH18yyOFVc7upiXKiQiC/2BdmIKJowvho6v+aaoqWItWQAnt99GUjY NBlYEUv7cN1L7hYoonpnupCWskUK9pRSC96XoV5xkgG55uBeKHBzxVWu2GqH1UbebyyK aoNaS9Rzwpqk4TorjR74Alvx8/luT9QUgINhQhTgG5wF7NGTth+5JO2f+CIDCh597MOX 7OPlKiT2zhE5Uw004mx6ds3nzch7HYRHML2xvjhzEAoBMqluqKuxCHU+kNl/zeFUEM0G VobBDm7+4343/2ohD1Wyt7qyW8x2VSlYcajKvivBMwl4yYY8e6CiYHkBiM20C3PHVc6A COew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776299491; x=1776904291; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HYei+ZT/wKyXqut2Nf35hAKF2yfzxuNDbm1r8pWJmmI=; b=P8vkEIpvgjAFwEw/YbpTBTitT5moJiklXenllgJEu27LZtdABFu1EeYB/16DGB0ogB kjtNeaEInNac5Ygs7Q3oqcfz9npbLDCRMHi08du58nLR/tOkL52daNGoRSMO32M0Ct/K 7MMPKkuD2J0kKq2ttalQcK/spS7EFe2h7dvq31a8C89PmNO3oLkgzNAmMwQrjnKCjIiq MPnvy52/KhKmdn38v8xHrlBlZPNzLtQ3tPX78yAYrbg6Fhrtj8BPToNVVDq4835bOJnS i/H+SeqGCOsAeIXyIbVqOCvf3QSHZmmZjvsm+/zQRFU9VPIsrG8gKixfY7P7CNIgqELA FtZw== X-Gm-Message-State: AOJu0YwOFi+p3KUcV+PjYr6D7Kht2fBeAAx9K1R5jDYK6XY2KqPEJuJ7 CZl8R+oVVI9NXowtQkr4o6iJ481n46RtIWG721lhMPF12AhpPbkQZujXdQtYiir2dhPpTB87Fpm 8sS5AZA== X-Received: from pjbcp15.prod.google.com ([2002:a17:90a:fb8f:b0:35f:b110:52c3]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3b49:b0:35b:ea35:c3ce with SMTP id 98e67ed59e1d1-35e42867ce0mr23466571a91.27.1776299491256; Wed, 15 Apr 2026 17:31:31 -0700 (PDT) Date: Wed, 15 Apr 2026 17:31:29 -0700 In-Reply-To: <69d977c0b367a_6c31a10021@djbw-dev.notmuch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260407180107.1603697-1-pbonzini@redhat.com> <20260407180107.1603697-2-pbonzini@redhat.com> <69d977c0b367a_6c31a10021@djbw-dev.notmuch> Message-ID: Subject: Re: [PATCH 1/3] VFIO: take reference to the KVM module From: Sean Christopherson To: Dan Williams Cc: "Kernel Mailing List, Linux" , kvm , Steffen Eiden , Alex Williamson , yilun.xu@linux.intel.com Content-Type: text/plain; charset="us-ascii" On Fri, Apr 10, 2026, Dan Williams wrote: > Sean Christopherson wrote: > > +Dan > > +Yilun > > [..] > > I added Dan because the PCI TSM stuff is picking up "struct kvm *kvm" references, > > and I want to head that off too, i.e. have it use the file approach instead of > > whatever it plans on doing (can't tell from the code, because there are no users). > > The PCI TSM *reference* for 'struct kvm *' will be inherited from > vfio/iommufd. However, the TSM driver needs some context to manipulate I assume/hope it just need to read "struct kvm" state though? > the VM. For example, TDX effectively needs: > > to_kvm_tdx(kvm)->td.tdr_page > > ...for operations like TDH.TDI.CREATE that sets up the context for the > privately assigned device. > > It could follow the example of arch/x86/kvm/mmu/page_track.c and do: > > kvm_tdx_tdi_create(struct file *kvm, ...) > > ...and use file_to_kvm() for that limited helper that does not need to expose > 'struct kvm_tdx' outside of arch/x86/. Any idea how many assets do you anticipate needing? E.g. is it just the TDR page, or will TSM need a whole pile of information?