OpenCloudOS-Kernel/arch/ia64/kernel
Pavel Emelyanov 96ded9dadd [IA64] fix getpid and set_tid_address fast system calls for pid namespaces
The sys_getpid() and sys_set_tid_address() behavior changed from

	return current->tgid

to

	struct pid *pid;
	pid = current->pids[PIDTYPE_PID].pid;
	return pid->numbers[pid->level].nr;

But the fast system calls on ia64 still operate the old way.  Patch them
appropriately to let ia64 work with pid namespaces.  Besides, this is one more
step in deprecating of pid and tgid on task_struct.

The fsys_getppid() is to be patched as well, but its logic is much
more complex now, so I will make it later.

One thing I'm not 100% sure is the trick with the IA64_UPID_SHIFT.  On order
to access the pid->level's element of an array I have to perform the following
calculations

	pid + sizeof(struct upid) * pid->level

The problem is that ia64 can only multiply float point registers, while all
the offsets I have in code are in rXX ones.  Fortunately, the sizeof(struct
upid) is 32 bytes on ia64 (and is very unlikely to ever change), so the
calculations get simpler:

	pid + pid->level << 5

So, I introduce the IA64_UPID_SHIFT and use the shl instruction.  I also
looked at how gcc compiles the similar place and found that it makes it with
shift as well.  Is this OK to do so?

Tested with ski emulator with 2.6.24 kernel, but fits 2.6.25-rc4 and
2.6.25-rc4-mm1 as well.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: David Mosberger-Tang <davidm@hpl.hp.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Amy Griffis <amy.griffis@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
2008-04-09 10:33:36 -07:00
..
cpufreq [CPUFREQ] move policy's governor initialisation out of low-level drivers into cpufreq core 2007-10-04 18:40:57 -04:00
.gitignore [IA64] Add gate.lds to list of files ignored by Git 2007-11-06 15:39:45 -08:00
Makefile [IA64] Itanium MC Error Injection Tool: Makefile changes 2007-01-29 15:27:07 -08:00
acpi-ext.c Pull acpi_os_free into release branch 2006-07-01 17:19:08 -04:00
acpi-processor.c ACPI: Set _PSD ACPI_PDC_SMP_T_SWCOORD 2008-02-02 02:22:43 -05:00
acpi.c Merge branches 'release' and 'fluff' into release 2008-02-07 03:38:22 -05:00
asm-offsets.c [IA64] fix getpid and set_tid_address fast system calls for pid namespaces 2008-04-09 10:33:36 -07:00
audit.c [PATCH] audit signal recipients 2007-05-11 05:38:25 -04:00
brl_emu.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
crash.c [IA64] kdump: crash.c coding style fix 2008-04-09 09:53:27 -07:00
crash_dump.c [IA64] kexec: Minor enhancement to includes in crash.c 2007-02-05 11:31:04 -08:00
cyclone.c cyclone.c: silly use of volatile, __iomem fixes 2007-07-26 11:11:57 -07:00
efi.c [IA64] update efi region debugging to use MB, GB and TB as well as KB 2008-03-06 09:34:11 -08:00
efi_stub.S [IA64] make efi_stub.S fit in 80 cols 2006-06-21 14:35:28 -07:00
entry.S [IA64] Wire up timerfd_{create,settime,gettime} syscalls 2008-02-08 12:00:32 -08:00
entry.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
err_inject.c [IA64] typo s/kenrel/kernel/ 2007-05-10 09:35:30 -07:00
esi.c [IA64] esi-support 2006-06-21 11:19:22 -07:00
esi_stub.S [IA64] esi-support 2006-06-21 11:19:22 -07:00
fsys.S [IA64] fix getpid and set_tid_address fast system calls for pid namespaces 2008-04-09 10:33:36 -07:00
fsyscall_gtod_data.h [IA64] generalize attribute of fsyscall_gtod_data 2008-02-04 15:36:36 -08:00
gate-data.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gate.S [IA64] Stop bit for brl instruction 2007-07-09 13:37:44 -07:00
gate.lds.S [IA64] increase .data.patch offset 2007-12-07 14:28:02 -08:00
head.S [IA64] Remove assembler warnings on head.S 2007-12-19 11:15:12 -08:00
ia64_ksyms.c [IA64] Export three symbols for module use 2008-02-04 15:46:23 -08:00
init_task.c Remove fs.h from mm.h 2007-07-29 17:09:29 -07:00
iosapic.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
irq.c [IA64] Clean up /proc/interrupts output 2007-11-06 15:40:52 -08:00
irq_ia64.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
irq_lsapic.c [IA64] spelling fixes: arch/ia64/ 2007-05-11 14:55:43 -07:00
ivt.S [IA64] relax per-cpu TLB requirement to DTC 2007-02-06 15:04:48 -08:00
jprobes.S [IA64] enable trap code on slot 1 2006-12-12 12:00:55 -08:00
kprobes.c [IA64] kprobes arch consolidation build fix 2008-03-06 09:49:01 -08:00
machine_kexec.c vmcoreinfo: fix the configuration dependencies 2008-02-07 08:42:25 -08:00
machvec.c [IA64] Ensure that machvec is set up takes place before serial console 2007-07-25 11:12:47 -07:00
mca.c [IA64] kdump: add kdump_on_fatal_mca 2008-04-09 09:53:00 -07:00
mca_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv.c [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
minstate.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
module.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
msi_ia64.c [IA64] Fix irq migration in multiple vector domain 2008-03-04 14:16:20 -08:00
numa.c [PATCH] cpumask: export node_to_cpu_mask consistently 2006-10-02 07:57:17 -07:00
pal.S [IA64] reformat pal.S to fit in 80 columns, fix typos 2006-10-17 14:54:19 -07:00
palinfo.c [IA64] Update printing of feature set bits 2007-11-09 13:05:30 -08:00
patch.c [IA64] Clean-up McKinley Errata message 2007-11-06 15:40:07 -08:00
perfmon.c [IA64] use goto to jump out do/while_each_thread 2008-04-09 10:17:03 -07:00
perfmon_default_smpl.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
perfmon_generic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_itanium.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_mckinley.h [IA64] spelling fixes: arch/ia64/ 2007-05-11 14:55:43 -07:00
perfmon_montecito.h [IA64] sparse cleanups 2006-12-07 10:48:19 -08:00
process.c [IA64] Simplify cpu_idle_wait 2008-02-08 12:01:40 -08:00
ptrace.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
relocate_kernel.S [IA64] Removal of percpu TR cleanup in kexec code 2007-05-08 10:00:28 -07:00
sal.c [IA64] workaround tiger ia64_sal_get_physical_id_info hang 2008-03-04 14:26:50 -08:00
salinfo.c [IA64] tree-wide: Misc __cpu{initdata, init, exit} annotations 2007-10-12 14:13:38 -07:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
setup.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
sigframe.h [IA64] Add TIF_RESTORE_SIGMASK 2007-05-08 14:51:59 -07:00
signal.c [IA64] signal(ia64): add a signal stack overflow check 2008-03-04 14:10:59 -08:00
smp.c [IA64] Allow smp_call_function_single() to current cpu 2007-07-30 16:26:45 -07:00
smpboot.c [IA64] Fix unlock ordering in smp_callin 2008-04-09 10:13:13 -07:00
sys_ia64.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
time.c time: fix typo in comments 2008-02-08 09:22:29 -08:00
topology.c Kobject: convert arch/* from kobject_unregister() to kobject_put() 2008-01-24 20:40:39 -08:00
traps.c [IA64] honor notify_die() returning NOTIFY_STOP 2008-02-05 08:26:44 -08:00
unaligned.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
uncached.c [IA64] make flush_tlb_kernel_range() an inline function 2007-12-19 12:30:30 -08:00
unwind.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
unwind_decoder.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unwind_i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmlinux.lds.S all archs: consolidate init and exit sections in vmlinux.lds.h 2008-01-28 23:21:17 +01:00