From mboxrd@z Thu Jan 1 00:00:00 1970 From: Binarus Subject: Re: Unable to pass SATA controller to VM with intel_iommu=igfx_off Date: Tue, 9 Jan 2018 18:58:13 +0100 Message-ID: <2585b655-2861-b80f-a4ce-cc553c6466bb@binarus.de> References: <20180106232258.50fc60f9@w520.home> <0ccfd587-aafd-af45-4fd0-fd10852c4038@binarus.de> <20180108151932.23bb70ea@t450s.home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Alex Williamson Return-path: Received: from achilles.binarus.de ([176.9.5.60]:60814 "EHLO achilles.binarus.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934646AbeAIR6S (ORCPT ); Tue, 9 Jan 2018 12:58:18 -0500 In-Reply-To: <20180108151932.23bb70ea@t450s.home> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: At first, thank you very much! On 08.01.2018 23:19, Alex Williamson wrote: > We already have quirks to support various other versions of the Marvell > chip, but the 9128 is missing, so it's just a couple lines to add it. > This is against v4.9.75: > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 98eba9127a0b..19ca3c9fac3a 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -3868,6 +3868,8 @@ static void quirk_dma_func1_alias(struct pci_dev *dev) > /* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c49 */ > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9230, > quirk_dma_func1_alias); > +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9128, > + quirk_dma_func1_alias); > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TTI, 0x0642, > quirk_dma_func1_alias); > /* https://bugs.gentoo.org/show_bug.cgi?id=497630 */ There is good news, and there is bad news: The good news is that the patch works as expected. I have applied it to kernel 4.9 and recompiled the kernel (which was not that easy for me because this machine boots from ZFS, so beware of forgetting to recompile and correctly include the ZFS modules as well into the new kernel / initramfs ...). I then have booted the new kernel with intel_iommu=on. The boot process went normally - the AHCI / SATA driver now is behaving correctly when initializing the controller in question. I then have configured my system to let the vfio_pci kernel driver grab that controller during the boot process, and have made sure that vfio_pci gets loaded before the AHCI kernel driver. That also worked well; dmesg |grep vfio was showing the expected output, and lspci was showing that the controller indeed was under control of vfio_pci. But I couldn't get any further, and this is the bad news: I have spent the rest of my day with trying to actually pass through the controller to the VM in question. I am starting this VM by command line: qemu_xxx