login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
25
Re: [PATCH] add iommu_num_pages helper function
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: FUJITA Tomonori
Subject:
Re: [PATCH] add iommu_num_pages helper function
Date: Friday, July 25, 2008 - 6:34 am
On Fri, 25 Jul 2008 15:21:21 +0200 Joerg Roedel <joerg.roedel@amd.com> wrote:
quoted text
> On Fri, Jul 25, 2008 at 10:15:06PM +0900, FUJITA Tomonori wrote: > > On Fri, 25 Jul 2008 14:57:58 +0200 > > Joerg Roedel <joerg.roedel@amd.com> wrote: > > > > > Calculating the number of pages from given address and length numbers is a task > > > required in multiple IOMMU implementations. So implement this as a generic > > > function into the IOMMU helper code. > > > > > > Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> > > > Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> > > > --- > > > include/linux/iommu-helper.h | 1 + > > > lib/iommu-helper.c | 8 ++++++++ > > > 2 files changed, 9 insertions(+), 0 deletions(-) > > > > Thanks. I planed to work on this after rc1. You beat me. :) > > > > > > > diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h > > > index c975caf..f8598f5 100644 > > > --- a/include/linux/iommu-helper.h > > > +++ b/include/linux/iommu-helper.h > > > @@ -8,3 +8,4 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, > > > unsigned long align_mask); > > > extern void iommu_area_free(unsigned long *map, unsigned long start, > > > unsigned int nr); > > > +extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len); > > > diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c > > > index a3b8d4c..889ddce 100644 > > > --- a/lib/iommu-helper.c > > > +++ b/lib/iommu-helper.c > > > @@ -80,3 +80,11 @@ void iommu_area_free(unsigned long *map, unsigned long start, unsigned int nr) > > > } > > > } > > > EXPORT_SYMBOL(iommu_area_free); > > > + > > > +unsigned long iommu_num_pages(unsigned long addr, unsigned long len) > > > +{ > > > + unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE); > > > + > > > + return size >> PAGE_SHIFT; > > > +} > > > +EXPORT_SYMBOL(iommu_num_pages); > > > > This doesn't work since PAGE_SIZE != IOMMU_PAGE_SIZE on the majority > > of architectures. > > A quick grep in include/ tells me that only powerpc is declaring > IOMMU_PAGE_SIZE by now.
Ah, I just meant the I/O size of IOMMUs. This macro doesn't work for IA64, POWER, and SPARC. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/3] IOMMU: move page number calculation to generic ...
, Joerg Roedel
, (Fri Jul 25, 5:57 am)
[PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Fri Jul 25, 5:57 am)
[PATCH] AMD IOMMU: replace to_pages macro with iommu_num_pages
, Joerg Roedel
, (Fri Jul 25, 5:57 am)
[PATCH] x86 gart: replace to_pages macro with iommu_num_pages
, Joerg Roedel
, (Fri Jul 25, 5:58 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Fri Jul 25, 6:15 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Fri Jul 25, 6:21 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Fri Jul 25, 6:34 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Fri Jul 25, 6:41 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Fri Jul 25, 6:57 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Fri Jul 25, 7:14 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Fri Jul 25, 7:32 am)
Re: [PATCH] add iommu_num_pages helper function
, Ingo Molnar
, (Sat Jul 26, 6:41 am)
Re: [PATCH 0/3] IOMMU: move page number calculation to gen ...
, Ingo Molnar
, (Sat Jul 26, 6:44 am)
Re: [PATCH] add iommu_num_pages helper function
, Stephen Rothwell
, (Mon Jul 28, 6:07 pm)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Mon Jul 28, 6:46 pm)
Re: [PATCH] add iommu_num_pages helper function
, Stephen Rothwell
, (Mon Jul 28, 8:56 pm)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Mon Jul 28, 9:38 pm)
Re: [PATCH] add iommu_num_pages helper function
, David Miller
, (Mon Jul 28, 10:24 pm)
Re: [PATCH] add iommu_num_pages helper function
, David Miller
, (Mon Jul 28, 10:26 pm)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Mon Jul 28, 10:42 pm)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Mon Jul 28, 10:42 pm)
Re: [PATCH] add iommu_num_pages helper function
, Stephen Rothwell
, (Mon Jul 28, 11:45 pm)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Tue Jul 29, 2:50 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Tue Jul 29, 2:58 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Tue Jul 29, 3:02 am)
Re: [PATCH] add iommu_num_pages helper function
, David Miller
, (Tue Jul 29, 3:10 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Tue Jul 29, 3:26 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Tue Jul 29, 3:27 am)
Re: [PATCH] add iommu_num_pages helper function
, Ingo Molnar
, (Tue Jul 29, 3:31 am)
Re: [PATCH] add iommu_num_pages helper function
, David Miller
, (Tue Jul 29, 3:33 am)
Re: [PATCH] add iommu_num_pages helper function
, Ingo Molnar
, (Tue Jul 29, 4:27 am)
Re: [PATCH] add iommu_num_pages helper function
, Stephen Rothwell
, (Tue Jul 29, 5:45 am)
Re: [PATCH] add iommu_num_pages helper function
, Jesse Barnes
, (Tue Jul 29, 8:45 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Wed Jul 30, 5:18 am)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Wed Jul 30, 6:16 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Wed Jul 30, 7:03 am)
Re: [PATCH] add iommu_num_pages helper function
, Joerg Roedel
, (Wed Jul 30, 11:52 am)
Re: [PATCH] add iommu_num_pages helper function
, Benjamin Herrenschmidt
, (Wed Jul 30, 3:44 pm)
Re: [PATCH] add iommu_num_pages helper function
, Benjamin Herrenschmidt
, (Wed Jul 30, 3:44 pm)
Re: [PATCH] add iommu_num_pages helper function
, FUJITA Tomonori
, (Wed Jul 30, 7:07 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
David Daney
[PATCH 5/7] Staging: Octeon Ethernet: Convert to NAPI.
Wolfgang Grandegger
[PATCH net-next v4 1/3] can: mscan: fix improper return if dlc < 8 in start_xmi...
Amit Kumar Salecha
[PATCHv3 NEXT 2/2] NET: Add Qlogic ethernet driver for CNA devices
openbsd-misc
:
Theo de Raadt
Re: Old IPSEC bug
Tomáš Bodžár
Problem with vpnc connection - check group password !
Insan Praja SW
Mandoc Compiling Error
Carl Roberso
Re: Cannot change MTU of carp interface?
Richard Daemon
Re: booting openbsd on eee without cd-rom
Colocation donated by:
Syndicate