public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>, Avi Kivity <avi@redhat.com>,
	kvm <kvm@vger.kernel.org>,
	vedun@ispras.ru
Subject: Re: [PATCH] KVM: Fix PCI header check on device assignment
Date: Fri, 15 Jun 2012 10:44:33 -0300	[thread overview]
Message-ID: <20120615134433.GA16030@amt.cnet> (raw)
In-Reply-To: <1339703308.24818.69.camel@ul30vt>

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 <jan.kiszka@siemens.com>
> > ---
> >  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

  reply	other threads:[~2012-06-15 13:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  8:37 [PATCH] KVM: Fix PCI header check on device assignment Jan Kiszka
2012-06-05 17:13 ` Alex Williamson
2012-06-06 11:12   ` Avi Kivity
2012-06-06 11:18     ` Jan Kiszka
2012-06-06 12:50       ` Alex Williamson
2012-06-14 19:48 ` Alex Williamson
2012-06-15 13:44   ` Marcelo Tosatti [this message]
2012-06-16  2:22 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120615134433.GA16030@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=vedun@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox