From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Xunlei Pang <xlpang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] iommu/vt-d: Fix the size calculation of pasid table
Date: Mon, 19 Sep 2016 14:18:27 +0200 [thread overview]
Message-ID: <20160919121827.GB3541@8bytes.org> (raw)
In-Reply-To: <1473648551-10025-1-git-send-email-xlpang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[Cc'ing David]
On Mon, Sep 12, 2016 at 10:49:11AM +0800, Xunlei Pang wrote:
> According to the vt-d spec, the size of pasid (state) entry is 8B
> which equals 3 in power of 2, the number of pasid (state) entries
> is (ecap_pss + 1) in power of 2.
>
> Thus the right size of pasid (state) table in power of 2 should be
> ecap_pss(iommu->ecap) plus "1+3=4" other than 7.
>
> Signed-off-by: Xunlei Pang <xlpang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/iommu/intel-svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
> index 8ebb353..cfa75c2 100644
> --- a/drivers/iommu/intel-svm.c
> +++ b/drivers/iommu/intel-svm.c
> @@ -39,7 +39,7 @@ int intel_svm_alloc_pasid_tables(struct intel_iommu *iommu)
> struct page *pages;
> int order;
>
> - order = ecap_pss(iommu->ecap) + 7 - PAGE_SHIFT;
> + order = ecap_pss(iommu->ecap) + 4 - PAGE_SHIFT;
> if (order < 0)
> order = 0;
The patch seems to be correct, but I'll let David comment on it first.
Joerg
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Xunlei Pang <xlpang@redhat.com>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] iommu/vt-d: Fix the size calculation of pasid table
Date: Mon, 19 Sep 2016 14:18:27 +0200 [thread overview]
Message-ID: <20160919121827.GB3541@8bytes.org> (raw)
In-Reply-To: <1473648551-10025-1-git-send-email-xlpang@redhat.com>
[Cc'ing David]
On Mon, Sep 12, 2016 at 10:49:11AM +0800, Xunlei Pang wrote:
> According to the vt-d spec, the size of pasid (state) entry is 8B
> which equals 3 in power of 2, the number of pasid (state) entries
> is (ecap_pss + 1) in power of 2.
>
> Thus the right size of pasid (state) table in power of 2 should be
> ecap_pss(iommu->ecap) plus "1+3=4" other than 7.
>
> Signed-off-by: Xunlei Pang <xlpang@redhat.com>
> ---
> drivers/iommu/intel-svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c
> index 8ebb353..cfa75c2 100644
> --- a/drivers/iommu/intel-svm.c
> +++ b/drivers/iommu/intel-svm.c
> @@ -39,7 +39,7 @@ int intel_svm_alloc_pasid_tables(struct intel_iommu *iommu)
> struct page *pages;
> int order;
>
> - order = ecap_pss(iommu->ecap) + 7 - PAGE_SHIFT;
> + order = ecap_pss(iommu->ecap) + 4 - PAGE_SHIFT;
> if (order < 0)
> order = 0;
The patch seems to be correct, but I'll let David comment on it first.
Joerg
next prev parent reply other threads:[~2016-09-19 12:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 2:49 [PATCH] iommu/vt-d: Fix the size calculation of pasid table Xunlei Pang
[not found] ` <1473648551-10025-1-git-send-email-xlpang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-09-19 12:18 ` Joerg Roedel [this message]
2016-09-19 12:18 ` Joerg Roedel
[not found] ` <20160919121827.GB3541-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-10-10 13:00 ` Xunlei Pang
2016-10-10 13:00 ` Xunlei Pang
2016-10-12 12:17 ` David Woodhouse
2016-10-12 12:17 ` David Woodhouse
[not found] ` <1476274674.16627.173.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-10-30 12:18 ` David Woodhouse
2016-10-30 12:18 ` David Woodhouse
2016-10-31 11:30 ` Xunlei Pang
2016-11-10 10:45 ` Joerg Roedel
[not found] ` <20161110104544.GA2078-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2016-11-10 11:02 ` David Woodhouse
2016-11-10 11:02 ` David Woodhouse
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=20160919121827.GB3541@8bytes.org \
--to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=xlpang-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/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.