Re: [PATCH for review] [26/145] x86_64: Add initalization of the RDTSCP auxilliary values

Oleg Verych
2006-08-10T23:49:22Z

Andi Kleen:
> ---
> arch/x86_64/kernel/smpboot.c | 2 +
> arch/x86_64/kernel/time.c | 47 ++++++++++++++++++++++++++++++++-----------
> include/asm-x86_64/proto.h | 1
> 3 files changed, 38 insertions(+), 12 deletions(-)
>
> Index: linux/arch/x86_64/kernel/time.c
> ===================================================================
> --- linux.orig/arch/x86_64/kernel/time.c
> +++ linux/arch/x86_64/kernel/time.c
...
> +static int __cpuinit
> +time_cpu_notifier(struct notifier_block *nb, unsigned long action, void *hcpu)
> {
> - char *timename;
> - char *gtod;
> + unsigned cpu = (unsigned long) hcpu;

Is this some kind of "endian magic" ? I mean getting high or low word of 64
pointer to 32 variable ? Why cast just with (unsigned) doesn't work ?

> + if (action == CPU_ONLINE &&
> + cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP)) {
> + unsigned p;
> + p = smp_processor_id() | (cpu_to_node(smp_processor_id())<<12);

Is this code runs under SMP ? I couldn't figure that out.

> + write_rdtscp_aux(p);
> + }
> + return NOTIFY_DONE;
> +}

Thanks.

--
-o--=O`C
#oo'L O
<___=E M