All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Jacob Shin <jacob.shin@amd.com>,
	Sander Eikelenboom <linux@eikelenboom.it>
Subject: Re: [PATCH] AMD IOMMU: also allocate IRTEs for HPET MSI
Date: Mon, 26 Aug 2013 20:21:11 -0500	[thread overview]
Message-ID: <521BFF07.7060406@amd.com> (raw)
In-Reply-To: <521B804C02000078000EE70F@nat28.tlf.novell.com>

Jan,

I have been trying to test out this patch.  Somehow, I could not get Xen 
boot option to exercise the code path.  What boot configuration are you 
using to test this?

I'm currently using option

"loglvl=all loglvl_guest=all cpuidle cpufreq=xen debug lapic=debug 
iommu=on,debug,verbose,amd-iommu-debug apic_verbosity=debug apic=debug"

I already double check the IVRS table on my system and it looks 
correct.  Am I missing something here?

Thanks,

Suravee.

On 8/26/2013 9:20 AM, Jan Beulich wrote:
> Omitting this was a blatant oversight of mine in commit 2ca9fbd7 ("AMD
> IOMMU: allocate IRTE entries instead of using a static mapping").
>
> This also changes a bogus inequality check into a sensible one, even
> though it is already known that this will make HPET MSI unusable on
> certain systems (having respective broken firmware). This, however,
> seems better than failing on systems with consistent ACPI tables.
>
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/drivers/passthrough/amd/iommu_intr.c
> +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> @@ -595,14 +595,31 @@ void* __init amd_iommu_alloc_intremap_ta
>   
>   int __init amd_setup_hpet_msi(struct msi_desc *msi_desc)
>   {
> -    if ( (!msi_desc->hpet_id != hpet_sbdf.id) ||
> -         (hpet_sbdf.iommu == NULL) )
> +    spinlock_t *lock;
> +    unsigned long flags;
> +    int rc = 0;
> +
> +    if ( msi_desc->hpet_id != hpet_sbdf.id || !hpet_sbdf.iommu )
>       {
> -        AMD_IOMMU_DEBUG("Fail to setup HPET MSI remapping\n");
> -        return 1;
> +        AMD_IOMMU_DEBUG("Failed to setup HPET MSI remapping: %s\n",
> +                        hpet_sbdf.iommu ? "Wrong HPET" : "No IOMMU");
> +        return -ENODEV;
>       }
>   
> -    return 0;
> +    lock = get_intremap_lock(hpet_sbdf.seg, hpet_sbdf.bdf);
> +    spin_lock_irqsave(lock, flags);
> +
> +    msi_desc->remap_index = alloc_intremap_entry(hpet_sbdf.seg,
> +                                                 hpet_sbdf.bdf, 1);
> +    if ( msi_desc->remap_index >= INTREMAP_ENTRIES )
> +    {
> +        msi_desc->remap_index = -1;
> +        rc = -ENXIO;
> +    }
> +
> +    spin_unlock_irqrestore(lock, flags);
> +
> +    return rc;
>   }
>   
>   static void dump_intremap_table(const u32 *table)
>
>
>

  reply	other threads:[~2013-08-27  1:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 14:20 [PATCH] AMD IOMMU: also allocate IRTEs for HPET MSI Jan Beulich
2013-08-27  1:21 ` Suravee Suthikulpanit [this message]
2013-08-27  6:41   ` Jan Beulich
2013-08-27 19:06     ` Suravee Suthikulanit
2013-08-28  7:43       ` 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=521BFF07.7060406@amd.com \
    --to=suravee.suthikulpanit@amd.com \
    --cc=JBeulich@suse.com \
    --cc=jacob.shin@amd.com \
    --cc=linux@eikelenboom.it \
    --cc=xen-devel@lists.xenproject.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.