Re: [PATCH v3 7/7] iommu/vt-d: Differentiate relaxable and non relaxable RMRRs
From: Auger Eric
Date: Fri May 17 2019 - 03:10:10 EST
Hi Lu,
On 5/17/19 6:46 AM, Lu Baolu wrote:
> Hi Eric,
>
> On 5/16/19 6:08 PM, Eric Auger wrote:
>> Now we have a new IOMMU_RESV_DIRECT_RELAXABLE reserved memory
>> region type, let's report USB and GFX RMRRs as relaxable ones.
>>
>> This allows to have a finer reporting at IOMMU API level of
>> reserved memory regions. This will be exploitable by VFIO to
>> define the usable IOVA range and detect potential conflicts
>> between the guest physical address space and host reserved
>> regions.
>>
>> Signed-off-by: Eric Auger <eric.auger@xxxxxxxxxx>
>> ---
>> Â drivers/iommu/intel-iommu.c | 10 ++++++++--
>> Â 1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
>> index a36604f4900f..af1d65fdedfc 100644
>> --- a/drivers/iommu/intel-iommu.c
>> +++ b/drivers/iommu/intel-iommu.c
>> @@ -5493,7 +5493,9 @@ static void intel_iommu_get_resv_regions(struct
>> device *device,
>> ÂÂÂÂÂ for_each_rmrr_units(rmrr) {
>> ÂÂÂÂÂÂÂÂÂ for_each_active_dev_scope(rmrr->devices, rmrr->devices_cnt,
>> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ i, i_dev) {
>> +ÂÂÂÂÂÂÂÂÂÂÂ struct pci_dev *pdev = to_pci_dev(device);
>
> Probably should be:
>
> struct pci_dev *pdev = dev_is_pci(device) ? to_pci_dev(device) : NULL;
That's correct. I will fix that asap.
Thanks!
Eric
>
> Best regards,
> Lu Baolu
>