lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Aug 2015 08:46:27 +0000
From:	"Xiao, Nan (Nan@...ervers-Core-OE-PSC)" <nan.xiao@...com>
To:	"joro@...tes.org" <joro@...tes.org>
CC:	"dwmw2@...radead.org" <dwmw2@...radead.org>,
	"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] Fix bug in iommu_context_addr: Always get pointer to
 lower extended-context-table

Hi Joerg,

Yes, your patch is simple and better!

Best Regards
Nan Xiao

-----Original Message-----
From: joro@...tes.org [mailto:joro@...tes.org] 
Sent: Tuesday, August 25, 2015 4:42 PM
To: Xiao, Nan (Nan@...ervers-Core-OE-PSC)
Cc: dwmw2@...radead.org; iommu@...ts.linux-foundation.org; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

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 {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ