All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yang, Xiaowei" <xiaowei.yang@intel.com>
To: Espen Skoglund <espen.skoglund@netronome.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] VT-d: IOTLB flush fixups
Date: Thu, 29 May 2008 12:13:31 +0800	[thread overview]
Message-ID: <1212034412.4871.6.camel@ip6-localhost> (raw)
In-Reply-To: <18493.29570.845303.113043@gargle.gargle.HOWL>

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

On Wed, 2008-05-28 at 23:00 +0800, Espen Skoglund wrote:

> Oh, right.  When flushing a non-present cached entry domid 0 must be
> used.  Here's a modification of your patch:
> 
>  - Made the non-present flush testing a bit simpler.
>  - Removed dma_addr_level_page_maddr().  Use a modified
>    addr_to_dma_page_maddr() instead.
Yes, it's simpler. Thanks! However, you forgot spin_unlock before
return. so it leads to deadlock. Here's a small fix.

>  - Upon mapping new context entry: flush old entry using domid 0 and
>    always flush iotlb.
Actually, you may find before/after your modification, the code are the
same functionally. We can pass domid=0 or non_present_entry_flush=1 to
flush non present tlb.

Thanks,
Xiaowei
> 


[-- Attachment #2: spin.patch --]
[-- Type: text/x-patch, Size: 797 bytes --]

diff -r f681c4de91fc xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed May 28 16:14:10 2008 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c	Thu May 29 03:48:33 2008 +0800
@@ -212,10 +212,10 @@ static u64 addr_to_dma_page_maddr(struct
     if ( hd->pgd_maddr == 0 )
     {
         if ( !alloc )
-            return 0;
+            goto out;
         hd->pgd_maddr = alloc_pgtable_maddr();
         if ( hd->pgd_maddr == 0 )
-            return 0;
+            goto out;
     }
 
     parent = (struct dma_pte *)map_vtd_domain_page(hd->pgd_maddr);
@@ -263,6 +263,7 @@ static u64 addr_to_dma_page_maddr(struct
     }
 
     unmap_vtd_domain_page(parent);
+ out:
     spin_unlock_irqrestore(&hd->mapping_lock, flags);
     return pte_maddr;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2008-05-29  4:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1211950777.17461.0.camel@ip6-localhost>
2008-05-28  9:01 ` [PATCH] VT-d: IOTLB flush fixups Yang, Xiaowei
     [not found] ` <1211965013.16052.16.camel@ip6-localhost>
2008-05-28 15:00   ` Espen Skoglund
2008-05-29  4:13     ` Yang, Xiaowei [this message]
2008-05-27 16:21 Espen Skoglund

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=1212034412.4871.6.camel@ip6-localhost \
    --to=xiaowei.yang@intel.com \
    --cc=espen.skoglund@netronome.com \
    --cc=xen-devel@lists.xensource.com \
    /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.