From: Malcolm Crossley <malcolm.crossley@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: kevin.tian@intel.com, andrew.cooper3@citrix.com,
xen-devel@lists.xen.org, paul.durrant@citrix.com,
Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com,
yang.z.zhang@intel.com
Subject: Re: [PATCH v3] IOMMU: Prevent VT-d device IOTLB operations on wrong IOMMU
Date: Wed, 18 Jun 2014 11:24:28 +0100 [thread overview]
Message-ID: <53A168DC.1040805@citrix.com> (raw)
In-Reply-To: <53A1756C02000078000B697C@mail.emea.novell.com>
On 18/06/14 11:18, Jan Beulich wrote:
>>>> Malcolm Crossley <malcolm.crossley@citrix.com> 06/17/14 6:15 PM >>>
>> On 17/06/14 16:06, Jan Beulich wrote:
>>>>>> On 17.06.14 at 16:37, <malcolm.crossley@citrix.com> wrote:
>>>> --- a/xen/drivers/passthrough/vtd/x86/ats.c
>>>> +++ b/xen/drivers/passthrough/vtd/x86/ats.c
>>>> @@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *i
>>>> {
>>>> sid = (pdev->bus << 8) | pdev->devfn;
>>>>
>>>> + /* Only invalidate devices that belong to this IOMMU */
>>>> + if ( !pdev->iommu || pdev->iommu != iommu )
>>>> + continue;
>>>
>>> I meant to ask before and then forgot: What is the first half of this
>>> condition good/needed for?
>>>
>> Defensive coding to prevent a NULL pointer deference if the Intel or
>> core ATS code goes wrong.
>
> But there is no de-reference of the pointer anywhere - you added it just as
> a token for comparison purposes. If pdev->iommu was NULL, the right side
> comparison should still produce "false"...
>
Your right, I'm going crazy and thinking I'm dereferencing the IOMMU
pointer when I'm not. (A non submitted version of the code was looking
at the index field of struct IOMMU) Do you want me to resubmit an
updated patch or are you happy to fix it up on commit?
Malcolm
> Jan
>
next prev parent reply other threads:[~2014-06-18 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-17 14:37 [PATCH v3] IOMMU: Prevent VT-d device IOTLB operations on wrong IOMMU Malcolm Crossley
2014-06-17 15:06 ` Jan Beulich
2014-06-17 16:15 ` Malcolm Crossley
2014-06-18 10:18 ` Jan Beulich
2014-06-18 10:24 ` Malcolm Crossley [this message]
2014-06-18 10:36 ` Jan Beulich
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=53A168DC.1040805@citrix.com \
--to=malcolm.crossley@citrix.com \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=kevin.tian@intel.com \
--cc=paul.durrant@citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=xen-devel@lists.xen.org \
--cc=yang.z.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.