linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Lu Baolu <baolu.lu@linux.intel.com>
Cc: tglx@linutronix.de, ashok.raj@intel.com, kevin.tian@intel.com,
	dave.jiang@intel.com, megha.dey@intel.com,
	alex.williamson@redhat.com, bhelgaas@google.com,
	dan.j.williams@intel.com, dmaengine@vger.kernel.org,
	eric.auger@redhat.com, jacob.jun.pan@intel.com, jgg@mellanox.com,
	jing.lin@intel.com, kvm@vger.kernel.org, kwankhede@nvidia.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	maz@kernel.org, mona.hossain@intel.com, netanelg@mellanox.com,
	parav@mellanox.com, pbonzini@redhat.com, rafael@kernel.org,
	samuel.ortiz@intel.com, sanjay.k.kumar@intel.com,
	shahafs@mellanox.com, tony.luck@intel.com, vkoul@kernel.org,
	yan.y.zhao@linux.intel.com, yi.l.liu@intel.com
Subject: Re: [RFC PATCH 1/1] platform-msi: Add platform check for subdevice irq domain
Date: Thu, 10 Dec 2020 12:57:38 -0600	[thread overview]
Message-ID: <20201210185738.GA49060@bjorn-Precision-5520> (raw)
In-Reply-To: <20201210004624.345282-1-baolu.lu@linux.intel.com>

On Thu, Dec 10, 2020 at 08:46:24AM +0800, Lu Baolu wrote:
> The pci_subdevice_msi_create_irq_domain() should fail if the underlying
> platform is not able to support IMS (Interrupt Message Storage). Otherwise,
> the isolation of interrupt is not guaranteed.
> 
> For x86, IMS is only supported on bare metal for now. We could enable it
> in the virtualization environments in the future if interrupt HYPERCALL
> domain is supported or the hardware has the capability of interrupt
> isolation for subdevices.

> + * We want to figure out which context we are running in. But the hardware
> + * does not introduce a reliable way (instruction, CPUID leaf, MSR, whatever)
> + * which can be manipulated by the VMM to let the OS figure out where it runs.
> + * So we go with the below probably_on_bare_metal() function as a replacement
> + * for definitely_on_bare_metal() to go forward only for the very simple reason
> + * that this is the only option we have.
> + */
> +static const char * const possible_vmm_vendor_name[] = {
> +	"QEMU", "Bochs", "KVM", "Xen", "VMware", "VMW", "VMware Inc.",
> +	"innotek GmbH", "Oracle Corporation", "Parallels", "BHYVE",
> +	"Microsoft Corporation"
> +};
> +
> +static bool probably_on_bare_metal(void)

What is the point of a function called probably_on_bare_metal()?
*Probably*?  The caller can't really do anything with the fact that
we're not 100% sure this gives the correct answer.  Just call it
"on_bare_metal()" or something and accept the fact that it might be
wrong sometimes.

This patch goes with IMS support, which somebody else is handling, so
I assume you don't need anything from the PCI side.

  parent reply	other threads:[~2020-12-10 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10  0:46 [RFC PATCH 1/1] platform-msi: Add platform check for subdevice irq domain Lu Baolu
2020-12-10  8:22 ` David Woodhouse
2020-12-16  1:42   ` Lu Baolu
2021-01-07  7:01   ` Tian, Kevin
2020-12-10 18:57 ` Bjorn Helgaas [this message]
2020-12-10 19:15   ` David Woodhouse
2020-12-16  1:48   ` Lu Baolu

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=20201210185738.GA49060@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=alex.williamson@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=eric.auger@redhat.com \
    --cc=jacob.jun.pan@intel.com \
    --cc=jgg@mellanox.com \
    --cc=jing.lin@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=megha.dey@intel.com \
    --cc=mona.hossain@intel.com \
    --cc=netanelg@mellanox.com \
    --cc=parav@mellanox.com \
    --cc=pbonzini@redhat.com \
    --cc=rafael@kernel.org \
    --cc=samuel.ortiz@intel.com \
    --cc=sanjay.k.kumar@intel.com \
    --cc=shahafs@mellanox.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=vkoul@kernel.org \
    --cc=yan.y.zhao@linux.intel.com \
    --cc=yi.l.liu@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;
as well as URLs for NNTP newsgroup(s).