From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbcHOXRB (ORCPT ); Mon, 15 Aug 2016 19:17:01 -0400 Received: from mga09.intel.com ([134.134.136.24]:9715 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbcHOXQ7 (ORCPT ); Mon, 15 Aug 2016 19:16:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,527,1464678000"; d="asc'?scan'208";a="1014877488" From: "Rustad, Mark D" To: Benjamin Herrenschmidt CC: Alex Williamson , Alexander Duyck , Alexey Kardashevskiy , "Bjorn Helgaas" , Hannes Reinecke , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Babu Moger , Paul Mackerras , "santosh@chelsio.com" , Netdev Subject: Re: [PATCHv2 3/4] pci: Determine actual VPD size on first access Thread-Topic: [PATCHv2 3/4] pci: Determine actual VPD size on first access Thread-Index: AQHR8mm1x4gieAcpg02k5PrKrXXAB6BBxcSAgAEHz4CAAIgjAIABPbMAgAAXvgCAAJU9gIAFjcuAgABJloCAAALMAIAADC8A Date: Mon, 15 Aug 2016 23:16:57 +0000 Message-ID: References: <1452684335-46107-1-git-send-email-hare@suse.de> <1452684335-46107-4-git-send-email-hare@suse.de> <20160209210458.GB32530@localhost> <1470787409.3015.81.camel@kernel.crashing.org> <1470873296.3015.117.camel@kernel.crashing.org> <20160811141700.4f4faabb@t450s.home> <1470978669.3015.155.camel@kernel.crashing.org> <197F6532-FC5E-4D72-976D-4207BAD8D83E@intel.com> <1471299799.12231.121.camel@kernel.crashing.org> <1471300400.12231.130.camel@kernel.crashing.org> In-Reply-To: <1471300400.12231.130.camel@kernel.crashing.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [134.134.3.39] Content-Type: multipart/signed; boundary="Apple-Mail=_4378A241-00CD-4684-B3B4-5F5698D79B1E"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_4378A241-00CD-4684-B3B4-5F5698D79B1E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Benjamin Herrenschmidt wrote: > Filtering things to work around bugs in existing guests to avoid crashes > is a different kettle of fish and could be justified but keep in mind that > in most cases a malicious guest will be able to exploit those HW flaws. Bugs in existing guests is an interesting case, but I have been focused on getting acceptable behavior from a properly functioning guest, in the face of hardware issues that can only be resolved in a single place. I agree that a malicious guest can cause all kinds of havoc with directly-assigned devices. Consider a 4-port PHY chip on a shared MDIO bus, for instance. There is really nothing to be done about the potential for mischief with that kind of thing. The VPD problem that I had been concerned about arises from a bad design in the PCI spec together with implementations that share the registers across functions. The hardware isn't going to change and I really doubt that the spec will either, so we address it the only place we can. I am certain that we agree that not everything can or should be addressed in vfio. I did not mean to suggest it should try to address everything, but I think it should make it possible for correctly behaving guests to work. I think that is not unreasonable. Perhaps the VPD range check should really just have been implemented for the sysfs interface, and left the vfio case unchecked. I don't know because I was not involved in that issue. Perhaps someone more intimately involved can comment on that notion. > Assuming that a device coming back from a guest is functional and not > completely broken and can be re-used without a full PERST or power cycle > is a wrong assumption. It may or may not work, no amount of "filtering" > will fix the fundamental issue. If your HW won't give you access to PERST > well ... blame Intel for not specifying a standard way to generate it in > the first place :-) Yeah, I worry about the state that a malicious guest could leave a device in, but I consider direct assignment always risky anyway. I would just like it to at least work in the non-malicious guest cases. I guess my previous response was really just too terse, I was just focused on unavoidable hangs and data corruption, which even were happening without any guest involvement. For me, guests were just an additional exposure of the same underlying issue. With hindsight, it is easy to see that a standard reset would now be a pretty useful thing. I am sure that even if it existed, we would now have lots and lots of quirks around it as well! :-) -- Mark Rustad, Networking Division, Intel Corporation --Apple-Mail=_4378A241-00CD-4684-B3B4-5F5698D79B1E Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJXsk1oAAoJEDwO/+eO4+5ucXYQAKOGYyHnEI9+QpoV7FEgGsTQ +Ire7lSaKbkhfIDDcECGW/CjrfKBeAM9x9Hk1NII2/Dbux4Hlf8WMXkfmsFb2VXU axjM2OyjJahdsGWHy96gZ7M/Do/tho/aOjBL27a9G539bJci5Y+rEcIO0disjds+ lyQ5IOf6j1zJFdl3koiNJMmsJou+kTadC4Cq93x3trG9iiOl8m8FaujmcWr3uz8M y1uG6xuUBEXRexxKe2UL0SQQvR0/XY/J9dMyTEKmT+3a2+VhvxwOjFlduJy31BUp T8SFT9okqliTWY5QzT+xJ2A9C6+/5ji3Pj47eTeo0GCQVPnjwD7nFYCtjczM2Ni5 4o0znkwijA2TwYuPf2ZUXNzqUwU15fAK5zJT1ga5juRpsasiJavn1izF7WXI76ca /4wfdyJvt/vaqJBBzKzCEbX73gM275G3ETq3nLtw+09yuq+S1ZPkXd/28g/wmlXl tZ5Rs6SdvT37FEAHiuxJxLfmBNpZ9dd58RHb4Hq6PpL7FS0yh/1mBY/DWobB4MHl zgCI1dxv2udAGcLOSJ2LAPE/oEqlQXmYmIa39NwGS/lMAFD7DDnH1BpcyrseSlRX IJhnL0x1Lfb2eVAiNlwjJLZgvNSjbeQv2rdsgLjrmgH06XXJqZcXjgbUHRKSK2pT dXqcxOxBrHnHIgpmHy9W =MBjF -----END PGP SIGNATURE----- --Apple-Mail=_4378A241-00CD-4684-B3B4-5F5698D79B1E--