[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB=NE6V_M7YxnfkZo-TNXTF+2T3VRFfYarHT60bFa6E+QEhBiw@mail.gmail.com>
Date: Thu, 21 Jan 2016 16:19:48 -0800
From: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Roger Pau Monné <roger.pau@...rix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Rusty Russell <rusty@...tcorp.com.au>,
Andy Lutomirski <luto@...capital.net>,
Michael Brown <mcb30@...e.org>,
Juergen Gross <jgross@...e.com>,
Jan Beulich <JBeulich@...e.com>, joro@...tes.org,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
long.wanglong@...wei.com, qiuxishi@...wei.com,
aryabinin@...tuozzo.com,
Mauro Carvalho Chehab <mchehab@....samsung.com>,
Valentin Rothberg <valentinrothberg@...il.com>,
Peter Senna Tschudin <peter.senna@...il.com>,
X86 ML <x86@...nel.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Luis R. Rodriguez" <mcgrof@...e.com>
Subject: Re: [RFC v1 4/8] x86/init: add linker table support
On Thu, Jan 21, 2016 at 11:52 AM, H. Peter Anvin <hpa@...or.com> wrote:
> On 01/21/16 11:50, H. Peter Anvin wrote:
>>
>> Right... we already do that.
>>
>> I don't even think you need to initialize any tables. At least on i386,
>> we have to do this in assembly code. However, it is just a simple table
>> walk. :)
>>
>
> It might make more sense to make subarch its own table, though, although
> I haven't looked at your code in enough detail to say.
The gist of it:
void x86_init_fn_early_init() {
for_each_table_entry(init_fn, X86_INIT_FNS) {
if supported subarc
init_fn->early_init();
}
void x86_init_fn_setup_arch() {
for_each_table_entry(init_fn, X86_INIT_FNS) {
if supported subarc
init_fn->setup_archt();
}
Right now the code defines just an init routine at the stage for
x86_64_start_reservations(), we call the callback early_init(), ie
setup_arch() doesn't exist yet. Since certain routines can run on
either Xen or bare-metal we allow a bitwise OR for the subarch as a
bitmask. I'll think a bit more about how to use subarch for a table,
but can't fit it yet. I'd like to later revise kfree'ing unused
sections, and a table per subarch might be nice for that, but
otherwise this flow seems easy to follow, so if we can kfree sections
within a table we could still accomplish that later.
Luis
Powered by blists - more mailing lists