From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v2 4/4] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Date: Tue, 02 Nov 2010 20:58:36 +0100 Message-ID: <4CD06D6C.3030009@web.de> References: <70406157f1f29ade425369f82310a3963f0d0e97.1288712958.git.jan.kiszka@siemens.com> <20101102174149.GC1304@redhat.com> <4CD050BE.5010703@siemens.com> <20101102182401.GB1939@redhat.com> <4CD05B2E.1050005@siemens.com> <4CD05CF5.1040203@siemens.com> <4CD05DBB.5010005@siemens.com> <20101102185428.GD2341@redhat.com> <4CD066D1.4050803@siemens.com> <20101102195307.GB3228@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF510A012B46DB142148038A8" Cc: Avi Kivity , Marcelo Tosatti , kvm , Alex Williamson To: "Michael S. Tsirkin" Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:51619 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298Ab0KBT6k (ORCPT ); Tue, 2 Nov 2010 15:58:40 -0400 In-Reply-To: <20101102195307.GB3228@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF510A012B46DB142148038A8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 02.11.2010 20:53, Michael S. Tsirkin wrote: > On Tue, Nov 02, 2010 at 08:30:25PM +0100, Jan Kiszka wrote: >> Am 02.11.2010 19:54, Michael S. Tsirkin wrote: >>> On Tue, Nov 02, 2010 at 07:51:39PM +0100, Jan Kiszka wrote: >>>> Am 02.11.2010 19:48, Jan Kiszka wrote: >>>>> Am 02.11.2010 19:40, Jan Kiszka wrote: >>>>>>>>>> @@ -199,6 +343,13 @@ static void kvm_free_assigned_device(stru= ct kvm *kvm, >>>>>>>>>> =20 >>>>>>>>>> pci_reset_function(assigned_dev->dev); >>>>>>>>>> =20 >>>>>>>>>> + /* >>>>>>>>>> + * Unmask the IRQ at PCI level once the reset is done - the = next user >>>>>>>>>> + * may not expect the IRQ being masked. >>>>>>>>>> + */ >>>>>>>>>> + if (assigned_dev->pci_2_3) >>>>>>>>>> + pci_2_3_irq_unmask(assigned_dev->dev); >>>>>>>>>> + >>>>>>>>> >>>>>>>>> Doesn't pci_reset_function clear mask bit? It seems to ... >>>>>>>> >>>>>>>> I was left with non-functional devices for the host here if I wa= s not >>>>>>>> doing this. Need to recheck, but I think it was required. >>>>>>> >>>>>>> Interesting. Could you check why please? >>>>>>> >>>>>> >>>>>> Can't reproduce anymore. This was early code, maybe affected by so= me >>>>>> bits or buts that no longer exist. >>>>>> >>>>>> Spec says it's cleared on reset, so I removed those lines now. >>>>>> >>>>> >>>>> Hmpf, it just happened again: Guest was using my ath9k, I killed th= e >>>>> guest, lspci says DisINTx+. Strange. Is anyone (qemu) restoring the= >>>>> config space after the reset, bringing the disable bit back? >>>> >>>> Or does the kernel cache the control word? >>>> >>>> Jan >>> >>> Maybe it does, need to dig in drivers/pci. If it does this >>> might have other implications. >> >> OK, that mystery is resolved now: pci_reset_function saves & restores >> the device state. >> >> Jan >=20 > Aha. I wonder what other state we need to clear. >=20 Maybe just save/restore before/after assigning the device? Jan --------------enigF510A012B46DB142148038A8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkzQbWwACgkQitSsb3rl5xS7uwCgpZL16g1EpqyroJMQtgn1Wfej 81wAoLKXqter5srHE+wtqy4ylLaGS/Er =3ZUW -----END PGP SIGNATURE----- --------------enigF510A012B46DB142148038A8--