WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3 of 7] IOMMU: Sanitise pointer work

To: Keir Fraser <keir.xen@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3 of 7] IOMMU: Sanitise pointer work
From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Date: Tue, 14 Jun 2011 10:53:53 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 14 Jun 2011 02:54:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CA1C11D7.1C1A0%keir.xen@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CA1C11D7.1C1A0%keir.xen@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

On 13/06/11 19:13, Keir Fraser wrote:
> On 13/06/2011 18:02, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote:
>
>> Check for null pointers before calling function pointers.
> But they're never NULL? This one's a bit pointless.
>
>  -- Keir
>
This patch was a direct result of comments regarding my previous attempt
to make a crash_shutdown iommu_op.  Are we happy to assume that noone in
the future is going to partially implement an iommu_ops structure?

~Andrew
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>
>> diff -r 1c3d2e4d06fe -r 68efd418b6f1 xen/drivers/passthrough/iommu.c
>> --- a/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100
>> +++ b/xen/drivers/passthrough/iommu.c Mon Jun 13 17:45:43 2011 +0100
>> @@ -407,17 +407,17 @@ unsigned int iommu_read_apic_from_ire(un
>>      return ops->read_apic_from_ire(apic, reg);
>>  }
>>  
>> -void iommu_resume()
>> +void iommu_resume(void)
>>  {
>>      const struct iommu_ops *ops = iommu_get_ops();
>> -    if ( iommu_enabled )
>> +    if ( iommu_enabled && ops && ops->resume )
>>          ops->resume();
>>  }
>>  
>> -void iommu_suspend()
>> +void iommu_suspend(void)
>>  {
>>      const struct iommu_ops *ops = iommu_get_ops();
>> -    if ( iommu_enabled )
>> +    if ( iommu_enabled && ops && ops->suspend )
>>          ops->suspend();
>>  }
>>  
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
>

-- 
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>