Re: [PATCH 3/4] x86_64: Fold pda into per cpu area

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeremy Fitzhardinge
Date: Wednesday, June 4, 2008 - 5:59 am

Mike Travis wrote:

Unfortunately that doesn't actually work, because you can't have a reloc 
with two variables.

In something like:

	mov %gs:per_cpu__foo - 12345, %rax
	mov %gs:per_cpu__foo, %rax
	mov %gs:per_cpu__foo - 12345(%rip), %rax
	mov %gs:per_cpu__foo(%rip), %rax
	mov %gs:per_cpu__foo - __per_cpu_start, %rax
	mov %gs:per_cpu__foo - __per_cpu_start(%rip), %rax

the last two lines will not assemble:

t.S:5: Error: can't resolve `per_cpu__foo' {*UND* section} - `__per_cpu_start' {*UND* section}
t.S:6: Error: can't resolve `per_cpu__foo' {*UND* section} - `__per_cpu_start' {*UND* section}

Unfortunately, the only way I can think of fixing this is to compute the 
offset into a temp register, then use that:

	lea per_cpu__foo(%rip), %rax
	mov %gs:__per_cpu_offset(%rax), %rax

(where __per_cpu_offset is defined in the linker script as 
-__per_cpu_start).

This seems to be a general problem with zero-offset per-cpu.  And its 
unfortunate, because no-register access to per-cpu variables is nice to 
have.

The other alternative - and I have no idea whether this is practical or 
possible - is to define  a complete set of pre-offset per_cpu symbols.

    J
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/4] x86_64: Fold pda into per cpu area, Mike Travis, (Tue Jun 3, 5:30 pm)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Jeremy Fitzhardinge, (Wed Jun 4, 5:59 am)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Mike Travis, (Wed Jun 4, 6:48 am)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Jeremy Fitzhardinge, (Wed Jun 4, 6:58 am)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Mike Travis, (Wed Jun 4, 7:17 am)
Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda int ..., Jeremy Fitzhardinge, (Fri Jun 6, 1:29 am)
Re: [PATCH 3/4] x86_64: Fold pda into per cpu area, Christoph Lameter, (Mon Jun 9, 4:18 pm)
Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda int ..., Jeremy Fitzhardinge, (Tue Jun 17, 10:34 pm)
Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda int ..., Jeremy Fitzhardinge, (Wed Jun 18, 10:36 am)
Re: [crash, bisected] Re: [PATCH 3/4] x86_64: Fold pda int ..., Jeremy Fitzhardinge, (Wed Jun 18, 12:33 pm)