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

Re: [Xen-devel] [v7][RFC][PATCH 06/13] hvmloader/ram: check if guest memory is out of reserved device memory maps



So without lookuping devices[i], how can we call func() for each sbdf as
you mentioned?

You've got both rmrr and bdf in the body of for_each_rmrr_device().
After all - as I said - you just open-coded it.


Yeah, so change this again,

int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
{
    struct acpi_rmrr_unit *rmrr;
    int rc = 0;
    unsigned int i;
    u16 bdf;

    for_each_rmrr_device ( rmrr, bdf, i )
    {
        rc = func(PFN_DOWN(rmrr->base_address),
                           PFN_UP(rmrr->end_address) -
                            PFN_DOWN(rmrr->base_address),
                           PCI_SBDF(rmrr->segment, bdf),
                          ctxt);
        /* Hit this entry so just go next. */
        if ( rc == 1 )
            i = rmrr->scope.devices_cnt;
        else if ( rc < 0 )
            return rc;
    }

    return rc;
}

Thanks
Tiejun

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.