Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752996AbdHOFoG (ORCPT ); Tue, 15 Aug 2017 01:44:06 -0400 Received: from gate.crashing.org ([63.228.1.57]:35923 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbdHOFoE (ORCPT ); Tue, 15 Aug 2017 01:44:04 -0400 Message-ID: <1502775751.4493.47.camel@kernel.crashing.org> Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table From: Benjamin Herrenschmidt To: Robin Murphy , Alexey Kardashevskiy , linuxppc-dev@lists.ozlabs.org Cc: David Gibson , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, Yongji Xie , Eric Auger , Kyle Mahlkuch , Alex Williamson , Jike Song , Bjorn Helgaas , Joerg Roedel , Arvind Yadav , David Woodhouse , Kirti Wankhede , Mauricio Faria de Oliveira , Neo Jia , Paul Mackerras , Vlad Tsyrklevich , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Date: Tue, 15 Aug 2017 15:42:31 +1000 In-Reply-To: References: <20170807072548.3023-1-aik@ozlabs.ru> <8f5f7b82-3c10-7f39-b587-db4c4424f04c@ozlabs.ru> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.4 (3.24.4-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 22 On Mon, 2017-08-14 at 14:12 +0100, Robin Murphy wrote: > On the other hand, if the check is not so much to mitigate malicious > guests attacking the system as to prevent dumb guests breaking > themselves (e.g. if some or all of the MSI-X capability is actually > emulated), then allowing things to sometimes go wrong on the grounds of > an irrelevant hardware feature doesn't seem correct :/ There is 0 value in trying to prevent the guest kernel from shooting itself in the foot. There are so many other ways it can do it that I fail the point of even attempting it here. In addition, this actually harms performance on some devices. There are cases where the MSI-X table shares a page with other registrers that are used during normal device operation. This is especially problematic on architectures such as powerpc that use 64K pages. Those devices thus suffer a massive performance loss, for the sake of something that never happens in practice (especially on pseries where the MSI configuration is done by paravirt calls, thus by qemu itself). Cheers, Ben.