xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Wang <wei.wang2@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: keir@xen.org, xen-devel@lists.xensource.com,
	Ian.Jackson@eu.citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH] amd iommu: Fix a return value of guest_iommu_set_base()
Date: Mon, 6 Feb 2012 13:29:33 +0100	[thread overview]
Message-ID: <4F2FC7AD.5080300@amd.com> (raw)
In-Reply-To: <4F2C1ADC0200007800071232@nat28.tlf.novell.com>

On 02/03/2012 05:35 PM, Jan Beulich wrote:
>>>> On 03.02.12 at 16:29, Wei Wang<wei.wang2@amd.com>  wrote:
>> # HG changeset patch
>> # User Wei Wang<wei.wang2@amd.com>
>> # Date 1328282938 -3600
>> # Node ID 58a2281581a4c4171ca52549b3e8062b9733ec2b
>> # Parent  3432abcf9380d3840ca38439a304f74a37d155fc
>> amd iommu: Fix a return value of guest_iommu_set_base()
>> Remove a unnecessary check in guest_iommu_destroy()
>>
>> Signed-off-by: Wei Wang<wei.wang2@amd.com>
>>
>> diff -r 3432abcf9380 -r 58a2281581a4 xen/drivers/passthrough/amd/iommu_guest.c
>> --- a/xen/drivers/passthrough/amd/iommu_guest.c	Thu Feb 02 15:47:26 2012 +0000
>> +++ b/xen/drivers/passthrough/amd/iommu_guest.c	Fri Feb 03 16:28:58 2012
>> +0100
>> @@ -806,7 +806,7 @@ int guest_iommu_set_base(struct domain *
>>       struct guest_iommu *iommu = domain_iommu(d);
>>
>>       if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
>> -        return 0;
>> +        return -EACCES;
>
> But as indicated before, all three checks above are redundant with
> the one check below. Hence I suggested to remove the checks above,
> and if you wish put an ASSERT() past the !iommu check below.

OK,then I remove them all. I will send a new thread for the patch.
Thanks,
Wei

> Jan
>
>>
>>       if ( !iommu )
>>           return -EACCES;
>> @@ -896,9 +896,6 @@ void guest_iommu_destroy(struct domain *
>>   {
>>       struct guest_iommu *iommu;
>>
>> -    if ( !is_hvm_domain(d) || !iommu_enabled || !iommuv2_enabled )
>> -        return;
>> -
>>       iommu = domain_iommu(d);
>>       if ( !iommu )
>>           return;
>
>
>
>

      reply	other threads:[~2012-02-06 12:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 15:29 [PATCH] amd iommu: Fix a return value of guest_iommu_set_base() Wei Wang
2012-02-03 16:35 ` Jan Beulich
2012-02-06 12:29   ` Wei Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F2FC7AD.5080300@amd.com \
    --to=wei.wang2@amd.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).