public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Keith Busch <kbusch@kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	Keith Busch <kbusch@meta.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH rfc] vfio-pci: Allow write combining
Date: Tue, 6 Aug 2024 13:47:13 -0300	[thread overview]
Message-ID: <20240806164713.GH676757@ziepe.ca> (raw)
In-Reply-To: <BN9PR11MB52763F2A0DB607F9C2BB97928CBF2@BN9PR11MB5276.namprd11.prod.outlook.com>

On Tue, Aug 06, 2024 at 07:19:18AM +0000, Tian, Kevin wrote:

> "
> Bit 3 should be set to 1b if the data is prefetchable and set to 0b
> otherwise. A Function is permitted to mark a range as prefetchable
> if there are no side effects on reads, the Function returns all bytes
> on reads regardless of the byte enables, and host bridges can
> merge processor writes into this range without causing errors.
> "
> 
> Above kind of suggests that using WC on a non-prefetchable BAR
> may cause errors then "prefetch and WC are related" does make
> some sense?

prefetch exists in the spec to support historical old pre-PCI-x
environments where a bridge does all kinds of strange things. prefetch
turns that brdige behavior on because otherwise it is non backwards
compatible.

In a modern PCIe environment the fabric is perfectly TLP preserving
and the PCI spec concept if prefetch is entirely vestigial.

There is no clean mapping of what PCI spec prefetch contemplates with
how moderns CPUs actually work. They should never be comingled.

Today we expect the driver to understand what TLPs the CPU should emit
and do the correct thing. From a Linux programming model with modern
HW we never really permit "merge process writes" or expect
"speculative reads" on anything except explicit WC mappings.

Jason

  reply	other threads:[~2024-08-06 17:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 15:53 [PATCH rfc] vfio-pci: Allow write combining Keith Busch
2024-08-01 14:19 ` Jason Gunthorpe
2024-08-01 15:41   ` Alex Williamson
2024-08-01 16:11     ` Jason Gunthorpe
2024-08-01 16:52       ` Alex Williamson
2024-08-01 17:13         ` Jason Gunthorpe
2024-08-01 17:33           ` Alex Williamson
2024-08-01 17:53             ` Jason Gunthorpe
2024-08-01 18:16               ` Alex Williamson
2024-08-02 11:53                 ` Jason Gunthorpe
2024-08-02 17:05                   ` Alex Williamson
2024-08-06 16:53                     ` Jason Gunthorpe
2024-08-06 18:43                       ` Alex Williamson
2024-08-07 14:19                         ` Jason Gunthorpe
2024-08-07 17:46                           ` Alex Williamson
2024-08-13 18:02                             ` Jason Gunthorpe
2024-08-02 14:24             ` Keith Busch
2024-08-02 14:33               ` Jason Gunthorpe
2024-08-06  7:19                 ` Tian, Kevin
2024-08-06 16:47                   ` Jason Gunthorpe [this message]
2024-08-15  5:05               ` Christoph Hellwig

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=20240806164713.GH676757@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=alex.williamson@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.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