xen-devel
[Xen-devel] [PATCH 11/15] [swiotlb] Replace late_alloc with iommu_sw->pr
To: |
fujita.tomonori@xxxxxxxxxxxxx, alex.williamson@xxxxxx, joerg.roedel@xxxxxxx, dwmw2@xxxxxxxxxxxxx, chrisw@xxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx |
Subject: |
[Xen-devel] [PATCH 11/15] [swiotlb] Replace late_alloc with iommu_sw->priv usage. |
From: |
Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Date: |
Thu, 14 Jan 2010 18:01:00 -0500 |
Cc: |
Ian.Campbell@xxxxxxxxxxxxx, jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> |
Delivery-date: |
Thu, 14 Jan 2010 15:11:12 -0800 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1263510064-16788-11-git-send-email-konrad.wilk@xxxxxxxxxx> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<1263510064-16788-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-2-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-3-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-4-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-5-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-6-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-7-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-8-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-9-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-10-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-11-git-send-email-konrad.wilk@xxxxxxxxxx> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
We utilize the private placeholder to figure out whether
we are initialized late or early. Obviously the ->priv
can be expanded to point to a structure for more internal
data but for right now this all we need.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
lib/swiotlb.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 075b56c..20df588 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -103,8 +103,6 @@ static DEFINE_SPINLOCK(io_tlb_lock);
struct swiotlb_engine *iommu_sw;
EXPORT_SYMBOL(iommu_sw);
-static int late_alloc;
-
static int __init
setup_io_tlb_npages(char *str)
{
@@ -239,6 +237,8 @@ swiotlb_init_with_default_size(size_t default_size, int
verbose)
panic("Cannot allocate SWIOTLB overflow buffer!\n");
if (verbose)
swiotlb_print_info();
+
+ iommu_sw->priv = NULL;
}
static int swiotlb_release(struct swiotlb_engine *iotlb)
@@ -356,7 +356,10 @@ swiotlb_late_init_with_default_size(size_t default_size)
swiotlb_print_info();
- late_alloc = 1;
+ /* We utilize the private field to figure out whether we
+ * were allocated late or early.
+ */
+ iommu_sw->priv = (void *)1;
return 0;
@@ -382,7 +385,7 @@ void __init swiotlb_free(void)
if (!iommu_sw)
return;
- if (late_alloc) {
+ if (iommu_sw->priv) {
free_pages((unsigned long)iommu_sw->overflow_buffer,
get_order(iommu_sw->overflow));
free_pages((unsigned long)iommu_sw->orig_addr,
--
1.6.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 01/15] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order., (continued)
- [Xen-devel] [PATCH 01/15] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 02/15] [swiotlb] Add swiotlb_engine structure for tracking multiple software IO TLBs., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 03/15] [swiotlb] Add swiotlb_register_engine function., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 04/15] [swiotlb] Search and replace s/io_tlb/iommu_sw->/, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 05/15] [swiotlb] Respect the io_tlb_nslabs argument value., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 06/15] [swiotlb] In 'swiotlb_init' take advantage of the default swiotlb_engine support., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 08/15] [swiotlb] Add 'is_swiotlb_buffer' to the swiotlb_ops function decleration., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 09/15] [swiotlb] Add 'dma_capable' to the swiotlb_ops structure., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 10/15] [swiotlb] Replace the [phys, bus]->virt and virt->[bus, phys] functions with iommu_sw calls., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 11/15] [swiotlb] Replace late_alloc with iommu_sw->priv usage.,
Konrad Rzeszutek Wilk <=
- [Xen-devel] [PATCH 12/15] [swiotlb] Remove un-used static declerations obsoleted by iommu_sw., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 13/15] [swiotlb] Make io_tlb_nslabs visible outside lib/swiotlb.c and rename it., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 15/15] [swiotlb] Take advantage of iommu_sw->name and add %s to printk's., Konrad Rzeszutek Wilk
- [Xen-devel] Re: [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c, Chris Wright
- [Xen-devel] Re: [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c, Konrad Rzeszutek Wilk
- [Xen-devel] Re: [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c, Chris Wright
- [Xen-devel] Re: [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer., Chris Wright
- [Xen-devel] Re: [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer., Konrad Rzeszutek Wilk
- [Xen-devel] Re: [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer., Chris Wright
|
|
|