All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Kiarie <davidkiarie4@gmail.com>
To: Peter Xu <peterx@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Jan Kiszka <jan.kiszka@web.de>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	rkrcmar@redhat.com, Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification
Date: Mon, 12 Sep 2016 14:12:48 +0300	[thread overview]
Message-ID: <CABdVeADkbiKWBnf4x96RALjy546S6J5twuVq613j94ujhs1+HA@mail.gmail.com> (raw)
In-Reply-To: <20160912110925.GF3776@pxdev.xzpeter.org>

On Mon, Sep 12, 2016 at 2:09 PM, Peter Xu <peterx@redhat.com> wrote:

> On Mon, Sep 12, 2016 at 01:08:05PM +0300, David Kiarie wrote:
>
> [...]
>
> > @@ -2252,14 +2250,17 @@ static MemTxResult vtd_mem_ir_write(void
> *opaque, hwaddr addr,
> >  {
> >      int ret = 0;
> >      MSIMessage from = {}, to = {};
> > -    uint16_t sid = X86_IOMMU_SID_INVALID;
> > +    VTDAddressSpace *as = opaque;
> > +    uint16_t sid = PCI_BUILD_BDF(pci_bus_num(as->bus), as->devfn);
>
> I remembered to have commented on this... PCI_BUILD_BDF() should be
> problematic. SID may not be built that way when with PCI bridges (or
> say, I think current code won't work with PCI bridges). Please see
> commit:
>
>     commit 4a94b3aa6d97dfa67a20c7a0315c9773352f0e8e
>     Author: Peter Xu <peterx@redhat.com>
>     Date:   Tue May 17 19:26:10 2016 +0800
>
>         pci: fix pci_requester_id()
>
> That's why we explicitly differenciate BDF and SID.
>
> I would suggest to make it simpler: we just do not do this extra
> check, and pass attrs.requester_id to vtd_interrupt_remap_msi()

directly.
>

Yes, we did discuss this but didn't come up with a conclusion so I stuck
with the check.

I will remove the check in the next version.


> Thanks,
>
> -- peterx
>

  reply	other threads:[~2016-09-12 11:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 10:08 [Qemu-devel] [v4 0/6] AMD IOMMU Interrupt remapping David Kiarie
2016-09-12 10:08 ` [Qemu-devel] [v4 1/6] hw/msi: Allow platform devices to use explicit SID David Kiarie
2016-09-12 11:02   ` Peter Xu
2016-09-12 11:26     ` David Kiarie
2016-09-12 11:54       ` Peter Xu
2016-09-12 10:08 ` [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification David Kiarie
2016-09-12 11:09   ` Peter Xu
2016-09-12 11:12     ` David Kiarie [this message]
2016-09-12 11:13   ` Peter Xu
2016-09-12 10:08 ` [Qemu-devel] [v4 3/6] hw/iommu: Prepare for AMD IOMMU interrupt remapping David Kiarie
2016-09-12 10:08 ` [Qemu-devel] [v4 4/6] hw/iommu: " David Kiarie
2016-09-12 11:34   ` Peter Xu
2016-09-12 11:51     ` David Kiarie
2016-09-12 12:11       ` Peter Xu
2016-09-12 12:45         ` David Kiarie
2016-09-13  7:38           ` Peter Xu
2016-09-13 14:11             ` Michael S. Tsirkin
2016-09-13 14:13               ` Michael S. Tsirkin
2016-09-14 10:12             ` David Kiarie
2016-09-12 10:08 ` [Qemu-devel] [v4 5/6] hw/acpi: report IOAPIC on IVRS David Kiarie
2016-09-12 10:08 ` [Qemu-devel] [v4 6/6] hw/iommu: share common code between IOMMUs David Kiarie

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=CABdVeADkbiKWBnf4x96RALjy546S6J5twuVq613j94ujhs1+HA@mail.gmail.com \
    --to=davidkiarie4@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rkrcmar@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.