qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification


From: Peter Xu
Subject: Re: [Qemu-devel] [v4 2/6] hw/i386: enforce SID verification
Date: Mon, 12 Sep 2016 19:09:25 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

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.

Thanks,

-- peterx



reply via email to

[Prev in Thread] Current Thread [Next in Thread]