linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "corbet@lwn.net" <corbet@lwn.net>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"sathyanarayanan.kuppuswamy@linux.intel.com" 
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>
Cc: "Yu, Guorui" <guorui.yu@linux.alibaba.com>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>,
	"wander@redhat.com" <wander@redhat.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"chongc@google.com" <chongc@google.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"qinkun@apache.org" <qinkun@apache.org>,
	"Luck, Tony" <tony.luck@intel.com>,
	"Aktas, Erdem" <erdemaktas@google.com>,
	"dionnaglaze@google.com" <dionnaglaze@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"Du, Fan" <fan.du@intel.com>
Subject: Re: [PATCH v2 1/3] x86/tdx: Add TDX Guest event notify interrupt support
Date: Fri, 28 Apr 2023 13:50:51 +0000	[thread overview]
Message-ID: <11b38df4d91b1a85cec500d5fae9ab2242361f52.camel@intel.com> (raw)
In-Reply-To: <80718d6c-9e53-d549-bfe2-6c10d618acb1@linux.intel.com>

On Tue, 2023-04-25 at 23:07 -0700, Sathyanarayanan Kuppuswamy wrote:
> > > +/**
> > > + * tdx_event_irq_init() - Register IRQ for event notification from the
> > > VMM to
> > > + *                       the TDX Guest.
> > > + *
> > > + * Use SetupEventNotifyInterrupt TDVMCALL to register the event
> > > notification
> > > + * IRQ with the VMM, which is used by the VMM to notify the TDX guest
> > > when
> > > + * needed, for instance, when VMM finishes the GetQuote request from the
> > > TDX
> > > + * guest. The VMM always notifies the TDX guest via the same CPU on which
> > > the
> > > + * SetupEventNotifyInterrupt TDVMCALL is called. For simplicity, just
> > > allocate
> > > + * an IRQ (and a vector) directly from x86_vector_domain for such
> > > notification
> > > + * and pin the IRQ to the same CPU on which TDVMCALL is called.
> > 
> > I think "for simplicity" applies to allocate IRQ/vector "from BSP using
> > early_initcall()" (so TDVMCALL is easily guaranteed to be called on the same
> > cpu
> > where vector is allocated), but doesn't apply to allocate IRQ/vector from
> > x86_vector_domain and "pin the IRQ to the same CPU on which TDVMCALAL is
> > called".  The latter is something you must do (otherwise you need to
> > allocate
> > the same vector on all cpus), but not something that you do "for
> > simplicity".
> > 
> > > + *
> > > + * Since tdx_event_irq_init() is triggered via early_initcall(), it will
> > > be
> > > + * called before secondary CPUs bring up, so no special logic is required
> > > to
> > > + * ensure that the same CPU is used for SetupEventNotifyInterrupt
> > > TDVMCALL and
> > > + * IRQ allocation.
> > 
> > IMHO the second paragraph is obvious and no need to mention.
> > 
> > As explained above, I guess you just need to at somewhere simply mention
> > something like: "for simplicity use early_initcall() to allocate and pin the
> > IRQ/vector on BSP and also call the TDVMCALL on BSP".  Or probably "also
> > call
> > the TDVMCALL on BSP" can also be omitted as it's kinda already explained in
> > the
> > nature of the TDVMCALL.
> 
> How about the following?
> 
> Use SetupEventNotifyInterrupt TDVMCALL to register the event notification
> IRQ with the VMM, which is used by the VMM to notify the TDX guest when
> needed, for instance, when VMM finishes the GetQuote request from the TDX
> guest. The VMM always notifies the TDX guest via the same CPU that calls the
> SetupEventNotifyInterrupt TDVMCALL. Allocate an IRQ/vector from the
> x86_vector_domain and pin it on the same CPU on which TDVMCALL is called.
> For simplicity, use early_initcall() to allow both IRQ allocation and
> TDVMCALL to use BSP.

Sorry I missed your reply.  OK to me.

  reply	other threads:[~2023-04-28 13:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13  3:41 [PATCH v2 0/3] TDX Guest Quote generation support Kuppuswamy Sathyanarayanan
2023-04-13  3:41 ` [PATCH v2 1/3] x86/tdx: Add TDX Guest event notify interrupt support Kuppuswamy Sathyanarayanan
2023-04-14 13:34   ` Huang, Kai
2023-04-25 23:47     ` Sathyanarayanan Kuppuswamy
2023-04-26  1:59       ` Huang, Kai
2023-04-26  6:07         ` Sathyanarayanan Kuppuswamy
2023-04-28 13:50           ` Huang, Kai [this message]
2023-04-13  3:41 ` [PATCH v2 2/3] virt: tdx-guest: Add Quote generation support Kuppuswamy Sathyanarayanan
2023-04-26 15:40   ` Dionna Amalie Glaze
2023-04-27 18:27     ` Sathyanarayanan Kuppuswamy
2023-04-28  1:29       ` Dionna Amalie Glaze
2023-04-28 13:49   ` Huang, Kai
2023-05-01  6:03     ` Sathyanarayanan Kuppuswamy
2023-05-01 12:48       ` Huang, Kai
2023-05-04  7:12         ` Sathyanarayanan Kuppuswamy
2023-05-04 12:00           ` Huang, Kai
2023-05-02 22:27   ` Chong Cai
2023-04-13  3:41 ` [PATCH v2 3/3] selftests/tdx: Test GetQuote TDX attestation feature Kuppuswamy Sathyanarayanan
2023-04-26 15:47   ` Dionna Amalie Glaze
2023-04-27 19:10     ` Sathyanarayanan Kuppuswamy
2023-04-27 19:56       ` Dave Hansen
2023-04-27 19:53     ` Dave Hansen
2023-05-10  0:10 ` [PATCH v2 0/3] TDX Guest Quote generation support Erdem Aktas
2023-05-10  0:14   ` Sathyanarayanan Kuppuswamy

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=11b38df4d91b1a85cec500d5fae9ab2242361f52.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=chongc@google.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=dionnaglaze@google.com \
    --cc=erdemaktas@google.com \
    --cc=fan.du@intel.com \
    --cc=guorui.yu@linux.alibaba.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=qinkun@apache.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=shuah@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=wander@redhat.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;
as well as URLs for NNTP newsgroup(s).