From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] KVM: Fix PCI header check on device assignment Date: Fri, 15 Jun 2012 10:44:33 -0300 Message-ID: <20120615134433.GA16030@amt.cnet> References: <4FCDC54B.1020605@siemens.com> <1339703308.24818.69.camel@ul30vt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kiszka , Avi Kivity , kvm , vedun@ispras.ru To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:2990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755713Ab2FONpJ (ORCPT ); Fri, 15 Jun 2012 09:45:09 -0400 Content-Disposition: inline In-Reply-To: <1339703308.24818.69.camel@ul30vt> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jun 14, 2012 at 01:48:28PM -0600, Alex Williamson wrote: > Avi, Marcelo, > > Can we get this in for 3.5 please? There's already an ack from me on > the list. Thanks, > > Alex Can you bounce it to me please ? > On Tue, 2012-06-05 at 10:37 +0200, Jan Kiszka wrote: > > The masking was wrong (must have been 0x7f), and there is no need to > > re-read the value as pci_setup_device already does this for us. > > > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=43339 > > Signed-off-by: Jan Kiszka > > --- > > virt/kvm/assigned-dev.c | 4 +--- > > 1 files changed, 1 insertions(+), 3 deletions(-) > > > > diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c > > index 01f572c..b1e091a 100644 > > --- a/virt/kvm/assigned-dev.c > > +++ b/virt/kvm/assigned-dev.c > > @@ -635,7 +635,6 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, > > int r = 0, idx; > > struct kvm_assigned_dev_kernel *match; > > struct pci_dev *dev; > > - u8 header_type; > > > > if (!(assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU)) > > return -EINVAL; > > @@ -668,8 +667,7 @@ static int kvm_vm_ioctl_assign_device(struct kvm *kvm, > > } > > > > /* Don't allow bridges to be assigned */ > > - pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type); > > - if ((header_type & PCI_HEADER_TYPE) != PCI_HEADER_TYPE_NORMAL) { > > + if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL) { > > r = -EPERM; > > goto out_put; > > } > > > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html