Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda into per cpuarea

From: Mike Travis
Date: Mon Jun 23 2008 - 20:02:20 EST


Jeremy Fitzhardinge wrote:
> Mike Travis wrote:
>> The syntax error is at this "DATA(0)" statement. I don't find this as a
>> linker script command or a macro. What is it we're trying to do with
>> this?
>>
>
> In Eric's sample, it's intended to prevent there being an empty section,
> which can cause linker bugs. In your case it probably isn't necessary,
> since you're also putting the percpu data in that section.
>
> "DATA" is probably a typo. It should be "LONG" or something like that.
> (See "3.6.5 Output Section Data" in the linker manual.)
>
> J

Yes, thanks I did find that.

I now have the version below which seems to have what we need... but it
hasn't had an effect on the boot startup panic. I'm back to verifying
that the assembler effective addresses are correct in the loaded object.

ffffffff81911000 D __per_cpu_load
0000000000000000 D per_cpu__pda
0000000000000080 D per_cpu__init_tss
.
.
000000000000a2d0 d per_cpu__cookie_scratch
000000000000a470 d per_cpu__cookie_scratch
000000000000a604 D ____per_cpu_size

Btw, the "percpu : { } :percpu" below removes a linker warning about an empty
section.

#ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
#define PERCPU(align) \
.data.percpu.abs = .; \
percpu : { } :percpu \
.data.percpu.header : AT(.data.percpu.abs - LOAD_OFFSET) { \
BYTE(0) \
. = ALIGN(align); \
__per_cpu_load = .; \
} \
.data.percpu 0 : AT(__per_cpu_load - LOAD_OFFSET) { \
*(.data.percpu.first) \
*(.data.percpu.shared_aligned) \
*(.data.percpu) \
*(.data.percpu.page_aligned) \
____per_cpu_size = .; \
} \
. = __per_cpu_load + ____per_cpu_size;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/