From: "H. Peter Anvin" <hpa@zytor.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
fujita.tomonori@lab.ntt.co.jp, linux-kernel@vger.kernel.org,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH 01/10] x86/iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure.
Date: Thu, 26 Aug 2010 12:48:40 -0700 [thread overview]
Message-ID: <4C76C518.6030301@zytor.com> (raw)
In-Reply-To: <20100826181913.GA5947@merkur.ravnborg.org>
On 08/26/2010 11:19 AM, Sam Ravnborg wrote:
>
> So we have yet another magic section in vmlinux.lds.S
> A nice comemnt that expalins what this is used for and why
> it is discardable etc. would be nice.
>
> Lots of magic sections in same file miss this,
> but thats not an example to follwow.
>
Honestly, I think we this kind of problem -- a mergeable table -- often
enough that we should implement a generic facility for it. It obviously
has to be based on sections, but I think we could automate its creation.
The gPXE people have done that, and this is more or less a summary of
their technique.
Basically, you have a set of sections with names like:
.table.<symbol>.<priority>
... then the linker script looks something like:
.table : {
SORT_BY_NAME(.table.*)
}
use SORT_BY_NAME() in the linker script. To get the start and end
symbols, we define them as solo symbols inside sections designed to sort
first and last (written by hand into email, so adjustments may be
needed, void where prohibited):
#define TABLE(name, priority) \
__section(".table." ## name ## "." ## priority)
#define DECLARE_TABLE(type, name) \
extern type __table ## name ## _start[0]; \
extern type __table ## name ## _end[0];
#define DEFINE_TABLE(type, name) \
type __table ## name ## _start[0] TABLE(name, 0); \
type __table ## name ## _end[0] TABLE(name, 9);
Here "priority" is a digit from 1 (first) to 8 (last); 0 and 9 are used
for the capstones.
Presumably we need a few different flavors for init tables and so on,
but this would make it a generic mechanism.
-hpa
next prev parent reply other threads:[~2010-08-26 19:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 17:57 [RFC PATCH v2] Modularize IOMMUs detection/init for X86 Konrad Rzeszutek Wilk
2010-08-26 17:57 ` [PATCH 01/10] x86/iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure Konrad Rzeszutek Wilk
2010-08-26 18:19 ` Sam Ravnborg
2010-08-26 19:48 ` H. Peter Anvin [this message]
2010-08-26 23:47 ` H. Peter Anvin
2010-08-27 14:38 ` Konrad Rzeszutek Wilk
2010-08-27 14:40 ` Sam Ravnborg
2010-08-27 18:19 ` [PATCH] x86: Adding comments about .iommu_table and its neighbors Konrad Rzeszutek Wilk
2010-08-28 1:54 ` [tip:x86/iommu] x86, doc: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 23:27 ` [tip:x86/iommu] x86, iommu: Add IOMMU_INIT macros, .iommu_table section, and iommu_table_entry structure tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:57 ` [PATCH 02/10] x86/iommu: Make all IOMMU's detection routines return a value Konrad Rzeszutek Wilk
2010-08-26 23:28 ` [tip:x86/iommu] x86, iommu: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:57 ` [PATCH 03/10] x86/iommu: Add proper dependency sort routine (and sanity check) Konrad Rzeszutek Wilk
2010-08-26 23:28 ` [tip:x86/iommu] x86, iommu: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:57 ` [PATCH 04/10] x86/swiotlb: Simplify SWIOTLB pci_swiotlb_detect routine Konrad Rzeszutek Wilk
2010-08-26 23:28 ` [tip:x86/iommu] x86, swiotlb: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:58 ` [PATCH 05/10] x86/swiotlb: Make SWIOTLB use IOMMU_INIT_* macros Konrad Rzeszutek Wilk
2010-08-26 23:29 ` [tip:x86/iommu] x86, swiotlb: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:58 ` [PATCH 06/10] x86/xen-swiotlb: Make Xen-SWIOTLB " Konrad Rzeszutek Wilk
2010-08-26 23:29 ` [tip:x86/iommu] x86, xen-swiotlb: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:58 ` [PATCH 07/10] x86/calgary: Make Calgary IOMMU " Konrad Rzeszutek Wilk
2010-08-26 23:30 ` [tip:x86/iommu] x86, calgary: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:58 ` [PATCH 08/10] x86/GART/AMD-VI: Make AMD GART and " Konrad Rzeszutek Wilk
2010-08-26 23:30 ` [tip:x86/iommu] x86, GART/AMD-VI: " tip-bot for Konrad Rzeszutek Wilk
2010-08-26 17:58 ` [PATCH 09/10] x86/VT-d: Make Intel VT-d " Konrad Rzeszutek Wilk
2010-08-26 23:30 ` [tip:x86/iommu] x86, VT-d: " tip-bot for Konrad Rzeszutek Wilk
2010-09-07 18:10 ` [PATCH 09/10] x86/VT-d: " Tony Luck
2010-09-07 19:07 ` Konrad Rzeszutek Wilk
2010-09-07 19:12 ` Luck, Tony
2010-08-26 17:58 ` [PATCH 10/10] x86/iommu: Utilize the IOMMU_INIT macros functionality Konrad Rzeszutek Wilk
2010-08-26 23:31 ` [tip:x86/iommu] x86, iommu: " tip-bot for Konrad Rzeszutek Wilk
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=4C76C518.6030301@zytor.com \
--to=hpa@zytor.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sam@ravnborg.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox