From: Alexander Graf <graf@amazon.com>
To: Nadav Amit <namit@vmware.com>, Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Ajay Kaher <akaher@vmware.com>, "x86@kernel.org" <x86@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
Srivatsa Bhat <srivatsab@vmware.com>,
"srivatsa@csail.mit.edu" <srivatsa@csail.mit.edu>,
Alexey Makhalov <amakhalov@vmware.com>,
"Vasavi Sirnapalli" <vsirnapalli@vmware.com>,
"er.ajay.kaher@gmail.com" <er.ajay.kaher@gmail.com>,
"willy@infradead.org" <willy@infradead.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"jailhouse-dev@googlegroups.com" <jailhouse-dev@googlegroups.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"acrn-dev@lists.projectacrn.org" <acrn-dev@lists.projectacrn.org>,
"helgaas@kernel.org" <helgaas@kernel.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2] x86/PCI: Prefer MMIO over PIO on all hypervisor
Date: Tue, 4 Oct 2022 10:22:14 +0200 [thread overview]
Message-ID: <f1a7e603-2e64-fd2a-1100-f2898060e3f7@amazon.com> (raw)
In-Reply-To: <04F550C5-786A-4B8E-9A88-EBFBD8872F16@vmware.com>
Hey Nadav,
On 03.10.22 19:34, Nadav Amit wrote:
> On Oct 3, 2022, at 8:03 AM, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
>> Not my but rather PCI maintainer's call but IMHO dropping 'const' is
>> better, introducing a new global var is our 'last resort' and should be
>> avoided whenever possible. Alternatively, you can add a
>> raw_pci_ext_ops_preferred() function checking somethin within 'struct
>> hypervisor_x86' but I'm unsure if it's better.
>>
>> Also, please check Alex' question/suggestion.
> Here is my take (and Ajay knows probably more than me):
>
> Looking briefly on MCFG, I do not see a clean way of using the ACPI table.
> The two options are either to use a reserved field (which who knows, might
> be used one day) or some OEM ID. I am also not familiar with
> PCI_COMMAND.MEMORY=0, so Ajay can hopefully give some answer about that.
>
> Anyhow, I understand (although not relate) to the objection for a new global
> variable. How about explicitly calling this hardware bug a “bug” and using
> the proper infrastructure? Calling it explicitly a bug may even push whoever
> can to resolve it.
I am a lot more concerned with how we propagate it externally than
within Linux. If we hard code that all Linux kernels 6.2+ that are
running in VMware prefer ECAM over PIO, we lock ourselves into that
stance for better or worse, which means:
* All past and future versions of any VMware hypervisor product have to
always allow ECAM access for any PCIe config space write
* No other hypervisor benefits from any of this without upstream code change
* No real hardware platform benefits from this without upstream code change
By moving it into MCFG, we can create a path for the outside environment
to tell the OS whether it's safe to use ECAM always. This obviously
doesn't work with MCFG as it stands today, we'd have to propose an MCFG
spec change to the PCI SIG's "PCI Firmware Specification" to add the
respective field. Future VMware versions could then always expose the
flag - and if you find it broken, remove it again.
Putting all of the logic on which system potentially prefers ECAM over
PIO config space access into Linux is just a big hack that we should
avoid as much as possible.
Alex
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
next prev parent reply other threads:[~2022-10-04 8:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 12:47 Ajay Kaher
2022-09-13 13:34 ` Vitaly Kuznetsov
2022-09-29 5:36 ` Ajay Kaher
2022-09-29 9:12 ` Alexander Graf
2022-10-03 15:03 ` Vitaly Kuznetsov
2022-10-03 17:34 ` Nadav Amit
2022-10-03 21:06 ` H. Peter Anvin
2022-10-03 21:28 ` Nadav Amit
2022-10-03 23:51 ` H. Peter Anvin
2022-10-04 0:19 ` Nadav Amit
2022-10-04 8:22 ` Alexander Graf [this message]
2022-10-04 18:48 ` Nadav Amit
2022-10-10 14:58 ` Nadav Amit
2022-10-10 17:05 ` Michael S. Tsirkin
2022-10-04 8:30 ` Vitaly Kuznetsov
2022-10-03 21:01 ` H. Peter Anvin
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=f1a7e603-2e64-fd2a-1100-f2898060e3f7@amazon.com \
--to=graf@amazon.com \
--cc=acrn-dev@lists.projectacrn.org \
--cc=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=er.ajay.kaher@gmail.com \
--cc=helgaas@kernel.org \
--cc=hpa@zytor.com \
--cc=jailhouse-dev@googlegroups.com \
--cc=kvm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mst@redhat.com \
--cc=namit@vmware.com \
--cc=rostedt@goodmis.org \
--cc=srivatsa@csail.mit.edu \
--cc=srivatsab@vmware.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=vsirnapalli@vmware.com \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®