[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification
From: |
David Kiarie |
Subject: |
Re: [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification |
Date: |
Mon, 12 Sep 2016 14:12:48 +0300 |
On Mon, Sep 12, 2016 at 2:09 PM, Peter Xu <address@hidden> 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 <address@hidden>
> 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
>
- [Qemu-devel] [v4 0/6] AMD IOMMU Interrupt remapping, David Kiarie, 2016/09/12
- [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification, David Kiarie, 2016/09/12
- [Qemu-devel] [v4 3/6] hw/iommu: Prepare for AMD IOMMU interrupt remapping, David Kiarie, 2016/09/12
- [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, David Kiarie, 2016/09/12
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, Peter Xu, 2016/09/12
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, David Kiarie, 2016/09/12
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, Peter Xu, 2016/09/12
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, David Kiarie, 2016/09/12
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, Peter Xu, 2016/09/13
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, Michael S. Tsirkin, 2016/09/13
- Re: [Qemu-devel] [v4 4/6] hw/iommu: AMD IOMMU interrupt remapping, Michael S. Tsirkin, 2016/09/13