From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC PATCH v5 0/5] vfio-pci: Add support for mmapping MSI-X table Date: Tue, 15 Aug 2017 15:42:31 +1000 Message-ID: <1502775751.4493.47.camel@kernel.crashing.org> References: <20170807072548.3023-1-aik@ozlabs.ru> <8f5f7b82-3c10-7f39-b587-db4c4424f04c@ozlabs.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Vlad Tsyrklevich , Kyle Mahlkuch , Kirti Wankhede , kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Yongji Xie , Mauricio Faria de Oliveira , Paul Mackerras , Bjorn Helgaas , Arvind Yadav , David Woodhouse , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Gibson To: Robin Murphy , Alexey Kardashevskiy , linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: kvm.vger.kernel.org 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.