From: "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org" <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: "Xiao, Nan (Nan@HPS Performance,
Beijing)" <nan.xiao-VXdhtT5mjnY@public.gmane.org>
Cc: "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org"
<dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table
Date: Tue, 25 Aug 2015 10:42:08 +0200 [thread overview]
Message-ID: <20150825084208.GB32055@8bytes.org> (raw)
In-Reply-To: <F9D82F0D71C0024FA18FE771EDDAF149081FAC8F-qhK1pdpzgV8SZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
Hi Nan,
On Mon, Aug 24, 2015 at 06:26:33AM +0000, Xiao, Nan (Nan@HPS Performance, Beijing) wrote:
> drivers/iommu/intel-iommu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 0649b94..4213598 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -759,10 +759,11 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
> if (devfn >= 0x80) {
> devfn -= 0x80;
> entry = &root->hi;
> - }
> + } else
> + entry = &root->lo;
> devfn *= 2;
> - }
> - entry = &root->lo;
> + } else
> + entry = &root->lo;
> if (*entry & 1)
> context = phys_to_virt(*entry & VTD_PAGE_MASK);
> else {
Shouldn't this diff have the same effect?
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0649b94..7553cb9 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -755,6 +755,7 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
struct context_entry *context;
u64 *entry;
+ entry = &root->lo;
if (ecs_enabled(iommu)) {
if (devfn >= 0x80) {
devfn -= 0x80;
@@ -762,7 +763,6 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
}
devfn *= 2;
}
- entry = &root->lo;
if (*entry & 1)
context = phys_to_virt(*entry & VTD_PAGE_MASK);
else {
WARNING: multiple messages have this Message-ID (diff)
From: "joro@8bytes.org" <joro@8bytes.org>
To: "Xiao, Nan (Nan@HPS Performance, Beijing)" <nan.xiao@hp.com>
Cc: "dwmw2@infradead.org" <dwmw2@infradead.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table
Date: Tue, 25 Aug 2015 10:42:08 +0200 [thread overview]
Message-ID: <20150825084208.GB32055@8bytes.org> (raw)
In-Reply-To: <F9D82F0D71C0024FA18FE771EDDAF149081FAC8F@G4W3303.americas.hpqcorp.net>
Hi Nan,
On Mon, Aug 24, 2015 at 06:26:33AM +0000, Xiao, Nan (Nan@HPS Performance, Beijing) wrote:
> drivers/iommu/intel-iommu.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
> index 0649b94..4213598 100644
> --- a/drivers/iommu/intel-iommu.c
> +++ b/drivers/iommu/intel-iommu.c
> @@ -759,10 +759,11 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
> if (devfn >= 0x80) {
> devfn -= 0x80;
> entry = &root->hi;
> - }
> + } else
> + entry = &root->lo;
> devfn *= 2;
> - }
> - entry = &root->lo;
> + } else
> + entry = &root->lo;
> if (*entry & 1)
> context = phys_to_virt(*entry & VTD_PAGE_MASK);
> else {
Shouldn't this diff have the same effect?
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0649b94..7553cb9 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -755,6 +755,7 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
struct context_entry *context;
u64 *entry;
+ entry = &root->lo;
if (ecs_enabled(iommu)) {
if (devfn >= 0x80) {
devfn -= 0x80;
@@ -762,7 +763,6 @@ static inline struct context_entry *iommu_context_addr(struct intel_iommu *iommu
}
devfn *= 2;
}
- entry = &root->lo;
if (*entry & 1)
context = phys_to_virt(*entry & VTD_PAGE_MASK);
else {
next prev parent reply other threads:[~2015-08-25 8:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-24 6:26 [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table Xiao, Nan (Nan@HPS Performance, Beijing)
[not found] ` <F9D82F0D71C0024FA18FE771EDDAF149081FAC8F-qhK1pdpzgV8SZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
2015-08-25 8:42 ` joro-zLv9SwRftAIdnm+yROfE0A [this message]
2015-08-25 8:42 ` joro
[not found] ` <20150825084208.GB32055-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-08-25 8:46 ` Xiao, Nan (Nan@HPservers-Core-OE-PSC)
2015-08-25 8:46 ` Xiao, Nan (Nan@HPservers-Core-OE-PSC)
[not found] ` <F9D82F0D71C0024FA18FE771EDDAF149082020ED-aJCdeS5/g6oSZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
2015-08-25 8:59 ` joro-zLv9SwRftAIdnm+yROfE0A
2015-08-25 8:59 ` joro
[not found] ` <20150825085937.GD32055-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-08-25 9:15 ` Xiao, Nan (Nan@HPservers-Core-OE-PSC)
2015-08-25 9:15 ` Xiao, Nan (Nan@HPservers-Core-OE-PSC)
2015-08-25 9:42 ` joro
-- strict thread matches above, loose matches on Subject: below --
2015-08-21 10:32 Nan Xiao
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=20150825084208.GB32055@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=nan.xiao-VXdhtT5mjnY@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.