All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	stable@kernel.org
Subject: Re: [PATCH] x86: amd_iommu: fix nasty bug that caused ILLEGAL_DEVICE_TABLE_ENTRY errors
Date: Thu, 16 Oct 2008 16:59:56 +0200	[thread overview]
Message-ID: <20081016145956.GA29705@8bytes.org> (raw)
In-Reply-To: <20081016142736.GN4706@alberich.amd.com>

Argh. Very stupid bug. This explains why it worked on my system with 1G
RAM and failed on some others with more. Thanks for the fix. I also CC
stable@kernel.org.

On Thu, Oct 16, 2008 at 04:27:36PM +0200, Andreas Herrmann wrote:
> We are on 64-bit so better use u64 instead of u32 to deal with
> addresses:
> 
> static void __init iommu_set_device_table(struct amd_iommu *iommu)
> {
>         u64 entry;
>   ...
>         entry = virt_to_phys(amd_iommu_dev_table);
>   ...
> 
> (I am wondering why gcc 4.2.x did not warn about the assignment
> between u32 and unsigned long.)
> 
> Cc: iommu@lists.linux-foundation.org
> Cc: Joerg Roedel <joerg.roedel@amd.com>
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

> 
> ---
>  arch/x86/kernel/amd_iommu_init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Patch is against today's tip/x86/amd-iommu
> Joerg is on vacation. That is why I post this patch
> directly to you.
> 
> Regards,
> 
> Andreas
> 
> diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
> index a69cc0f..bccd0ef 100644
> --- a/arch/x86/kernel/amd_iommu_init.c
> +++ b/arch/x86/kernel/amd_iommu_init.c
> @@ -210,7 +210,7 @@ static void __init iommu_set_exclusion_range(struct amd_iommu *iommu)
>  /* Programs the physical address of the device table into the IOMMU hardware */
>  static void __init iommu_set_device_table(struct amd_iommu *iommu)
>  {
> -	u32 entry;
> +	u64 entry;
>  
>  	BUG_ON(iommu->mmio_base == NULL);
>  
> -- 
> 1.6.0.2
> 
> 
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/iommu

  reply	other threads:[~2008-10-16 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 14:27 [PATCH] x86: amd_iommu: fix nasty bug that caused ILLEGAL_DEVICE_TABLE_ENTRY errors Andreas Herrmann
2008-10-16 14:59 ` Joerg Roedel [this message]
2008-10-20 16:06   ` Ingo Molnar

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=20081016145956.GA29705@8bytes.org \
    --to=joro@8bytes.org \
    --cc=andreas.herrmann3@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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.