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

From: Oleg Verych
Date: Thu Aug 10 2006 - 19:46:55 EST


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

-
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/